1
0
Fork 0
This commit is contained in:
Aires 2024-05-30 10:04:14 -04:00
parent 228f054371
commit a99103dcaa
2 changed files with 31 additions and 2 deletions

View file

@ -113,4 +113,32 @@ in
# Allow Haven to be a build target for other architectures (mainly ARM64) # Allow Haven to be a build target for other architectures (mainly ARM64)
boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
# Automatically update Flake configuration for other hosts to use
systemd.services."nixos-update-flake" = {
serviceConfig = {
Type = "oneshot";
User = config.users.users.aires.name;
};
script = ''
set -eu
cd ${config.users.users.aires.home}/Development/nix-configuration
git pull
nix flake update
git add flake.lock
git commit -m "Update flake.lock"
git push
'';
};
systemd.timers."nixos-update-flake-timer" = {
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Persistent = "true";
Unit = "nixos-update-flake.service";
};
};
} }

View file

@ -29,11 +29,12 @@
# Configure automatic updates # Configure automatic updates
system.autoUpgrade = { system.autoUpgrade = {
enable = true; enable = true;
flake = "${config.users.users.aires.home}/Development/nix-configuration"; flake = "git+https://${config.secrets.services.forgejo.url}/aires/nix-configuration";
dates = "daily"; dates = "daily";
randomizedDelaySec = "30m";
allowReboot = false; allowReboot = false;
operation = "switch"; operation = "switch";
flags = [ "--commit-lock-file" ]; persistent = true;
}; };
services = { services = {