1
0
Fork 0

Get rid of extra flake update script

This commit is contained in:
Aires 2024-06-04 17:25:44 -04:00
parent bdefed51cf
commit e76ecf4abc

View file

@ -127,41 +127,4 @@ 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;
};
path = with pkgs; [
# Courtesy of https://discourse.nixos.org/t/how-to-use-other-packages-binary-in-systemd-service-configuration/14363
coreutils
gnutar
xz.bin
gzip
git
config.nix.package.out
openssh
];
script = ''
set -eu
cd ${config.secrets.nixConfigFolder}
git pull --recurse-submodules
nix flake update
git add flake.lock
git diff --quiet && git diff --staged --quiet || git commit -am "Update flake.lock" && git push # Courtesy of https://stackoverflow.com/a/40255467
'';
};
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";
};
};
} }