summaryrefslogtreecommitdiff
path: root/config/auto-upgrade.nix
blob: bb82dc7471c59a3da9bb76653ffabf8300dafdd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ 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 https://git.orbekk.com/nixos-config.git
      '';
    };
    nixos-upgrade = {
      path = [ pkgs.bzip2.bin ];
    };
  };

  system.autoUpgrade = {
    enable = true;
  };
}