Fix template configs

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

View File

@ -35,6 +35,7 @@
time.timeZone = "Europe/Oslo";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.tarball-ttl = 0;
environment.systemPackages = with pkgs; [
age
vim

View File

@ -1,7 +1,17 @@
{ config, lib, pkgs, modulesPath, ... }:
{
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "sr_mod" "xen_blkfront" ];
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
"sd_mod"
"sr_mod"
];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];

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'.";
}