summaryrefslogtreecommitdiffstats
path: root/default.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-11-14 01:50:39 +0100
committermakefu <github@syntax-fehler.de>2015-11-14 01:50:39 +0100
commita0fbe917ac45cda4de0f16bced3ce3ebfc556fe8 (patch)
tree44b66f4c43eeec674dcd763eb50141dd567c35e7 /default.nix
parent79b890670100d08c3640fffade2caf3eced192d8 (diff)
parentebba531273715c1a9c124007b97f3547d16e780f (diff)
Merge remote-tracking branch 'cd/master' into pre-merge
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix38
1 files changed, 17 insertions, 21 deletions
diff --git a/default.nix b/default.nix
index ac748c28..1637aa46 100644
--- a/default.nix
+++ b/default.nix
@@ -13,40 +13,36 @@ let stockholm = {
krebs = import ./krebs (args // { inherit lib stockholm; });
- lib =
- let
- lib = import <nixpkgs/lib>;
- klib = import ./krebs/4lib { inherit lib; };
- #ulib = import (./. + "/${current-user-name}/4lib") { lib = lib // klib; };
- ulib = {}; # TODO
- in
- builtins // lib // klib // ulib // rec {
- # TODO move this stuff
+ lib = let
+ nlib = import <nixpkgs/lib>;
+ klib = import (slib.kpath "4lib") { lib = nlib; };
+ slib = rec {
stockholm-path = ./.;
nspath = ns: p: stockholm-path + "/${ns}/${p}";
+ kpath = nspath "krebs";
+ upath = nspath current-user-name;
};
+ ulib = let p = slib.upath "4lib"; in
+ nlib.optionalAttrs (klib.dir.has-default-nix p)
+ (import p { lib = nlib // klib; });
+ in nlib // klib // slib // ulib // builtins;
inherit (eval {}) pkgs;
- kpath = lib.nspath "krebs";
- upath = lib.nspath current-user-name;
-
base-module = { config, ... }: {
- imports = builtins.filter builtins.pathExists (lib.concatLists [
- (map (f: f "2configs") [ upath ])
- (map (f: f "3modules") [ kpath upath ])
+ imports = builtins.filter lib.dir.has-default-nix (lib.concatLists [
+ (map (f: f "2configs") [ lib.upath ])
+ (map (f: f "3modules") [ lib.kpath lib.upath ])
]);
krebs.current.enable = true;
krebs.current.host = config.krebs.hosts.${current-host-name};
krebs.current.user = config.krebs.users.${current-user-name};
- nixpkgs.config.packageOverrides = pkgs:
- let
- kpkgs = import (kpath "5pkgs") { inherit lib pkgs; };
- upkgs = import (upath "5pkgs") { inherit lib; pkgs = pkgs // kpkgs; };
- in
- kpkgs // upkgs;
+ nixpkgs.config.packageOverrides = pkgs: let
+ kpkgs = import (lib.kpath "5pkgs") { inherit lib pkgs; };
+ upkgs = import (lib.upath "5pkgs") { inherit lib; pkgs = pkgs // kpkgs; };
+ in kpkgs // upkgs;
};
eval = config: import <nixpkgs/nixos/lib/eval-config.nix> {