mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 10:10:45 -06:00
improve module system more
This commit is contained in:
parent
daf4845e6e
commit
208e54b34c
2 changed files with 24 additions and 21 deletions
|
@ -32,15 +32,14 @@ in rec {
|
||||||
mkSystem = hostname:
|
mkSystem = hostname:
|
||||||
nixosSystem {
|
nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules =
|
||||||
|
[
|
||||||
../modules/common.nix
|
../modules/common.nix
|
||||||
|
../overlays
|
||||||
# ({...}: nixpkgs.overlays = [ import ../overlays {}; ])
|
|
||||||
(_:
|
|
||||||
{ nixpkgs.overlays = import ../overlays _ ++
|
|
||||||
[inputs.pinix.overlays.default]; })
|
|
||||||
]
|
]
|
||||||
++ filter isNixFile (listFilesRecursive (../. + "/hosts/${hostname}"));
|
++ filter
|
||||||
|
isNixFile
|
||||||
|
(listFilesRecursive (../. + "/hosts/${hostname}"));
|
||||||
|
|
||||||
specialArgs = {inherit inputs mkRune;};
|
specialArgs = {inherit inputs mkRune;};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
# import all nix files in the current folder,
|
{inputs, ...}: let
|
||||||
# and execute them with args as parameters
|
defaultOverlays =
|
||||||
# The return value is a list of all execution results,
|
# execute and import all overlay files in the current
|
||||||
# which is the list of overlays
|
# directory with the given args
|
||||||
args:
|
builtins.map
|
||||||
# execute and import all overlay files in the current
|
# execute and import the overlay file
|
||||||
# directory with the given args
|
(f: (import (./. + "/${f}") {inherit inputs;}))
|
||||||
builtins.map
|
# find all overlay files in the current directory
|
||||||
# execute and import the overlay file
|
(builtins.filter
|
||||||
(f: (import (./. + "/${f}") args))
|
|
||||||
# find all overlay files in the current directory
|
|
||||||
(builtins.filter
|
|
||||||
(f: f != "default.nix")
|
(f: f != "default.nix")
|
||||||
(builtins.attrNames (builtins.readDir ./.)))
|
(builtins.attrNames (builtins.readDir ./.)));
|
||||||
|
in {
|
||||||
|
nixpkgs.overlays =
|
||||||
|
defaultOverlays
|
||||||
|
++ [
|
||||||
|
inputs.pinix.overlays.default
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue