mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 08:53:56 -05:00
fix: removed rec in lib
You should be able to specify everything and inherit everything back into the `in` expression.
This commit is contained in:
parent
c85f5a5687
commit
25c30cabaa
1 changed files with 23 additions and 17 deletions
|
|
@ -6,9 +6,7 @@ inputs@{
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (stable) lib;
|
inherit (stable) lib;
|
||||||
in
|
|
||||||
# Only good use case for rec
|
|
||||||
rec {
|
|
||||||
wrench = lib.flip lib.pipe;
|
wrench = lib.flip lib.pipe;
|
||||||
|
|
||||||
needsSystem = lib.flip builtins.elem [
|
needsSystem = lib.flip builtins.elem [
|
||||||
|
|
@ -33,20 +31,6 @@ rec {
|
||||||
(builtins.filter (x: !lib.hasPrefix "_" (builtins.baseNameOf x) && lib.hasSuffix ".nix" x))
|
(builtins.filter (x: !lib.hasPrefix "_" (builtins.baseNameOf x) && lib.hasSuffix ".nix" x))
|
||||||
];
|
];
|
||||||
|
|
||||||
mkModules =
|
|
||||||
path:
|
|
||||||
lib.pipe path [
|
|
||||||
listNixFilesRecursive
|
|
||||||
(map (name: {
|
|
||||||
name = lib.pipe name [
|
|
||||||
(lib.removeSuffix ".nix")
|
|
||||||
(lib.removePrefix "${path}/")
|
|
||||||
];
|
|
||||||
value = addSchizophreniaToModule name;
|
|
||||||
}))
|
|
||||||
builtins.listToAttrs
|
|
||||||
];
|
|
||||||
|
|
||||||
addSchizophreniaToModule =
|
addSchizophreniaToModule =
|
||||||
x:
|
x:
|
||||||
let
|
let
|
||||||
|
|
@ -149,6 +133,27 @@ rec {
|
||||||
_file = x;
|
_file = x;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
in {
|
||||||
|
inherit
|
||||||
|
wrench
|
||||||
|
needsSystem
|
||||||
|
constructInputs'
|
||||||
|
listNixFilesRecursive
|
||||||
|
addSchizophreniaToModule;
|
||||||
|
|
||||||
|
mkModules =
|
||||||
|
path:
|
||||||
|
lib.pipe path [
|
||||||
|
listNixFilesRecursive
|
||||||
|
(map (name: {
|
||||||
|
name = lib.pipe name [
|
||||||
|
(lib.removeSuffix ".nix")
|
||||||
|
(lib.removePrefix "${path}/")
|
||||||
|
];
|
||||||
|
value = addSchizophreniaToModule name;
|
||||||
|
}))
|
||||||
|
builtins.listToAttrs
|
||||||
|
];
|
||||||
|
|
||||||
gerg-utils =
|
gerg-utils =
|
||||||
pkgsf: outputs:
|
pkgsf: outputs:
|
||||||
|
|
@ -192,6 +197,7 @@ rec {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
mkDisko = wrench [
|
mkDisko = wrench [
|
||||||
(map (name: {
|
(map (name: {
|
||||||
name = "disko-${name}";
|
name = "disko-${name}";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue