2022-12-13 20:20:34 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
modulesPath,
|
|
|
|
...
|
|
|
|
} @ args: {
|
|
|
|
networking.hostName = "instance-20221213-1915";
|
|
|
|
networking.hostId = "746d4523";
|
|
|
|
|
|
|
|
imports = [
|
|
|
|
(modulesPath + "/profiles/qemu-guest.nix")
|
|
|
|
./systemd-boot.nix
|
|
|
|
./server.nix
|
2022-12-14 09:40:28 +00:00
|
|
|
./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-13 19:20:47 +00:00
|
|
|
./services/chir.rs
|
2023-01-14 13:57:00 +00:00
|
|
|
./users/remote-build.nix
|
2023-01-15 11:12:01 +00:00
|
|
|
./services/atticd.nix
|
2023-04-17 15:43:39 +00:00
|
|
|
./services/minecraft.nix
|
2023-04-18 08:15:35 +00:00
|
|
|
./services/postgres.nix
|
2023-04-18 08:02:07 +00:00
|
|
|
./services/nextcloud.nix
|
2022-12-13 20:20:34 +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";
|
2022-12-14 15:12:49 +00:00
|
|
|
neededForBoot = true;
|
2022-12-13 20:20:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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-02-01 20:01:01 +00:00
|
|
|
"D /build - - - - -"
|
2023-04-18 07:55:45 +00:00
|
|
|
"L /var/lib/postgresql - - - - /persist/var/lib/postgresql"
|
2022-12-13 20:20:34 +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"
|
|
|
|
"gccarch-skylake"
|
|
|
|
"ca-derivations"
|
|
|
|
];
|
2022-12-13 20:20:34 +00:00
|
|
|
nix.daemonCPUSchedPolicy = "idle";
|
|
|
|
nix.daemonIOSchedClass = "idle";
|
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";
|
|
|
|
};
|
2022-12-14 15:12:49 +00:00
|
|
|
sops.secrets."services/ssh/host-key" = {
|
|
|
|
owner = "root";
|
|
|
|
path = "/etc/secrets/initrd/ssh_host_ed25519_key";
|
|
|
|
};
|
2022-12-14 17:02:17 +00:00
|
|
|
sops.age.sshKeyPaths = lib.mkForce ["/persist/ssh/ssh_host_ed25519_key"];
|
2022-12-15 16:07:28 +00:00
|
|
|
services.bind.forwarders = lib.mkForce [];
|
2022-12-29 10:24:35 +00:00
|
|
|
boot.loader.systemd-boot.configurationLimit = lib.mkForce 1;
|
2023-01-17 10:02:41 +00:00
|
|
|
system.autoUpgrade.allowReboot = true;
|
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;
|
|
|
|
};
|
2022-12-13 20:20:34 +00:00
|
|
|
}
|