Still working on the flakes...

This commit is contained in:
Niten 2021-08-16 18:15:42 -07:00
parent b5f62d0459
commit 05ba61cb4e
2 changed files with 20 additions and 41 deletions

22
flake.lock generated
View File

@ -22,11 +22,8 @@
} }
}, },
"hosts": { "hosts": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": { "locked": {
"narHash": "sha256-28zT4n5SyxcE9KI4b6RowZyMuzlZ6FIw2KE6xX8OTnA=", "narHash": "sha256-Zbuk45B7idsdhuKwCg7ci8kKM4ts9I4Fw6huDkVZh5c=",
"path": "../fudo-hosts", "path": "../fudo-hosts",
"type": "path" "type": "path"
}, },
@ -50,26 +47,11 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1629033443,
"narHash": "sha256-Vo3TvQvR5hsd3incx/xOt6GFgTm651CYVauHS/irOFo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8ac785da9843aa110caeed6c912875e46a415a11",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-21.05",
"type": "indirect"
}
},
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"hosts": "hosts", "hosts": "hosts",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs"
} }
} }
}, },

View File

@ -10,16 +10,14 @@
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { nixpkgs, hosts, home-manager, ... }: with builtins; outputs = { nixpkgs, hosts, home-manager, ... }: with builtins; let
{ mapAttrs = f: m: listToAttrs
nixosConfigurations = listToAttrs (map (hostname: (map (k: { name = k; value = f k m.${k}; }) (attrNames m));
let in {
hostOpts = hosts.host-configs.${hostname}; nixosConfigurations = mapAttrs (hostname: hostOpts: let
pkgs = import nixpkgs { system = hostOpts.arch; }; pkgs = import nixpkgs { system = hostOpts.arch; };
in { in pkgs.lib.nixosSystem {
name = hostname;
value = pkgs.lib.nixosSystem {
system = hostOpts.arch; system = hostOpts.arch;
modules = [ modules = [
(import ./initialize.nix { (import ./initialize.nix {
@ -29,7 +27,6 @@
include-secrets = true; include-secrets = true;
}) })
]; ];
}; }) hosts.host-configs;
}) (attrNames hosts.host-configs));
}; };
} }