mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43: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
|
||||
inherit (stable) lib;
|
||||
in
|
||||
# Only good use case for rec
|
||||
rec {
|
||||
|
||||
wrench = lib.flip lib.pipe;
|
||||
|
||||
needsSystem = lib.flip builtins.elem [
|
||||
|
|
@ -33,20 +31,6 @@ rec {
|
|||
(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 =
|
||||
x:
|
||||
let
|
||||
|
|
@ -149,6 +133,27 @@ rec {
|
|||
_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 =
|
||||
pkgsf: outputs:
|
||||
|
|
@ -192,6 +197,7 @@ rec {
|
|||
];
|
||||
}
|
||||
);
|
||||
|
||||
mkDisko = wrench [
|
||||
(map (name: {
|
||||
name = "disko-${name}";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue