Copy settings from nix auto-upgrade

This commit is contained in:
2025-12-07 20:26:55 -08:00
parent b2cfd98331
commit e797745a62

View File

@@ -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
];
};
}