Unverified Commit fd7daf9f authored by Donovan Glover's avatar Donovan Glover
Browse files

nixos/nixos-containers: add restartIfChanged option

This commit makes auto-restarting declarative containers optional.

This is useful when you don't want changes to your config to automatically
restart the container and thus stop any applications running inside it.
parent 97ec5b4c
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -649,6 +649,15 @@ in
              '';
            };

            restartIfChanged = mkOption {
              type = types.bool;
              default = true;
              description = lib.mdDoc ''
                Whether the container should be restarted during a NixOS
                configuration switch if its definition has changed.
              '';
            };

            timeoutStartSec = mkOption {
              type = types.str;
              default = "1min";
@@ -826,7 +835,7 @@ in
                containerConfig.path
                config.environment.etc."${configurationDirectoryName}/${name}.conf".source
              ];
              restartIfChanged = true;
              restartIfChanged = containerConfig.restartIfChanged;
            }
          )
      )) config.containers)