From b0f4f0d1616b89c0fc4739a8eb953d66629118b5 Mon Sep 17 00:00:00 2001 From: clerie Date: Mon, 18 Jul 2022 21:08:09 +0200 Subject: [PATCH] radius: add host --- flake.nix | 4 +++ hosts/radius/configuration.nix | 24 +++++++++++++++++ hosts/radius/hardware-configuration.nix | 36 +++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 hosts/radius/configuration.nix create mode 100644 hosts/radius/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 0585f28..6453c04 100644 --- a/flake.nix +++ b/flake.nix @@ -65,6 +65,10 @@ deployment.targetHost = "2001:470:7694::5e5"; }; + radius = { config, pkgs, ... }: { + deployment.targetHost = "radius.bula22.de"; + }; + router = { config, pkgs, ... }: { deployment.targetHost = "router.bula22.de"; }; diff --git a/hosts/radius/configuration.nix b/hosts/radius/configuration.nix new file mode 100644 index 0000000..5b4c451 --- /dev/null +++ b/hosts/radius/configuration.nix @@ -0,0 +1,24 @@ +{ config, pkgs, lib, ... }: +with lib; + +{ + imports = + [ + ./hardware-configuration.nix + ]; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "radius"; + networking.useDHCP = false; + networking.interfaces.ens18.ipv4.addresses = [ + {address = "10.42.10.5"; prefixLength = 24; } + ]; + networking.interfaces.ens18.ipv6.addresses = [ + {address = "2a01:4f8:1c0c:8221::5"; prefixLength = 64; } + ]; + networking.defaultGateway = { address = "10.42.10.1"; interface = "ens18"; }; + networking.defaultGateway6 = { address = "2a01:4f8:1c0c:8221::1"; interface = "ens18"; }; + + system.stateVersion = "22.05"; +} diff --git a/hosts/radius/hardware-configuration.nix b/hosts/radius/hardware-configuration.nix new file mode 100644 index 0000000..1c3306e --- /dev/null +++ b/hosts/radius/hardware-configuration.nix @@ -0,0 +1,36 @@ +# 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" "virtio_scsi" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/009361cd-3a0a-4736-98a9-acbef4d7aaa1"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/77DB-3A02"; + fsType = "vfat"; + }; + + 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; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}