nixos-config/config/instance-20221213-1915.nix

155 lines
3.8 KiB
Nix
Raw Normal View History

{
config,
lib,
modulesPath,
...
2024-11-10 09:53:17 +00:00
}@args:
{
networking.hostName = "instance-20221213-1915";
networking.hostId = "746d4523";
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
./systemd-boot.nix
./server.nix
./wireguard/public-server.nix
2022-12-14 17:02:17 +00:00
./services/named-submissive.nix
2022-12-28 15:01:03 +00:00
./services/shitalloverme.nix
2023-01-14 13:57:00 +00:00
./users/remote-build.nix
./services/atticd.nix
2024-11-10 09:53:17 +00:00
#./services/minecraft.nix
2023-04-18 08:15:35 +00:00
./services/postgres.nix
2023-08-02 12:09:28 +00:00
./services/uptime-kuma.nix
2024-03-23 13:01:46 +00:00
./services/reverse-proxy.nix
./wireguard
2023-12-10 09:36:28 +00:00
./zfs.nix
2024-06-01 08:21:59 +00:00
#./services/kubernetes.nix
2024-09-29 06:16:06 +00:00
./services/gitea.nix
2024-10-04 08:14:05 +00:00
./services/chir-rs.nix
];
2024-11-10 09:53:17 +00:00
boot.initrd.availableKernelModules = [
"xhci_pci"
"virtio_pci"
"usbhid"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "tank/local/root";
fsType = "zfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/6557-C4A0";
fsType = "vfat";
};
fileSystems."/nix" = {
device = "tank/local/nix";
fsType = "zfs";
};
fileSystems."/persist" = {
device = "tank/safe/persist";
fsType = "zfs";
neededForBoot = true;
};
fileSystems."/home" = {
device = "tank/safe/home";
fsType = "zfs";
};
networking.useDHCP = lib.mkDefault true;
# https://grahamc.com/blog/erase-your-darlings
boot.initrd.postDeviceCommands = lib.mkAfter ''
zfs rollback -r tank/local/root@blank
'';
services.openssh = {
hostKeys = [
{
path = "/persist/ssh/ssh_host_ed25519_key";
type = "ed25519";
}
{
path = "/persist/ssh/ssh_host_rsa_key";
type = "rsa";
bits = 4096;
}
];
};
systemd.tmpfiles.rules = [
"L /var/lib/acme - - - - /persist/var/lib/acme"
2023-02-02 15:37:45 +00:00
"L /var/lib/tailscale/tailscaled.state - - - - /persist/var/lib/tailscale/tailscaled.state"
2023-04-18 12:17:01 +00:00
"d /build - - - - -"
2023-05-23 05:54:19 +00:00
"L /var/lib/ipfs - - - - /persist/var/lib/ipfs"
2023-08-02 17:26:18 +00:00
"L /var/lib/uptime-kuma - - - - /persist/var/lib/uptime-kuma"
];
2023-04-18 12:08:58 +00:00
services.postgresql.dataDir = "/persist/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}";
2024-11-10 09:53:17 +00:00
networking.wireguard.interfaces."wg0".ips = [ "fd0d:a262:1fa6:e621:746d:4523:5c04:1453/64" ];
home-manager.users.darkkirb = import ./home-manager/darkkirb.nix {
desktop = false;
inherit args;
};
2023-04-17 15:33:25 +00:00
nix.settings.cores = 4;
nix.settings.max-jobs = 4;
2023-01-27 12:11:12 +00:00
nix.settings.system-features = [
"nixos-test"
"big-parallel"
"benchmark"
"gccarch-armv8-a"
"gccarch-armv8.1-a"
"gccarch-armv8.2-a"
"ca-derivations"
];
nix.daemonCPUSchedPolicy = "idle";
nix.daemonIOSchedClass = "idle";
2023-10-19 08:02:43 +00:00
boot.binfmt.emulatedSystems = [
"riscv32-linux"
"riscv64-linux"
];
2022-12-14 09:31:37 +00:00
system.stateVersion = "22.11";
2022-12-14 09:51:02 +00:00
sops.secrets."root/.ssh/id_ed25519" = {
owner = "root";
path = "/root/.ssh/id_ed25519";
};
sops.secrets."services/ssh/host-key" = {
owner = "root";
path = "/etc/secrets/initrd/ssh_host_ed25519_key";
};
2024-11-10 09:53:17 +00:00
sops.age.sshKeyPaths = lib.mkForce [ "/persist/ssh/ssh_host_ed25519_key" ];
services.bind.forwarders = lib.mkForce [ ];
2022-12-29 10:24:35 +00:00
boot.loader.systemd-boot.configurationLimit = lib.mkForce 1;
2023-02-01 20:01:01 +00:00
services.tailscale.useRoutingFeatures = "server";
2023-04-18 07:55:45 +00:00
services.postgresql.settings = {
max_connections = 200;
shared_buffers = "6GB";
effective_cache_size = "18GB";
maintenance_work_mem = "1536MB";
checkpoint_completion_target = 0.9;
wal_buffers = "16MB";
default_statistics_target = 100;
random_page_cost = 1.1;
effective_io_concurrency = 200;
work_mem = "15728kB";
min_wal_size = "1GB";
max_wal_size = "4GB";
max_worker_processes = 4;
max_parallel_workers_per_gather = 2;
max_parallel_workers = 4;
max_parallel_maintenance_workers = 2;
};
2023-04-18 15:19:55 +00:00
2024-11-10 09:53:17 +00:00
services.restic.backups.sysbackup.paths = [ "/persist" ];
}