2022-10-05 19:21:46 +02:00
|
|
|
{ self, ... } @ inputs:
|
2023-04-09 22:01:32 +02:00
|
|
|
{ modulesPath, lib, ... }:
|
|
|
|
# let
|
|
|
|
# pkgs = self.inputs.nixpkgs.legacyPackages.x86_64-linux;
|
|
|
|
# in
|
2022-10-05 19:21:46 +02:00
|
|
|
{
|
2022-09-07 22:59:08 +02:00
|
|
|
imports = [
|
2023-04-09 22:01:32 +02:00
|
|
|
"${modulesPath}/profiles/qemu-guest.nix"
|
2023-01-17 23:55:24 +01:00
|
|
|
|
2022-09-07 22:59:08 +02:00
|
|
|
../../users/root
|
|
|
|
../../users/erwin
|
|
|
|
];
|
|
|
|
|
|
|
|
eboskma = {
|
2023-04-09 22:01:32 +02:00
|
|
|
users.erwin = {
|
|
|
|
enable = true;
|
|
|
|
server = true;
|
|
|
|
};
|
|
|
|
headscale = {
|
|
|
|
enable = true;
|
|
|
|
baseDomain = "asgard.datarift.nl";
|
|
|
|
serverUrl = "https://heimdall.datarift.nl";
|
|
|
|
};
|
2023-06-01 16:59:19 +02:00
|
|
|
keycloak.enable = true;
|
2022-09-07 22:59:08 +02:00
|
|
|
nix-common = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2022-10-05 19:21:46 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
2023-04-09 22:01:32 +02:00
|
|
|
hostName = "heimdall";
|
|
|
|
domain = "datarift.nl";
|
|
|
|
|
|
|
|
nameservers = [ "8.8.8.8" ];
|
|
|
|
defaultGateway = "172.31.1.1";
|
|
|
|
defaultGateway6 = {
|
|
|
|
address = "fe80::1";
|
|
|
|
interface = "eth0";
|
2022-10-05 19:21:46 +02:00
|
|
|
};
|
2023-04-09 22:01:32 +02:00
|
|
|
dhcpcd.enable = false;
|
|
|
|
usePredictableInterfaceNames = lib.mkForce false;
|
2022-10-05 19:21:46 +02:00
|
|
|
interfaces = {
|
2023-04-09 22:01:32 +02:00
|
|
|
eth0 = {
|
|
|
|
ipv4.addresses = [
|
|
|
|
{ address = "159.69.211.175"; prefixLength = 32; }
|
2022-10-05 19:21:46 +02:00
|
|
|
];
|
2023-04-09 22:01:32 +02:00
|
|
|
ipv6.addresses = [
|
|
|
|
{ address = "2a01:4f8:1c1e:5fb2::1"; prefixLength = 64; }
|
|
|
|
{ address = "fe80::9400:2ff:fe12:a2eb"; prefixLength = 64; }
|
2022-10-05 19:21:46 +02:00
|
|
|
];
|
2023-04-09 22:01:32 +02:00
|
|
|
ipv4.routes = [{ address = "172.31.1.1"; prefixLength = 32; }];
|
|
|
|
ipv6.routes = [{ address = "fe80::1"; prefixLength = 128; }];
|
2022-09-07 22:59:08 +02:00
|
|
|
};
|
2023-04-09 22:01:32 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
services.udev.extraRules = ''
|
|
|
|
ATTR{address}=="96:00:02:12:a2:eb", NAME="eth0"
|
|
|
|
'';
|
|
|
|
|
|
|
|
### Hetzner stuff
|
|
|
|
boot = {
|
2023-05-05 19:47:12 +02:00
|
|
|
tmp.cleanOnBoot = true;
|
2023-04-09 22:01:32 +02:00
|
|
|
loader.grub.device = "/dev/sda";
|
|
|
|
initrd = {
|
|
|
|
availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
|
|
|
kernelModules = [ "nvme" ];
|
2022-09-07 22:59:08 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-04-09 22:01:32 +02:00
|
|
|
fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; };
|
|
|
|
|
|
|
|
zramSwap.enable = true;
|
|
|
|
### END Hetzner stuff
|
2022-09-07 22:59:08 +02:00
|
|
|
|
|
|
|
time.timeZone = "Europe/Amsterdam";
|
|
|
|
|
|
|
|
system.configurationRevision = self.inputs.nixpkgs.lib.mkIf (self ? rev) self.rev;
|
|
|
|
|
2023-04-10 23:27:31 +02:00
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
PasswordAuthentication = false;
|
|
|
|
};
|
|
|
|
};
|
2023-04-09 23:19:20 +02:00
|
|
|
services.tailscale.enable = true;
|
2022-09-07 22:59:08 +02:00
|
|
|
|
2023-04-10 23:27:31 +02:00
|
|
|
security.apparmor = {
|
|
|
|
enable = true;
|
|
|
|
killUnconfinedConfinables = true;
|
|
|
|
};
|
|
|
|
security.protectKernelImage = true;
|
|
|
|
|
2023-06-01 16:59:19 +02:00
|
|
|
sops.defaultSopsFile = ./secrets.yaml;
|
|
|
|
sops.secrets = {
|
|
|
|
keycloak-db-password = { };
|
|
|
|
};
|
2022-09-07 22:59:08 +02:00
|
|
|
|
2023-04-09 22:01:32 +02:00
|
|
|
system.stateVersion = "23.05";
|
2022-09-07 22:59:08 +02:00
|
|
|
}
|