summaryrefslogtreecommitdiff
path: root/config/auto-upgrade.nix
diff options
context:
space:
mode:
Diffstat (limited to 'config/auto-upgrade.nix')
-rw-r--r--config/auto-upgrade.nix23
1 files changed, 23 insertions, 0 deletions
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;
+ };
+}