mirror of
https://github.com/thegeneralist01/config.git
synced 2026-03-07 10:59:55 +01:00
55 lines
1.6 KiB
Nix
55 lines
1.6 KiB
Nix
{
|
|
description = "thegeneralist's config flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nix-darwin = {
|
|
url = "github:nix-darwin/nix-darwin/master";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
agenix = {
|
|
url = "github:ryantm/agenix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.home-manager.follows = "home-manager";
|
|
inputs.darwin.follows = "nix-darwin";
|
|
};
|
|
ghostty = {
|
|
url = "github:ghostty-org/ghostty";
|
|
};
|
|
fenix = {
|
|
url = "github:nix-community/fenix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nil = {
|
|
url = "github:oxalica/nil";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
# wrapper-manager = {
|
|
# url = "github:viperML/wrapper-manager";
|
|
# inputs.nixpkgs.follows = "nixpkgs";
|
|
# };
|
|
#nix.url = "github:DeterminateSystems/nix-src";
|
|
};
|
|
|
|
outputs = inputs@{ self, nixpkgs, nix-darwin, nix, ... }: let
|
|
inherit (builtins) readDir;
|
|
inherit (nixpkgs.lib) attrsToList const groupBy listToAttrs mapAttrs;
|
|
#nix.enable = false;
|
|
|
|
lib = nixpkgs.lib // nix-darwin.lib;
|
|
|
|
targetHost = readDir ./hosts
|
|
|> mapAttrs (name: const <| import ./hosts/${name} lib inputs self)
|
|
|> attrsToList
|
|
|> groupBy (host:
|
|
if host.name == "thegeneralist" || host.name == "thegeneralist-central" then
|
|
"nixosConfigurations"
|
|
else
|
|
"darwinConfigurations")
|
|
|> mapAttrs (const listToAttrs);
|
|
in targetHost;
|
|
}
|