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.
This commit is contained in:
parent
97ec5b4c08
commit
fd7daf9fc4
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user