2022-06-12 15:39:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
modulesPath,
|
2023-07-09 17:17:46 +00:00
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
system,
|
2022-06-12 15:39:15 +00:00
|
|
|
...
|
|
|
|
} @ args: {
|
2022-01-14 09:19:01 +00:00
|
|
|
networking.hostName = "nixos-8gb-fsn1-1";
|
|
|
|
networking.hostId = "73561e1f";
|
|
|
|
|
|
|
|
imports = [
|
|
|
|
(modulesPath + "/profiles/qemu-guest.nix")
|
|
|
|
./grub.nix
|
2022-01-14 13:03:14 +00:00
|
|
|
./server.nix
|
2022-01-14 19:56:02 +00:00
|
|
|
./services/named.nix
|
2022-01-14 20:06:22 +00:00
|
|
|
./services/grafana.nix
|
2022-01-15 20:12:12 +00:00
|
|
|
./users/miifox.nix
|
2022-12-16 07:26:04 +00:00
|
|
|
./services/postgres.nix
|
2022-01-17 09:49:37 +00:00
|
|
|
./services/gitea.nix
|
2022-01-17 14:54:37 +00:00
|
|
|
./services/old-homepage.nix
|
2022-01-20 09:05:03 +00:00
|
|
|
./services/postfixadmin.nix
|
2022-01-20 16:03:45 +00:00
|
|
|
./services/dovecot.nix
|
2022-01-22 17:26:11 +00:00
|
|
|
./services/postfix.nix
|
2022-03-06 10:44:08 +00:00
|
|
|
./services/loki.nix
|
2022-04-15 08:27:53 +00:00
|
|
|
./services/reverse-proxy.nix
|
2022-04-29 16:34:08 +00:00
|
|
|
./services/matrix-media-repo.nix
|
2022-05-08 14:21:00 +00:00
|
|
|
./bittorrent-blocker.nix
|
2022-09-09 17:59:43 +00:00
|
|
|
./services/akkoma
|
2022-11-27 09:43:23 +00:00
|
|
|
./services/peertube
|
2022-12-07 10:11:00 +00:00
|
|
|
./services/rspamd.nix
|
2022-12-14 09:40:28 +00:00
|
|
|
./wireguard/public-server.nix
|
2022-12-28 15:01:03 +00:00
|
|
|
./services/shitalloverme.nix
|
2023-04-24 18:58:09 +00:00
|
|
|
./services/wordpress.nix
|
2023-05-21 17:32:58 +00:00
|
|
|
./services/initrd-ssh.nix
|
2023-09-25 18:58:50 +00:00
|
|
|
./services/chir-rs.nix
|
2022-01-14 09:19:01 +00:00
|
|
|
];
|
|
|
|
|
2022-06-12 15:39:15 +00:00
|
|
|
boot.initrd.availableKernelModules = ["ata_piix" "virtio_pci" "virtio_scsi" "xhci_pci" "sd_mod" "sr_mod"];
|
|
|
|
boot.initrd.kernelModules = [];
|
|
|
|
boot.kernelModules = [];
|
|
|
|
boot.extraModulePackages = [];
|
|
|
|
boot.supportedFilesystems = ["zfs"];
|
2023-07-22 08:54:15 +00:00
|
|
|
boot.loader.grub.devices = ["/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_16151622"];
|
2022-01-14 09:39:06 +00:00
|
|
|
boot.loader.timeout = 5;
|
2022-01-14 09:50:02 +00:00
|
|
|
boot.initrd.luks.devices = {
|
|
|
|
disk0 = {
|
|
|
|
device = "/dev/disk/by-partuuid/29ccd4c9-5ef5-a146-8e42-9244f712baca";
|
|
|
|
};
|
|
|
|
};
|
2022-01-14 09:19:01 +00:00
|
|
|
|
2022-04-24 08:39:44 +00:00
|
|
|
fileSystems."/" = {
|
|
|
|
device = "tank/nixos";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-04-24 08:39:44 +00:00
|
|
|
};
|
2022-01-14 09:28:44 +00:00
|
|
|
|
2022-04-24 08:39:44 +00:00
|
|
|
fileSystems."/nix" = {
|
|
|
|
device = "tank/nixos/nix";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-04-24 08:39:44 +00:00
|
|
|
};
|
2022-01-14 09:19:01 +00:00
|
|
|
|
2022-04-24 08:39:44 +00:00
|
|
|
fileSystems."/etc" = {
|
|
|
|
device = "tank/nixos/etc";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-04-24 08:39:44 +00:00
|
|
|
};
|
2022-01-14 09:19:01 +00:00
|
|
|
|
2022-04-24 08:39:44 +00:00
|
|
|
fileSystems."/var" = {
|
|
|
|
device = "tank/nixos/var";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-04-24 08:39:44 +00:00
|
|
|
};
|
2022-01-14 09:19:01 +00:00
|
|
|
|
2022-04-24 08:39:44 +00:00
|
|
|
fileSystems."/var/lib" = {
|
|
|
|
device = "tank/nixos/var/lib";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-04-24 08:39:44 +00:00
|
|
|
};
|
2022-01-14 09:19:01 +00:00
|
|
|
|
2022-01-17 08:48:05 +00:00
|
|
|
fileSystems."/var/lib/minio" = {
|
|
|
|
device = "tank/nixos/var/lib/minio";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-01-17 08:48:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/var/lib/minio/disk0" = {
|
|
|
|
device = "tank/nixos/var/lib/minio/disk0";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-01-17 08:48:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/var/lib/minio/disk1" = {
|
|
|
|
device = "tank/nixos/var/lib/minio/disk1";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-01-17 08:48:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/var/lib/minio/disk2" = {
|
|
|
|
device = "tank/nixos/var/lib/minio/disk2";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-01-17 08:48:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/var/lib/minio/disk3" = {
|
|
|
|
device = "tank/nixos/var/lib/minio/disk3";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-01-17 08:48:05 +00:00
|
|
|
};
|
|
|
|
|
2022-04-24 08:39:44 +00:00
|
|
|
fileSystems."/var/log" = {
|
|
|
|
device = "tank/nixos/var/log";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-04-24 08:39:44 +00:00
|
|
|
};
|
2022-01-14 09:19:01 +00:00
|
|
|
|
2022-04-24 08:39:44 +00:00
|
|
|
fileSystems."/var/spool" = {
|
|
|
|
device = "tank/nixos/var/spool";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-04-24 08:39:44 +00:00
|
|
|
};
|
2022-01-14 09:19:01 +00:00
|
|
|
|
2022-04-24 08:39:44 +00:00
|
|
|
fileSystems."/home" = {
|
|
|
|
device = "tank/userdata/home";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-04-24 08:39:44 +00:00
|
|
|
};
|
2022-01-14 09:19:01 +00:00
|
|
|
|
2022-04-24 08:39:44 +00:00
|
|
|
fileSystems."/root" = {
|
|
|
|
device = "tank/userdata/home/root";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-04-24 08:39:44 +00:00
|
|
|
};
|
2022-01-14 09:19:01 +00:00
|
|
|
|
2022-04-24 08:39:44 +00:00
|
|
|
fileSystems."/home/darkkirb" = {
|
|
|
|
device = "tank/userdata/home/darkkirb";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-04-24 08:39:44 +00:00
|
|
|
};
|
2022-01-14 09:19:01 +00:00
|
|
|
|
2022-04-24 08:39:44 +00:00
|
|
|
fileSystems."/home/miifox" = {
|
|
|
|
device = "tank/userdata/home/miifox";
|
|
|
|
fsType = "zfs";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["zfsutil"];
|
2022-04-24 08:39:44 +00:00
|
|
|
};
|
2022-01-14 09:19:01 +00:00
|
|
|
|
2022-04-24 08:39:44 +00:00
|
|
|
fileSystems."/boot" = {
|
|
|
|
device = "/dev/disk/by-uuid/8E14-4366";
|
|
|
|
fsType = "vfat";
|
2022-06-12 15:39:15 +00:00
|
|
|
options = ["X-mount.mkdir"];
|
2022-04-24 08:39:44 +00:00
|
|
|
};
|
2022-01-14 09:19:01 +00:00
|
|
|
|
2022-06-12 15:39:15 +00:00
|
|
|
swapDevices = [];
|
2022-01-14 09:19:01 +00:00
|
|
|
|
|
|
|
system.stateVersion = "21.11";
|
2022-01-14 11:04:09 +00:00
|
|
|
|
2022-01-14 11:29:33 +00:00
|
|
|
systemd.network = {
|
|
|
|
enable = true;
|
2022-08-15 10:04:30 +00:00
|
|
|
networks."ens3".extraConfig = ''
|
2022-01-14 11:29:33 +00:00
|
|
|
[Match]
|
2022-01-14 11:32:10 +00:00
|
|
|
Name = ens3
|
2022-01-14 11:29:33 +00:00
|
|
|
[Network]
|
2022-01-14 13:03:14 +00:00
|
|
|
Address = 2a01:4f8:1c17:d953:b4e1:08ff:e658:6f49/64
|
2022-01-14 11:29:33 +00:00
|
|
|
Gateway = fe80::1
|
|
|
|
'';
|
2022-01-14 11:04:09 +00:00
|
|
|
};
|
2022-01-14 14:38:01 +00:00
|
|
|
|
2022-06-12 15:39:15 +00:00
|
|
|
networking.wireguard.interfaces."wg0".ips = ["fd0d:a262:1fa6:e621:b4e1:08ff:e658:6f49/64"];
|
|
|
|
home-manager.users.darkkirb = import ./home-manager/darkkirb.nix {
|
|
|
|
desktop = false;
|
|
|
|
inherit args;
|
|
|
|
};
|
2022-02-08 08:55:28 +00:00
|
|
|
nix.settings.cores = 2;
|
2022-04-20 11:44:59 +00:00
|
|
|
nix.settings.max-jobs = 2;
|
|
|
|
nix.daemonCPUSchedPolicy = "idle";
|
|
|
|
nix.daemonIOSchedClass = "idle";
|
2022-03-18 16:05:00 +00:00
|
|
|
|
2022-07-10 13:45:25 +00:00
|
|
|
nix.settings.system-features = [
|
2022-04-20 11:44:59 +00:00
|
|
|
"kvm"
|
|
|
|
"nixos-test"
|
|
|
|
"big-parallel"
|
|
|
|
"benchmark"
|
|
|
|
"gccarch-skylake"
|
|
|
|
"ca-derivations"
|
|
|
|
];
|
2022-05-21 17:10:26 +00:00
|
|
|
nix.settings.auto-optimise-store = true;
|
2022-11-06 09:51:36 +00:00
|
|
|
|
|
|
|
services.postgresql.settings = {
|
|
|
|
max_connections = 200;
|
2023-03-18 09:21:03 +00:00
|
|
|
shared_buffers = "1GB";
|
|
|
|
effective_cache_size = "3GB";
|
|
|
|
maintenance_work_mem = "256MB";
|
2022-11-06 09:51:36 +00:00
|
|
|
checkpoint_completion_target = 0.9;
|
|
|
|
wal_buffers = "16MB";
|
|
|
|
default_statistics_target = 100;
|
|
|
|
random_page_cost = 1.1;
|
|
|
|
effective_io_concurrency = 200;
|
2023-03-18 09:21:03 +00:00
|
|
|
work_mem = "52422kB";
|
2022-11-06 09:51:36 +00:00
|
|
|
min_wal_size = "1GB";
|
|
|
|
max_wal_size = "4GB";
|
|
|
|
max_worker_processes = 2;
|
|
|
|
max_parallel_workers_per_gather = 1;
|
|
|
|
max_parallel_workers = 2;
|
|
|
|
max_parallel_maintenance_workers = 1;
|
|
|
|
};
|
2022-12-15 16:07:28 +00:00
|
|
|
|
|
|
|
services.resolved.enable = false;
|
|
|
|
services.bind.forwarders = lib.mkForce [];
|
2023-02-01 20:01:01 +00:00
|
|
|
services.tailscale.useRoutingFeatures = "server";
|
2023-07-09 17:17:46 +00:00
|
|
|
systemd.services.nixos-upgrade.script = lib.mkForce ''
|
|
|
|
#!${pkgs.bash}/bin/bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2023-07-22 07:03:17 +00:00
|
|
|
builds=$(${pkgs.curl}/bin/curl -H 'accept: application/json' https://hydra.int.chir.rs/jobset/flakes/nixos-config/evals | ${pkgs.jq}/bin/jq -r '.evals[0].builds[]')
|
2023-07-09 17:17:46 +00:00
|
|
|
|
|
|
|
for build in $builds; do
|
|
|
|
doc=$(${pkgs.curl}/bin/curl -H 'accept: application/json' https://hydra.int.chir.rs/build/$build)
|
|
|
|
jobname=$(echo $doc | ${pkgs.jq}/bin/jq -r '.job')
|
|
|
|
if [ "$jobname" = "${config.networking.hostName}.${system}" ]; then
|
|
|
|
drvname=$(echo $doc | ${pkgs.jq}/bin/jq -r '.drvpath')
|
|
|
|
output=$(${pkgs.nix}/bin/nix-store -r $drvname)
|
|
|
|
$output/bin/switch-to-configuration switch
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
'';
|
2022-01-14 09:19:01 +00:00
|
|
|
}
|