mirror of
https://github.com/RGBCube/ncc
synced 2025-07-29 11:07:44 +00:00
Move collect to inside lib
This commit is contained in:
parent
d5e7291b82
commit
64e2dc5f71
3 changed files with 25 additions and 22 deletions
|
@ -1,5 +1,6 @@
|
|||
inputs: self: super: let
|
||||
option = import ./option.nix inputs self super;
|
||||
system = import ./system.nix inputs self super;
|
||||
values = import ./values.nix inputs self super;
|
||||
in option // system // values
|
||||
filesystem = import ./filesystem.nix inputs self super;
|
||||
option = import ./option.nix inputs self super;
|
||||
system = import ./system.nix inputs self super;
|
||||
values = import ./values.nix inputs self super;
|
||||
in filesystem // option // system // values
|
||||
|
|
7
lib/filesystem.nix
Normal file
7
lib/filesystem.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
_: self: super: let
|
||||
inherit (self) filter hasSuffix;
|
||||
inherit (self.filesystem) listFilesRecursive;
|
||||
in {
|
||||
collect = path: listFilesRecursive path
|
||||
|> filter (hasSuffix ".nix");
|
||||
}
|
|
@ -1,12 +1,8 @@
|
|||
inputs: self: super: let
|
||||
inherit (self) attrValues filter getAttrFromPath hasAttrByPath hasSuffix;
|
||||
inherit (self.filesystem) listFilesRecursive;
|
||||
|
||||
collect = path: listFilesRecursive path
|
||||
|> filter (hasSuffix ".nix");
|
||||
inherit (self) attrValues filter getAttrFromPath hasAttrByPath collect;
|
||||
|
||||
commonModules = collect ../modules/common;
|
||||
nixosModules = collect ../modules/nixos;
|
||||
nixosModules = collect ../modules/linux;
|
||||
darwinModules = collect ../modules/darwin;
|
||||
|
||||
collectInputs = let
|
||||
|
@ -20,34 +16,33 @@ inputs: self: super: let
|
|||
|
||||
inputOverlays = collectInputs [ "overlays" "default" ];
|
||||
overlayModule = { nixpkgs.overlays = inputOverlays; };
|
||||
|
||||
specialArgs = inputs // {
|
||||
inherit inputs;
|
||||
|
||||
keys = import ../keys.nix;
|
||||
lib = self;
|
||||
};
|
||||
in {
|
||||
nixosSystem = module: super.nixosSystem {
|
||||
inherit specialArgs;
|
||||
|
||||
modules = [
|
||||
module
|
||||
overlayModule
|
||||
] ++ commonModules
|
||||
++ nixosModules
|
||||
++ inputNixosModules;
|
||||
|
||||
specialArgs = inputs // {
|
||||
inherit inputs;
|
||||
|
||||
lib = self;
|
||||
};
|
||||
};
|
||||
|
||||
darwinSystem = module: super.darwinSystem {
|
||||
inherit specialArgs;
|
||||
|
||||
modules = [
|
||||
module
|
||||
overlayModule
|
||||
] ++ commonModules
|
||||
++ darwinModules
|
||||
++ inputDarwinModules;
|
||||
|
||||
specialArgs = inputs // {
|
||||
inherit inputs;
|
||||
|
||||
lib = self;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue