some reorganizing
This commit is contained in:
parent
df9e8ae8bf
commit
113e015135
182 changed files with 443 additions and 449 deletions
29
lib/default.nix
Normal file
29
lib/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
l: let
|
||||
b = builtins;
|
||||
in rec {
|
||||
loadBranch = branch:
|
||||
l.mapAttrs' (leaf: _: {
|
||||
name = l.removeSuffix ".nix" leaf;
|
||||
value = /${branch}/${leaf};
|
||||
}) (b.readDir /${branch});
|
||||
|
||||
loadTree2 = dir: (l.mapAttrs (branch: _: loadBranch /${dir}/${branch})) (b.readDir dir);
|
||||
|
||||
loadTreeInf = dir:
|
||||
l.mapAttrs' (
|
||||
name: value: {
|
||||
name = l.removeSuffix ".nix" name;
|
||||
value =
|
||||
if value == "directory"
|
||||
then loadTreeInf (dir + /${name})
|
||||
else (dir + /${name});
|
||||
}
|
||||
) (b.readDir dir);
|
||||
|
||||
loadConfigurations = dir: specialArgs:
|
||||
(b.mapAttrs (name: _:
|
||||
l.nixosSystem {
|
||||
modules = [(dir + /${name})];
|
||||
inherit specialArgs;
|
||||
})) (b.readDir dir);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue