parts/lib: add modules.nix and add to builders.nix
This commit is contained in:
parent
14bc47f256
commit
79c98ac67b
3 changed files with 79 additions and 10 deletions
|
@ -1,9 +1,12 @@
|
|||
{inputs, ...}: let
|
||||
inherit (inputs) self nixpkgs;
|
||||
inherit (nixpkgs) lib;
|
||||
inherit (lib) mkDefault nixosSystem recursiveUpdate singleton;
|
||||
inherit (builtins) concatLists;
|
||||
in {
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (inputs) self;
|
||||
inherit (lib) mkDefault nixosSystem recursiveUpdate;
|
||||
inherit (lib.lists) singleton concatLists flatten;
|
||||
inherit (lib.extendedLib.modules) mkModuleTree';
|
||||
mkSystem = {
|
||||
withSystem,
|
||||
system,
|
||||
|
@ -38,4 +41,18 @@ in {
|
|||
];
|
||||
}
|
||||
);
|
||||
mkModulesForSystem = {
|
||||
hostname,
|
||||
modulePath ? ./modules,
|
||||
...
|
||||
} @ args:
|
||||
flatten (
|
||||
concatLists [
|
||||
(self.outPath + ./.)
|
||||
(mkModuleTree' {path = self.outPath + modulePath;})
|
||||
# singleton
|
||||
]
|
||||
);
|
||||
in {
|
||||
inherit mkSystem mkModulesForSystem;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue