nixos-config/config/nixos-8gb-fsn1-1.nix

228 lines
5.7 KiB
Nix
Raw Normal View History

2022-03-05 20:06:59 +00:00
{ config, pkgs, lib, modulesPath, ... } @ 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-01-15 20:41:55 +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
./services/chir-rs.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-02-19 14:34:26 +00:00
./services/minecraft.nix
2022-03-02 20:09:30 +00:00
./services/minio.nix
./services/loki.nix
2022-04-15 08:27:53 +00:00
./services/reverse-proxy.nix
2022-01-14 09:19:01 +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" ];
2022-01-14 09:39:06 +00:00
boot.loader.grub.devices = [ "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0" ];
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";
options = [ "zfsutil" ];
};
2022-01-14 09:28:44 +00:00
2022-04-24 08:39:44 +00:00
fileSystems."/nix" = {
device = "tank/nixos/nix";
fsType = "zfs";
options = [ "zfsutil" ];
};
2022-01-14 09:19:01 +00:00
2022-04-24 08:39:44 +00:00
fileSystems."/etc" = {
device = "tank/nixos/etc";
fsType = "zfs";
options = [ "zfsutil" ];
};
2022-01-14 09:19:01 +00:00
2022-04-24 08:39:44 +00:00
fileSystems."/var" = {
device = "tank/nixos/var";
fsType = "zfs";
options = [ "zfsutil" ];
};
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";
options = [ "zfsutil" ];
};
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";
options = [ "zfsutil" ];
};
fileSystems."/var/lib/minio/disk0" = {
device = "tank/nixos/var/lib/minio/disk0";
fsType = "zfs";
options = [ "zfsutil" ];
};
fileSystems."/var/lib/minio/disk1" = {
device = "tank/nixos/var/lib/minio/disk1";
fsType = "zfs";
options = [ "zfsutil" ];
};
fileSystems."/var/lib/minio/disk2" = {
device = "tank/nixos/var/lib/minio/disk2";
fsType = "zfs";
options = [ "zfsutil" ];
};
fileSystems."/var/lib/minio/disk3" = {
device = "tank/nixos/var/lib/minio/disk3";
fsType = "zfs";
options = [ "zfsutil" ];
};
2022-04-24 08:39:44 +00:00
fileSystems."/var/log" = {
device = "tank/nixos/var/log";
fsType = "zfs";
options = [ "zfsutil" ];
};
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";
options = [ "zfsutil" ];
};
2022-01-14 09:19:01 +00:00
2022-04-24 08:39:44 +00:00
fileSystems."/home" = {
device = "tank/userdata/home";
fsType = "zfs";
options = [ "zfsutil" ];
};
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";
options = [ "zfsutil" ];
};
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";
options = [ "zfsutil" ];
};
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";
options = [ "zfsutil" ];
};
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";
options = [ "X-mount.mkdir" ];
};
2022-01-14 09:19:01 +00:00
swapDevices = [ ];
system.stateVersion = "21.11";
2022-01-14 11:04:09 +00:00
2022-01-14 11:29:33 +00:00
systemd.network = {
enable = true;
networks."enp0s3".extraConfig = ''
[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
networking.wireguard.interfaces."wg0".ips = [ "fd0d:a262:1fa6:e621:b4e1:08ff:e658:6f49/64" ];
2022-03-05 20:06:59 +00:00
home-manager.users.darkkirb = import ./home-manager/darkkirb.nix { desktop = false; inherit args; };
nix.settings.cores = 2;
nix.settings.max-jobs = 2;
nix.daemonCPUSchedPolicy = "idle";
nix.daemonIOSchedClass = "idle";
2022-03-18 16:05:00 +00:00
networking.wireguard.interfaces.wg0 = {
postSetup = ''
${pkgs.iptables}/bin/iptables -A FORWARD -i wg0 -j ACCEPT
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -o ens3 -j MASQUERADE
${pkgs.iptables}/bin/ip6tables -A FORWARD -i wg0 -j ACCEPT
${pkgs.iptables}/bin/ip6tables -t nat -A POSTROUTING -s fc00::/7 -o ens3 -j MASQUERADE
'';
postShutdown = ''
${pkgs.iptables}/bin/iptables -D FORWARD -i wg0 -j ACCEPT
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.0.0.0/8 -o ens3 -j MASQUERADE
${pkgs.iptables}/bin/ip6tables -D FORWARD -i wg0 -j ACCEPT
${pkgs.iptables}/bin/ip6tables -t nat -D POSTROUTING -s fc00::/7 -o ens3 -j MASQUERADE
'';
peers = [
{
publicKey = "4nwQdXTrcTPKNNtyzoWpsIXg1+QfVchCYtwIFR9RCnc=";
allowedIPs = [
"fd0d:a262:1fa6:e621:966f:16df:af3f:f063/128"
"10.0.0.1/32"
];
}
2022-04-07 13:37:41 +00:00
{
publicKey = "YDh67pqmhWMPNWf1BYXeH4/GTScCWqoWuyIao3ZUcz4=";
allowedIPs = [
"fd0d:a262:1fa6:e621:480:b859:2a43:7101/128"
"10.0.0.2/32"
];
}
2022-04-07 13:30:09 +00:00
# nutty-noon
{
publicKey = "YYQmSJwipRkZJUsPV5DxhfyRBMdj/O1XzN+cGYtUi1s=";
allowedIPs = [
"fd0d:a262:1fa6:e621:47e6:24d4:2acb:9437/128"
];
}
# thinkrac
{
publicKey = "iKW9nomLyLY2f90UY66POzY8CfDhQrqOLqchERlR3TY=";
allowedIPs = [
"fd0d:a262:1fa6:e621:f45a:db9f:eb7c:1a3f/128"
];
}
2022-04-24 08:39:44 +00:00
# nas
2022-04-07 13:30:09 +00:00
{
2022-04-24 08:39:44 +00:00
publicKey = "RuQImASPojufJMoJ+zZ4FceC+mMN5vhxNR+i+m7g9Bc=";
2022-04-07 13:30:09 +00:00
allowedIPs = [
2022-04-24 08:39:44 +00:00
"fd0d:a262:1fa6:e621:bc9b:6a33:86e4:873b/128"
2022-04-07 13:30:09 +00:00
];
}
2022-03-18 16:05:00 +00:00
];
};
boot.kernel.sysctl = {
"net.ipv4.conf.all.forwarding" = true;
"net.ipv6.conf.all.forwarding" = true;
};
nix.systemFeatures = [
"kvm"
"nixos-test"
"big-parallel"
"benchmark"
"gccarch-skylake"
"ca-derivations"
];
2022-01-14 09:19:01 +00:00
}