mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
nifty import functions
This commit is contained in:
parent
9c85859e1f
commit
977d1ad6d2
17 changed files with 28 additions and 84 deletions
32
flake.nix
32
flake.nix
|
|
@ -47,18 +47,23 @@
|
|||
...
|
||||
}: let
|
||||
lib = unstable.lib;
|
||||
|
||||
importAll = path:
|
||||
lib.forEach (
|
||||
builtins.filter (file: lib.hasSuffix ".nix" file)
|
||||
(lib.filesystem.listFilesRecursive path)
|
||||
)
|
||||
(module: (import module inputs));
|
||||
|
||||
mkSystems = system: names:
|
||||
lib.genAttrs names (
|
||||
name:
|
||||
lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit self;
|
||||
};
|
||||
modules = [
|
||||
(import ./modules inputs)
|
||||
(import "${self}/systems/${name}" inputs)
|
||||
];
|
||||
specialArgs = {inherit self;};
|
||||
modules =
|
||||
importAll ./modules
|
||||
++ importAll "${self}/systems/${name}";
|
||||
}
|
||||
);
|
||||
in
|
||||
|
|
@ -94,11 +99,20 @@
|
|||
inherit system;
|
||||
format = "install-iso";
|
||||
modules = [
|
||||
(import ./pkgs/nixos-iso inputs)
|
||||
(import ./installer inputs)
|
||||
];
|
||||
};
|
||||
}
|
||||
// (import ./pkgs pkgs);
|
||||
// builtins.listToAttrs (
|
||||
lib.forEach (
|
||||
builtins.filter (file: lib.hasSuffix ".nix" file)
|
||||
(lib.filesystem.listFilesRecursive ./pkgs)
|
||||
)
|
||||
(module: {
|
||||
name = lib.removeSuffix ".nix" (builtins.baseNameOf module);
|
||||
value = pkgs.callPackage module {};
|
||||
})
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue