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

View file

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