diff options
author | lassulus <lassulus@lassul.us> | 2023-01-02 23:31:53 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2023-01-02 23:31:53 +0100 |
commit | 32966b38aed6f495e425bc5f1d54761534bc019b (patch) | |
tree | aabac2d0eb1181c32641b464dbb76681b04a2b6d /lass/3modules | |
parent | a38c39424f29bbdfe1493061da05326f9d05d4a0 (diff) |
l sync-containers3: add runContainer option
Diffstat (limited to 'lass/3modules')
-rw-r--r-- | lass/3modules/sync-containers3.nix | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lass/3modules/sync-containers3.nix b/lass/3modules/sync-containers3.nix index 02ba0a5ff..86aa40f03 100644 --- a/lass/3modules/sync-containers3.nix +++ b/lass/3modules/sync-containers3.nix @@ -28,6 +28,10 @@ in { type = lib.types.bool; default = false; }; + runContainer = lib.mkOption { + type = lib.types.bool; + default = true; + }; }; })); }; @@ -74,7 +78,7 @@ in { isReadOnly = false; }; }; - }) cfg.containers; + }) (lib.filterAttrs (_: ctr: ctr.runContainer) cfg.containers); systemd.services = lib.foldr lib.recursiveUpdate {} (lib.flatten (map (ctr: [ { "${ctr.name}_syncer" = { @@ -108,7 +112,7 @@ in { ''; }; }; } - { "${ctr.name}_watcher" = { + { "${ctr.name}_watcher" = lib.mkIf ctr.runContainer { path = with pkgs; [ coreutils consul @@ -164,7 +168,7 @@ in { ''; }; }; } - { "${ctr.name}_scheduler" = { + { "${ctr.name}_scheduler" = lib.mkIf ctr.runContainer { wantedBy = [ "multi-user.target" ]; path = with pkgs; [ coreutils |