From 68302c04165eaeea2a4188e60932d01bc7b9f351 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Mon, 12 Jun 2017 07:25:53 -0400 Subject: Add auto upgrade services. --- config/auto-upgrade.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 config/auto-upgrade.nix (limited to 'config/auto-upgrade.nix') diff --git a/config/auto-upgrade.nix b/config/auto-upgrade.nix new file mode 100644 index 0000000..a034a55 --- /dev/null +++ b/config/auto-upgrade.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: +{ + systemd.services = { + nixos-config-pull = { + description = "Pull nixos config from git."; + path = [ pkgs.git ]; + wantedBy = [ "nixos-upgrade.service" ]; + before = [ "nixos-upgrade.service" ]; + serviceConfig = { + Type = "oneshot"; + User = "orbekk"; + }; + script = '' + cd /opt/site/nixos-config + git pull + ''; + }; + }; + + system.autoUpgrade = { + enable = true; + }; +} -- cgit v1.2.3