summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2023-10-05 21:25:37 +0200
committerlassulus <git@lassul.us>2023-10-05 21:30:40 +0200
commit84818541d5db5a1c129c29506a6eca8e8faf6522 (patch)
tree363c00ecaaf732b569af4f272000e74afe82fb7d
parent5cc5e2d1e6d33279a90caf15cb8d72ea437393c9 (diff)
sync-containers3: add startComamnd option
-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;
};
};