[ MIRROR ] NixOS & Home-Manager configuration git.ngill.net/dotfiles.git
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960{ pkgs, lib, config, ...}:{ }:{ systemd.timers.pull-updates = { description = "Run pull-updates service"; wantedBy = [ "timers.target" ]; timerConfig = { OnBootSec = "2m"; OnUnitActiveSec = "1d"; Unit = "pull-updates.service"; }; };
systemd.services.pull-updates = { description = "Pull NixOS and home-manager configuration"; restartIfChanged = false; onSuccess = [ "rebuild.service" ]; after = [ "network-online.target" ]; wants = [ "network-online.target" ]; path = with pkgs; [ git openssh ]; script = '' test "$(git branch --show-current)" = "master" git pull --ff-only ''; serviceConfig = { WorkingDirectory = "/etc/nixos"; User = "root"; Type = "oneshot"; }; };
systemd.services.rebuild = { description = "Rebuild NixOS and home-manager configuration"; restartIfChanged = false; path = with pkgs; [ nixos-rebuild systemd nix git ]; script = '' nixos-rebuild switch --flake /etc/nixos#${config.networking.hostName} nix-collect-garbage --delete-older-than 7d ''; serviceConfig = { WorkingDirectory = "/etc/nixos"; User = "root"; Type = "oneshot"; }; };}