AutoUpdate : Use system.autoUpgrade instead.
This commit is contained in:
parent
c8882354e2
commit
89b0c457b1
|
@ -1,24 +1,10 @@
|
|||
{ pkgs, inputs, lib, config, ... }: {
|
||||
systemd.services.autoupdate = {
|
||||
description = "Automatically rebuild the system.";
|
||||
# wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "dotfiles.service" ];
|
||||
after = [ "dotfiles.service" ];
|
||||
serviceConfig.Type = "oneshot";
|
||||
path = with pkgs; [
|
||||
git
|
||||
];
|
||||
script = ''
|
||||
${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot --flake "/root/.config/linux/system#$HOSTNAME"
|
||||
${config.nix.package.out}/bin/nix-collect-garbage --delete-older-than 7d
|
||||
'';
|
||||
};
|
||||
systemd.timers.autoupdate = {
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
Unit = "autoupdate.service";
|
||||
};
|
||||
wantedBy = [ "timers.target" ];
|
||||
system.autoUpgrade = {
|
||||
enable = true;
|
||||
allowReboot = false;
|
||||
dates = "daily";
|
||||
flake = "/root/.config/linux/system";
|
||||
operation = "boot";
|
||||
persistent = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,6 +5,12 @@
|
|||
keep-derivations = true
|
||||
keep-outputs = true
|
||||
'';
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "daily";
|
||||
options = "--delete-older-than 7d";
|
||||
persistent = true;
|
||||
};
|
||||
nix.settings.auto-optimise-store = true;
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
}
|
||||
|
|
Reference in a new issue