mirror of
https://github.com/caperren/nixos-configs.git
synced 2025-12-30 19:14:19 +00:00
Copy settings from nix auto-upgrade
This commit is contained in:
@@ -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
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user