diff --git a/git-push.sh b/git-push.sh new file mode 100755 index 0000000..620953c --- /dev/null +++ b/git-push.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cd /home/horseman/nix-config + +cp -r nixos machines/pc + +git add * +git commit * +git push diff --git a/machines/laptop/update-config.sh b/machines/laptop/update-config.sh new file mode 100644 index 0000000..d66c57b --- /dev/null +++ b/machines/laptop/update-config.sh @@ -0,0 +1,6 @@ +#!bin/bash + +cd /home/horseman/nix-config +git pull +sudo nixos-rebuild switch --flake .#laptop-koen +exit 0 diff --git a/machines/pc/configuration.nix b/machines/pc/configuration.nix index a8c048e..41e7b27 100644 --- a/machines/pc/configuration.nix +++ b/machines/pc/configuration.nix @@ -136,6 +136,23 @@ services.xserver.displayManager.gdm.enable = true; boot.loader.systemd-boot.enable = true; + systemd.timers."update-config" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnBootSec = "1m"; + Unit = "update-config.service"; + }; + }; + + systemd.services."update-config" = { + script = '' + ''; + serviceConfig = { + Type = "oneshot"; + User = "root"; + }; + }; + # TODO: Configure your system-wide user settings (groups, etc), add more users as needed. users.users = { diff --git a/machines/pc/update-config.sh b/machines/pc/update-config.sh new file mode 100644 index 0000000..6f231e7 --- /dev/null +++ b/machines/pc/update-config.sh @@ -0,0 +1,6 @@ +#!bin/bash + +cd /home/horseman/nix-config +git pull +sudo nixos-rebuild switch --flake .#pc-koen +exit 0 diff --git a/nixos/configuration.nix b/nixos/configuration.nix index a8c048e..41e7b27 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -136,6 +136,23 @@ services.xserver.displayManager.gdm.enable = true; boot.loader.systemd-boot.enable = true; + systemd.timers."update-config" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnBootSec = "1m"; + Unit = "update-config.service"; + }; + }; + + systemd.services."update-config" = { + script = '' + ''; + serviceConfig = { + Type = "oneshot"; + User = "root"; + }; + }; + # TODO: Configure your system-wide user settings (groups, etc), add more users as needed. users.users = {