flock/hosts/ornithologist/default.nix
2025-09-18 13:17:06 +08:00

37 lines
863 B
Nix

{pkgs, ...}: {
# Install some packages.
environment.systemPackages = with pkgs; [deploy-rs];
# Allow emulating aarch64 to build for Raspberry Pi.
boot.binfmt.emulatedSystems = ["aarch64-linux"];
# Enable docker.
flock.docker.enable = true;
# Deploy NixOS updates once a week.
systemd.timers."deploy-rs" = {
wantedBy = ["timers.target"];
timerConfig = {
OnCalendar = "weekly";
Persistent = true;
Unit = "deploy-rs.service";
};
};
systemd.services."deploy-rs" = {
path = with pkgs; [openssh git nix deploy-rs];
script = ''
set -eu
cd /home/fern/Repositories/flock
git pull && nix flake update
deploy && git commit -m "[ornithologist] Update flake.lock" && git push
'';
serviceConfig = {
Type = "oneshot";
User = "fern";
Group = "users";
};
};
}