mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 14:20:44 -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,
|
|
||||||
# which is the list of overlays
|
|
||||||
args:
|
|
||||||
# execute and import all overlay files in the current
|
# execute and import all overlay files in the current
|
||||||
# directory with the given args
|
# directory with the given args
|
||||||
builtins.map
|
builtins.map
|
||||||
# execute and import the overlay file
|
# execute and import the overlay file
|
||||||
(f: (import (./. + "/${f}") args))
|
(f: (import (./. + "/${f}") {inherit inputs;}))
|
||||||
# find all overlay files in the current directory
|
# find all overlay files in the current directory
|
||||||
(builtins.filter
|
(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