From 1783a97ccb0756ee647b0822c30664008ca8573d Mon Sep 17 00:00:00 2001 From: clerie Date: Tue, 28 Feb 2023 19:32:24 +0100 Subject: [PATCH] hosts/dn42-ildix-service: init host --- flake.nix | 1 + hosts/dn42-ildix-service/configuration.nix | 41 +++++++++++++++++++ .../hardware-configuration.nix | 34 +++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 hosts/dn42-ildix-service/configuration.nix create mode 100644 hosts/dn42-ildix-service/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index a54adcc..7e423bc 100644 --- a/flake.nix +++ b/flake.nix @@ -66,6 +66,7 @@ schule = generateNixosSystem "schule"; storage-2 = generateNixosSystem "storage-2"; web-2 = generateNixosSystem "web-2"; + dn42-ildix-service = generateNixosSystem "dn42-ildix-service"; _iso = generateNixosSystem "_iso"; }; diff --git a/hosts/dn42-ildix-service/configuration.nix b/hosts/dn42-ildix-service/configuration.nix new file mode 100644 index 0000000..2003588 --- /dev/null +++ b/hosts/dn42-ildix-service/configuration.nix @@ -0,0 +1,41 @@ +{ config, pkgs, lib, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ../../configuration/proxmox-vm + ]; + + # Use the GRUB 2 boot loader. + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + # boot.loader.grub.efiSupport = true; + # boot.loader.grub.efiInstallAsRemovable = true; + # boot.loader.efi.efiSysMountPoint = "/boot/efi"; + # Define on which hard drive you want to install Grub. + boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only + + + networking.hostName = "dn42-ildix-service"; + + networking.useDHCP = false; + networking.interfaces.lo.ipv6.addresses = [ + { address = "fd81:edb3:71d8::1"; prefixLength = 128; } + { address = "fd81:edb3:71d8::53"; prefixLength = 128; } + ]; + # VM Nat Netz mercury + networking.interfaces.ens18.ipv4.addresses = [ { address = "192.168.10.28"; prefixLength = 24; } ]; + # ildix peering lan + networking.interfaces.ens19.ipv6.addresses = [ { address = "fd81:ed3:71d8:ffff:2953::1"; prefixLength = 64; } ]; + # IPv6 Uplink + networking.interfaces.ens20.ipv6.addresses = [ { address = "2001:638:904:ffc9::c"; prefixLength = 64; } ]; + + networking.defaultGateway6 = { address = "2001:638:904:ffc9::1"; interface = "ens20"; }; + networking.defaultGateway = { address = "192.168.10.1"; interface = "ens18"; }; + networking.nameservers = [ "2001:638:904:ffcc::3" "2001:638:904:ffcc::4" "141.24.40.3" "141.24.40.4" ]; + + + system.stateVersion = "23.05"; +} + diff --git a/hosts/dn42-ildix-service/hardware-configuration.nix b/hosts/dn42-ildix-service/hardware-configuration.nix new file mode 100644 index 0000000..6bbd2ae --- /dev/null +++ b/hosts/dn42-ildix-service/hardware-configuration.nix @@ -0,0 +1,34 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/5f2174f2-981a-468b-967e-1c1b6a32b8a3"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens18.useDHCP = lib.mkDefault true; + # networking.interfaces.ens19.useDHCP = lib.mkDefault true; + # networking.interfaces.ens20.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}