Working on flake

This commit is contained in:
Niten 2021-08-06 16:30:35 -07:00
parent 5b92cefc97
commit 801d5a4cfc

View File

@ -20,13 +20,14 @@ in {
builtins.replaceStrings [ ".nix" ] [ "" ] filename;
hosts = map hostname-from-file (lib.attrNames (lib.filterAttrs is-nix-file
(lib.filterAttrs is-regular-file (builtins.readDir hosts-path))));
hostsOpts = lib.listToAttrs (hostname:
lib.nameValuePair hostname (import hosts-path + "/${hostname}.nix"));
pkgs = import nixpkgs { };
in {
nixConfigurations = lib.mapAttrs (hostname:
let hostOpts = import hosts-path + "/${hostname}.nix";
in lib.nixosSystem {
nixConfigurations = lib.mapAttrs (hostname: hostOpts:
lib.nixosSystem {
system = hostOpts.platform;
modules = [
(import ./initialize.nix {
@ -36,6 +37,6 @@ in {
include-secrets = true;
})
];
}) hosts;
}) hostsOpts;
};
}