Merge pull request #260291 from donovanglover/nixos-containers/optional-restart

nixos/nixos-containers: add restartIfChanged option
This commit is contained in:
Lin Jian 2023-10-16 20:41:32 +08:00 committed by GitHub
commit fbc62319f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)