explicate stockholm configuration

This commit is contained in:
tv 2015-10-17 05:44:42 +02:00
parent 170dddabfb
commit 15c6f0678f
2 changed files with 17 additions and 27 deletions

View File

@ -6,26 +6,23 @@
let let
lib = import <nixpkgs/lib>; lib = import <nixpkgs/lib>;
krebs-modules-path = ./krebs/3modules; nspath = ns: p: ./. + "/${ns}/${p}";
krebs-pkgs-path = ./krebs/5pkgs; kpath = nspath "krebs";
user-modules-path = ./. + "/${current-user-name}/3modules"; upath = nspath current-user-name;
user-pkgs-path = ./. + "/${current-user-name}/5pkgs";
# XXX This is only used interactively, e.g. using get. stockholm = {
pkgs = imports = map (f: f "3modules") [ kpath upath ];
let
pkgs = import <nixpkgs> {}; nixpkgs.config.packageOverrides = pkgs:
args = { let
inherit pkgs; kpkgs = import (kpath "5pkgs") { inherit pkgs; };
lib = pkgs.lib; upkgs = import (upath "5pkgs") { pkgs = pkgs // kpkgs; };
}; in
in kpkgs // upkgs;
pkgs // };
import krebs-pkgs-path args //
import user-pkgs-path args;
out = out =
{ inherit pkgs; } // { inherit (eval {}) pkgs; } //
lib.mapAttrs (_: builtins.getAttr "main") lib.mapAttrs (_: builtins.getAttr "main")
(lib.filterAttrs (_: builtins.hasAttr "main") (lib.filterAttrs (_: builtins.hasAttr "main")
(lib.mapAttrs (lib.mapAttrs
@ -43,15 +40,8 @@ let
eval = path: import <nixpkgs/nixos/lib/eval-config.nix> { eval = path: import <nixpkgs/nixos/lib/eval-config.nix> {
system = builtins.currentSystem; system = builtins.currentSystem;
modules = [ modules = [
stockholm
path path
krebs-modules-path
user-modules-path
] ++ [
({ config, lib, pkgs, ... }@args: {
_module.args.pkgs =
(import krebs-pkgs-path args) //
(import user-pkgs-path args);
})
]; ];
}; };

View File

@ -1,6 +1,6 @@
{ lib, pkgs, ... }: { pkgs, ... }:
with import ../4lib { inherit lib; }; with import ../4lib { inherit (pkgs) lib; };
let let
subdirs = mapAttrs (_: flip pkgs.callPackage {}) (subdirsOf ./.); subdirs = mapAttrs (_: flip pkgs.callPackage {}) (subdirsOf ./.);