Add automatic maintenance

This commit is contained in:
Charlotte 🦝 Delenk 2022-01-14 14:03:14 +01:00
parent 7c9d40e588
commit e589c77a8d
Signed by: darkkirb
GPG key ID: 015E3768A70AFBC5
4 changed files with 37 additions and 7 deletions

View file

@ -2,13 +2,8 @@
imports = [ imports = [
./zfs.nix ./zfs.nix
./users/darkkirb.nix ./users/darkkirb.nix
./nix.nix
]; ];
nix = {
package = pkgs.nixUnstable; # or versioned attributes like nix_2_4
extraOptions = ''
experimental-features = nix-command flakes
'';
};
services.openssh.enable = true; services.openssh.enable = true;
environment.systemPackages = [ pkgs.git ]; environment.systemPackages = [ pkgs.git ];
networking.firewall.allowedTCPPorts = [ 22 ]; networking.firewall.allowedTCPPorts = [ 22 ];

21
config/nix.nix Normal file
View file

@ -0,0 +1,21 @@
{ ... }: {
nixpkgs.config.allowUnfree = true;
nix = {
package = pkgs.nixUnstable;
useSandbox = true;
autoOptimiseStore = true;
extraOptions = ''
experimental-features = nix-command flakes
'';
trustedUsers = [ "@wheel" ];
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
optimise = {
automatic = true;
dates = [ "weekly" ];
};
};
}

View file

@ -5,6 +5,7 @@
imports = [ imports = [
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
./grub.nix ./grub.nix
./server.nix
]; ];
boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "virtio_scsi" "xhci_pci" "sd_mod" "sr_mod" ]; boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "virtio_scsi" "xhci_pci" "sd_mod" "sr_mod" ];
@ -115,7 +116,7 @@
[Match] [Match]
Name = ens3 Name = ens3
[Network] [Network]
Address = 2a01:4f8:1c17:d953:1658:15a2:2755:360e/64 Address = 2a01:4f8:1c17:d953:b4e1:08ff:e658:6f49/64
Gateway = fe80::1 Gateway = fe80::1
''; '';
}; };

13
config/server.nix Normal file
View file

@ -0,0 +1,13 @@
# Configuration unique to servers
{ ... }: {
system.autoUpgrade = {
enable = true;
flake = "github:DarkKirb/nixos-config";
flags = [
"--recreate-lock-file"
"--no-write-lock-file"
"-L" # print build logs
];
dates = "daily";
};
}