Skip to content

Commit

Permalink
Merge pull request NixOS#260291 from donovanglover/nixos-containers/o…
Browse files Browse the repository at this point in the history
…ptional-restart

nixos/nixos-containers: add restartIfChanged option
  • Loading branch information
jian-lin authored Oct 16, 2023
2 parents 921c95e + fd7daf9 commit fbc6231
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion nixos/modules/virtualisation/nixos-containers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -826,7 +835,7 @@ in
containerConfig.path
config.environment.etc."${configurationDirectoryName}/${name}.conf".source
];
restartIfChanged = true;
restartIfChanged = containerConfig.restartIfChanged;
}
)
)) config.containers)
Expand Down

0 comments on commit fbc6231

Please sign in to comment.