Add automatic maintenance
This commit is contained in:
parent
7c9d40e588
commit
e589c77a8d
4 changed files with 37 additions and 7 deletions
|
@ -2,13 +2,8 @@
|
|||
imports = [
|
||||
./zfs.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;
|
||||
environment.systemPackages = [ pkgs.git ];
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
|
|
21
config/nix.nix
Normal file
21
config/nix.nix
Normal 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" ];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -5,6 +5,7 @@
|
|||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
./grub.nix
|
||||
./server.nix
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "virtio_scsi" "xhci_pci" "sd_mod" "sr_mod" ];
|
||||
|
@ -115,7 +116,7 @@
|
|||
[Match]
|
||||
Name = ens3
|
||||
[Network]
|
||||
Address = 2a01:4f8:1c17:d953:1658:15a2:2755:360e/64
|
||||
Address = 2a01:4f8:1c17:d953:b4e1:08ff:e658:6f49/64
|
||||
Gateway = fe80::1
|
||||
'';
|
||||
};
|
||||
|
|
13
config/server.nix
Normal file
13
config/server.nix
Normal 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";
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue