make populate: define and pass lib to krebs/v2

This commit is contained in:
tv 2016-02-02 03:29:42 +01:00
parent 8e219cd0a2
commit 1b67c62f15
2 changed files with 8 additions and 7 deletions

View file

@ -55,14 +55,18 @@ endif
# usage: make populate system=foo [target=bar]
.PHONY: populate
populate: export lib = \
let nlib = import <nixpkgs/lib>; in \
nlib // import krebs/4lib { lib = nlib; } // builtins
populate: export source = \
with (import ~/stockholm {}).users.$(LOGNAME).$(system).config.krebs.build; \
with (import ./. {}).users.$(LOGNAME).$(system).config.krebs.build; \
assert source-version == 2; \
source
populate:;@
result=$$(nix-instantiate \
--eval \
--json \
--arg lib "$$lib" \
--arg source "$$source" \
--argstr target-host "$$target" \
--argstr target-path /var/src \

View file

@ -1,13 +1,10 @@
{ source
{ lib
, source
, target-user ? "root"
, target-host
, target-path ? "/var/src"
}:
with import <nixpkgs/lib>;
with import ~/stockholm/krebs/4lib {
lib = import <nixpkgs/lib>;
};
with builtins;
with lib;
let
out = {
inherit populate;