mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 06:00: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:
|
||||
nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
modules =
|
||||
[
|
||||
../modules/common.nix
|
||||
|
||||
# ({...}: nixpkgs.overlays = [ import ../overlays {}; ])
|
||||
(_:
|
||||
{ nixpkgs.overlays = import ../overlays _ ++
|
||||
[inputs.pinix.overlays.default]; })
|
||||
../overlays
|
||||
]
|
||||
++ filter isNixFile (listFilesRecursive (../. + "/hosts/${hostname}"));
|
||||
++ filter
|
||||
isNixFile
|
||||
(listFilesRecursive (../. + "/hosts/${hostname}"));
|
||||
|
||||
specialArgs = {inherit inputs mkRune;};
|
||||
};
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
# import all nix files in the current folder,
|
||||
# and execute them with args as parameters
|
||||
# The return value is a list of all execution results,
|
||||
# which is the list of overlays
|
||||
args:
|
||||
{inputs, ...}: let
|
||||
defaultOverlays =
|
||||
# execute and import all overlay files in the current
|
||||
# directory with the given args
|
||||
builtins.map
|
||||
# execute and import the overlay file
|
||||
(f: (import (./. + "/${f}") args))
|
||||
(f: (import (./. + "/${f}") {inherit inputs;}))
|
||||
# find all overlay files in the current directory
|
||||
(builtins.filter
|
||||
(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