diff options
author | lassulus <git@lassul.us> | 2023-10-05 21:25:37 +0200 |
---|---|---|
committer | lassulus <git@lassul.us> | 2023-10-05 21:30:40 +0200 |
commit | 84818541d5db5a1c129c29506a6eca8e8faf6522 (patch) | |
tree | 363c00ecaaf732b569af4f272000e74afe82fb7d /krebs/3modules | |
parent | 5cc5e2d1e6d33279a90caf15cb8d72ea437393c9 (diff) |
sync-containers3: add startComamnd option
Diffstat (limited to 'krebs/3modules')
-rw-r--r-- | krebs/3modules/sync-containers3.nix | 20 |
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; }; }; |