diff --git a/modules/system/git-auto-rebuild.nix b/modules/system/git-auto-rebuild.nix index f5c34b8..cc627dc 100644 --- a/modules/system/git-auto-rebuild.nix +++ b/modules/system/git-auto-rebuild.nix @@ -5,9 +5,27 @@ after = [ "network.target" ]; description = "Rebuilds the git repo at /etc/nixos if there are changes in the currently checked out branch"; # startAt = "*:0/1"; + serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.bash}/bin/bash -c 'cd /etc/nixos && ${pkgs.git}/bin/git pull && ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake #$(hostname)'"; + Type = "oneshot"; + ExecStart = "${pkgs.bash}/bin/bash -c 'cd /etc/nixos && ${pkgs.git}/bin/git pull && ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake \#$(hostname)'"; }; + environment = + config.nix.envVars + // { + inherit (config.environment.sessionVariables) NIX_PATH; + HOME = "/root"; + } + // config.networking.proxy.envVars; + path = with pkgs; [ + coreutils + gnutar + xz.bin + gzip + gitMinimal + config.nix.package.out + config.programs.ssh.package + ]; }; + }