default.nix: simplify system evaluations
This commit is contained in:
parent
94a09258ad
commit
9c97865f15
21
default.nix
21
default.nix
@ -1,19 +1,12 @@
|
|||||||
import <nixpkgs/nixos/lib/eval-config.nix> {
|
import <nixpkgs/nixos> {} // rec {
|
||||||
modules = [
|
|
||||||
(import <nixpkgs/nixos/lib/from-env.nix> "NIXOS_CONFIG" <nixos-config>)
|
|
||||||
];
|
|
||||||
}
|
|
||||||
//
|
|
||||||
{
|
|
||||||
lib = import ./lib;
|
lib = import ./lib;
|
||||||
systems = with import ./lib; let
|
systems = with lib; let
|
||||||
ns = getEnv "LOGNAME";
|
namespace = getEnv "LOGNAME";
|
||||||
|
systemsDir = <stockholm> + "/${namespace}/1systems";
|
||||||
in
|
in
|
||||||
genAttrs
|
genAttrs
|
||||||
(attrNames (filterAttrs (_: eq "directory") (readDir (<stockholm> + "/${ns}/1systems"))))
|
(attrNames (filterAttrs (_: eq "directory") (readDir systemsDir)))
|
||||||
(name: let
|
(name: import <nixpkgs/nixos> {
|
||||||
config = import (<stockholm> + "/${ns}/1systems/${name}/config.nix");
|
configuration = import (systemsDir + "/${name}/config.nix");
|
||||||
in import <nixpkgs/nixos/lib/eval-config.nix> {
|
|
||||||
modules = [ config ];
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user