summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/sync-containers3.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-10-10 22:30:48 +0200
committertv <tv@krebsco.de>2023-10-10 22:30:48 +0200
commit90eb0891c25177b427da5224138f26f6549bdc75 (patch)
tree41e05bbb9420d0b9f3b42a7218da302a5058455c /krebs/3modules/sync-containers3.nix
parentedc9552c6a2f75912cfbc15386d1835a1fbc9dc6 (diff)
parent4f4b7a63da0758d80b74e26dd9d65cd69d200bb2 (diff)
Merge remote-tracking branch 'orange/master'
Diffstat (limited to 'krebs/3modules/sync-containers3.nix')
-rw-r--r--krebs/3modules/sync-containers3.nix20
1 files changed, 12 insertions, 8 deletions
diff --git a/krebs/3modules/sync-containers3.nix b/krebs/3modules/sync-containers3.nix
index c88dd5919..6d3a71324 100644
--- a/krebs/3modules/sync-containers3.nix
+++ b/krebs/3modules/sync-containers3.nix
@@ -32,6 +32,17 @@ in {
type = lib.types.bool;
default = true;
};
+ startCommand = lib.mkOption {
+ type = lib.types.str;
+ default = ''
+ set -efu
+ mkdir -p /var/state/var_src
+ ln -Tfrs /var/state/var_src /var/src
+ if test -e /var/src/nixos-config; then
+ /run/current-system/sw/bin/nixos-rebuild -I /var/src switch || :
+ fi
+ '';
+ };
};
}));
};
@@ -52,14 +63,7 @@ in {
NIX_REMOTE = "daemon";
};
wantedBy = [ "multi-user.target" ];
- serviceConfig.ExecStart = pkgs.writers.writeDash "autoswitch" ''
- set -efu
- mkdir -p /var/state/var_src
- ln -Tfrs /var/state/var_src /var/src
- if test -e /var/src/nixos-config; then
- /run/current-system/sw/bin/nixos-rebuild -I /var/src switch || :
- fi
- '';
+ serviceConfig.ExecStart = pkgs.writers.writeDash "autoswitch" ctr.startCommand;
unitConfig.X-StopOnRemoval = false;
};
};