summaryrefslogtreecommitdiffstats
path: root/nin/krops.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2018-11-05 18:20:42 +0100
committermakefu <github@syntax-fehler.de>2018-11-05 18:20:42 +0100
commitf10ed24e2ef5fb022d39ad6adcdd83b67761d0d7 (patch)
tree3a8c0061382b44dda6c9b77af8ed3189ed62c74f /nin/krops.nix
parent38592704cd325dca6282cc98f51e493ab73b435f (diff)
parent1c315c576c1112459eed2c96b043cba6d63648e5 (diff)
Merge remote-tracking branch 'lassul.us/master'
Diffstat (limited to 'nin/krops.nix')
-rw-r--r--nin/krops.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/nin/krops.nix b/nin/krops.nix
new file mode 100644
index 0000000..fef8cc3
--- /dev/null
+++ b/nin/krops.nix
@@ -0,0 +1,36 @@
+{ name }: let
+ inherit (import ../krebs/krops.nix { inherit name; })
+ krebs-source
+ lib
+ pkgs
+ ;
+
+ source = { test }: lib.evalSource [
+ krebs-source
+ {
+ nixos-config.symlink = "stockholm/nin/1systems/${name}/config.nix";
+ secrets = if test then {
+ file = toString ./0tests/dummysecrets;
+ } else {
+ pass = {
+ dir = "${lib.getEnv "HOME"}/.password-store";
+ name = "hosts/${name}";
+ };
+ };
+ }
+ ];
+
+in {
+ # usage: $(nix-build --no-out-link --argstr name HOSTNAME -A deploy)
+ deploy = pkgs.krops.writeDeploy "${name}-deploy" {
+ source = source { test = false; };
+ target = "root@${name}/var/src";
+ };
+
+ # usage: $(nix-build --no-out-link --argstr name HOSTNAME --argstr target PATH -A test)
+ test = { target }: pkgs.krops.writeTest "${name}-test" {
+ force = true;
+ inherit target;
+ source = source { test = true; };
+ };
+}