refactor3
This commit is contained in:
parent
f012a7d409
commit
f94de157a6
2 changed files with 3 additions and 4 deletions
|
|
@ -52,16 +52,15 @@
|
||||||
} @ inputs: let
|
} @ inputs: let
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
|
|
||||||
systemFromHardwareConf = {
|
systemFromHardwareConf =
|
||||||
hostname:
|
hostname:
|
||||||
let
|
let
|
||||||
hardware = import ./hosts/${hostname}/hardware-configuration.nix;
|
hardware = import ./hosts/${hostname}/hardware-configuration.nix;
|
||||||
args = builtins.functionArgs hardware // { lib.mkdefault = lib.id; };
|
args = builtins.functionArgs hardware // { lib.mkdefault = lib.id; };
|
||||||
in
|
in
|
||||||
(hardware args).nixpkgs.hostPlatform;
|
(hardware args).nixpkgs.hostPlatform;
|
||||||
};
|
|
||||||
|
|
||||||
importNixpks = system: nixpkgs:
|
importNixpkgs = system: nixpkgs:
|
||||||
let
|
let
|
||||||
config.allowUnfreePredicate =
|
config.allowUnfreePredicate =
|
||||||
pkg:
|
pkg:
|
||||||
|
|
@ -88,7 +87,7 @@
|
||||||
builtins.readDir
|
builtins.readDir
|
||||||
(lib.filterAttrs (_: type: type == "directory"))
|
(lib.filterAttrs (_: type: type == "directory"))
|
||||||
# (lib.filterAttrs (name: _: builtins.pathExists ./hosts/${name}/default.nix && builtins.pathExists ./hosts/${name}/hardware.nix && builtins.pathExists ./hosts/${name}/config.nix))
|
# (lib.filterAttrs (name: _: builtins.pathExists ./hosts/${name}/default.nix && builtins.pathExists ./hosts/${name}/hardware.nix && builtins.pathExists ./hosts/${name}/config.nix))
|
||||||
(builtins.mapAttrs (name: _: makeHost name (systemFromHardwareConf name))
|
(builtins.mapAttrs (name: _: makeHost name (systemFromHardwareConf name)))
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue