mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
fix _file in /hosts
This commit is contained in:
parent
dd08a1d70d
commit
66b902c1f5
1 changed files with 9 additions and 7 deletions
|
|
@ -32,7 +32,13 @@ rec {
|
|||
path:
|
||||
builtins.filter (lib.hasSuffix ".nix") (map toString (lib.filesystem.listFilesRecursive path));
|
||||
|
||||
importAll = path: map (module: (import module inputs)) (listNixFilesRecursive path);
|
||||
fixModuleSystem =
|
||||
file:
|
||||
lib.pipe file [
|
||||
builtins.readFile
|
||||
(builtins.replaceStrings (lib.singleton "#_file") (lib.singleton ''_file = "${file}";''))
|
||||
(builtins.toFile (builtins.baseNameOf file))
|
||||
];
|
||||
|
||||
mkModules =
|
||||
path:
|
||||
|
|
@ -43,11 +49,7 @@ rec {
|
|||
(lib.removeSuffix ".nix")
|
||||
(lib.removePrefix "${toString path}/")
|
||||
];
|
||||
value = lib.pipe name [
|
||||
builtins.readFile
|
||||
(builtins.replaceStrings (lib.singleton "#_file") (lib.singleton ''_file = "${name}";''))
|
||||
(builtins.toFile (builtins.baseNameOf path))
|
||||
];
|
||||
value = fixModuleSystem name;
|
||||
}) (listNixFilesRecursive path)
|
||||
);
|
||||
|
||||
|
|
@ -81,7 +83,7 @@ rec {
|
|||
in
|
||||
builtins.concatLists [
|
||||
(importWithInputs' (builtins.attrValues self.nixosModules))
|
||||
(importWithInputs' (listNixFilesRecursive "${self}/hosts/${name}"))
|
||||
(importWithInputs' (map fixModuleSystem (listNixFilesRecursive (../. + "/hosts/${name}"))))
|
||||
(import "${unstable}/nixos/modules/module-list.nix")
|
||||
(lib.singleton {
|
||||
networking.hostName = name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue