utils: small cleanup

This commit is contained in:
Timothy DeHerrera 2019-12-21 19:02:22 -07:00
parent 1f55960518
commit e7079c5c63
No known key found for this signature in database
GPG key ID: 8985725DB5B0C122
2 changed files with 5 additions and 8 deletions

View file

@ -3,8 +3,7 @@ let
utils = import ../lib/utils.nix { lib = nixpkgs.lib; };
inherit (utils)
reqImport
vimport
recImport
;
@ -24,7 +23,7 @@ let
system.configurationRevision = flake.rev;
};
local = vimport ./. "${self}.nix";
local = import "${toString ./.}/${self}.nix";
in
[
core
@ -36,6 +35,6 @@ let
};
hosts =
reqImport { dir = ./.; _import = config; };
recImport { dir = ./.; _import = config; };
in
hosts

View file

@ -24,11 +24,9 @@ rec {
mapFilterAttrs = seive: f: attrs:
filterAttrs seive (mapAttrs' f attrs);
vimport = path: name: import (path + "/${name}");
reqImport =
recImport =
{ dir
, _import ? base: vimport dir (base + ".nix")
, _import ? base: import "${dir}/${base}.nix"
}:
mapFilterAttrs
(_: v: v != null)