diff options
author | lassulus <lass@aidsballs.de> | 2015-10-01 14:48:51 +0200 |
---|---|---|
committer | lassulus <lass@aidsballs.de> | 2015-10-01 14:48:51 +0200 |
commit | 4bacf702b0112a82eb2a4a21ee41c6f11337e8dc (patch) | |
tree | dc2f0e90f9336ba224384c81376ea0c2af2634c0 /default.nix | |
parent | a34de6743a44760d21589d4e1a154ccc5c621420 (diff) | |
parent | 3384dd0a5578cc3a26dd076669dd264f5ae9f008 (diff) |
Merge branch 'tv'
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/default.nix b/default.nix index 1c3341ba7..c6a635c29 100644 --- a/default.nix +++ b/default.nix @@ -1,36 +1,34 @@ -{ user-name, host-name }: +{ current-date +, current-host-name +, current-user-name +}: let lib = import <nixpkgs/lib>; krebs-modules-path = ./krebs/3modules; krebs-pkgs-path = ./krebs/5pkgs; - user-modules-path = ./. + "/${user-name}/3modules"; - user-pkgs-path = ./. + "/${user-name}/5pkgs"; + user-modules-path = ./. + "/${current-user-name}/3modules"; + user-pkgs-path = ./. + "/${current-user-name}/5pkgs"; out = - (lib.mapAttrs (k: v: mk-namespace (./. + "/${k}")) - (lib.filterAttrs - (k: v: !lib.hasPrefix "." k && v == "directory" && - builtins.pathExists (./. + "/${k}/1systems")) - (builtins.readDir ./.))); + lib.mapAttrs (_: builtins.getAttr "main") + (lib.filterAttrs (_: builtins.hasAttr "main") + (lib.mapAttrs + (k: v: + if lib.hasPrefix "." k || v != "directory" then + {} + else if builtins.pathExists (./. + "/${k}/default.nix") then + { main = import (./. + "/${k}"); } + else if builtins.pathExists (./. + "/${k}/1systems") then + { main = mk-namespace (./. + "/${k}"); } + else + {}) + (builtins.readDir ./.))); eval = path: import <nixpkgs/nixos/lib/eval-config.nix> { system = builtins.currentSystem; modules = [ - ({ config, ... }: - with import ./krebs/4lib { inherit lib; }; - { - options.krebs.exec.host = mkOption { - type = types.host; - default = config.krebs.hosts.${host-name}; - }; - options.krebs.exec.user = mkOption { - type = types.user; - default = config.krebs.users.${user-name}; - }; - } - ) path krebs-modules-path user-modules-path |