add a script to update my hosts

This commit is contained in:
Andreas Zweili 2022-01-16 17:20:10 +01:00
parent d90f3b548c
commit 9ed81a8e4b
2 changed files with 30 additions and 0 deletions

View File

@ -88,6 +88,21 @@ in
HIGHLIGHT_STYLE = "solarized-light";
};
security.sudo = {
enable = true;
extraRules = [
{
users = [ "andreas" ];
commands = [
{
command = "${pkgs.nixos-rebuild} -j auto switch";
options = [ "SETENV" "NOPASSWD" ];
}
];
}
];
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave

15
scripts/update_all_systems.xsh Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env xonsh
hosts = [
"grav",
"heimdall",
"nixos-test-vm",
]
for host in hosts:
fqdn = "{}.2li.local".format(host)
print(fqdn)
print("-" * len(fqdn))
ssh @(fqdn) 'cd .nixos && git pull && sudo rebuild'
print("")
print("")