Fix template configs

This commit is contained in:
2024-03-13 22:35:52 +01:00
parent e38d6f44a5
commit 494b96ac5b
3 changed files with 17 additions and 6 deletions

View File

@@ -8,11 +8,14 @@ let
echo "Removing SSH host keys"
rm -f /etc/ssh/ssh_host_* || true
echo "Restarting SSH"
systemctl restart sshd
echo "Removing temporary files"
rm -rf /tmp/* || true
echo "Removing logs"
rm -rf /var/log/* || true
journalctl --vacuum-time=1s || true
echo "Removing cache"
rm -rf /var/cache/* || true
@@ -21,12 +24,9 @@ let
rm -rf /var/lib/sops-nix || true
mkdir -p /var/lib/sops-nix
${pkgs.age}/bin/age-keygen -o /var/lib/sops-nix/key.txt
echo "Runing garbage collector"
${pkgs.nix}/bin/nix-collect-garbage -d
'';
in
{
environment.systemPackages = [ prepare-host-script ];
users.motd = "Prepare host by running 'systemctl start prepare-host'.";
users.motd = "Prepare host by running 'prepare-host.sh'.";
}