summaryrefslogtreecommitdiffstats
path: root/jeschli/krops.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2018-09-08 18:53:49 +0200
committermakefu <github@syntax-fehler.de>2018-09-08 18:53:49 +0200
commitbe93f44a4c043f3b5177ee4fb971956677ae30ea (patch)
tree71006153c7a728490bfd03c291549063381835b0 /jeschli/krops.nix
parent932ce82229626eb82c01c92a1c9ae5a161dc7970 (diff)
parentaf9935950e251c1c61139ac85080805ba29632b4 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'jeschli/krops.nix')
-rw-r--r--jeschli/krops.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/jeschli/krops.nix b/jeschli/krops.nix
new file mode 100644
index 0000000..e55f207
--- /dev/null
+++ b/jeschli/krops.nix
@@ -0,0 +1,40 @@
+{ name }: let
+ inherit (import ../krebs/krops.nix { inherit name; })
+ krebs-source
+ lib
+ pkgs
+ ;
+
+ source = { test }: lib.evalSource [
+ krebs-source
+ {
+ nixos-config.symlink = "stockholm/jeschli/1systems/${name}/config.nix";
+ secrets = if test then {
+ file = toString ./2configs/tests/dummy-secrets;
+ } 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 -A test)
+ test = pkgs.krops.writeTest "${name}-test" {
+ source = source { test = true; };
+ target = "${lib.getEnv "HOME"}/tmp/${name}-stockholm-test";
+ };
+
+ ci = pkgs.krops.writeTest "${name}-test" {
+ source = source { test = true; };
+ target = "${lib.getEnv "HOME"}/stockholm-build";
+ };
+}