don’t enable auto updates when nix is disable:
All checks were successful
Hydra nixosConfigurations.container-default-aarch64-linux Hydra build #22714 of nixos-config:pr618:nixosConfigurations.container-default-aarch64-linux
Hydra nixosConfigurations.container-default-riscv64-linux Hydra build #22715 of nixos-config:pr618:nixosConfigurations.container-default-riscv64-linux
Hydra checks.x86_64-linux.containers-default Hydra build #22713 of nixos-config:pr618:checks.x86_64-linux.containers-default
Hydra nixosConfigurations.not522 Hydra build #22717 of nixos-config:pr618:nixosConfigurations.not522
Hydra nixosConfigurations.not522-installer Hydra build #22718 of nixos-config:pr618:nixosConfigurations.not522-installer
Hydra nixosConfigurations.container-default-x86_64-linux Hydra build #22716 of nixos-config:pr618:nixosConfigurations.container-default-x86_64-linux
All checks were successful
Hydra nixosConfigurations.container-default-aarch64-linux Hydra build #22714 of nixos-config:pr618:nixosConfigurations.container-default-aarch64-linux
Hydra nixosConfigurations.container-default-riscv64-linux Hydra build #22715 of nixos-config:pr618:nixosConfigurations.container-default-riscv64-linux
Hydra checks.x86_64-linux.containers-default Hydra build #22713 of nixos-config:pr618:checks.x86_64-linux.containers-default
Hydra nixosConfigurations.not522 Hydra build #22717 of nixos-config:pr618:nixosConfigurations.not522
Hydra nixosConfigurations.not522-installer Hydra build #22718 of nixos-config:pr618:nixosConfigurations.not522-installer
Hydra nixosConfigurations.container-default-x86_64-linux Hydra build #22716 of nixos-config:pr618:nixosConfigurations.container-default-x86_64-linux
This commit is contained in:
parent
e7de804a04
commit
b112633c98
1 changed files with 8 additions and 2 deletions
|
@ -25,9 +25,9 @@ with lib; {
|
|||
};
|
||||
};
|
||||
|
||||
config.nix.auto-update.enable = mkDefault true;
|
||||
config.nix.auto-update.enable = mkDefault config.nix.enable;
|
||||
config.nix.auto-update.reboot = mkDefault true;
|
||||
config.systemd.services.nixos-upgrade = {
|
||||
config.systemd.services.nixos-upgrade = mkIf config.nix.enable {
|
||||
description = "NixOS Upgrade";
|
||||
restartIfChanged = false;
|
||||
unitConfig.X-StopOnRemoval = false;
|
||||
|
@ -82,4 +82,10 @@ with lib; {
|
|||
RandomizedDelaySec = "1h";
|
||||
};
|
||||
};
|
||||
config.assertions = [
|
||||
{
|
||||
assertion = config.nix.auto-update.enable -> config.nix.enable;
|
||||
message = "Auto updating will only work when nix itself is enabled.";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue