From 5206cbac8dbea5cf432d9571b752c4e1ebe035b4 Mon Sep 17 00:00:00 2001 From: clerie Date: Tue, 4 Apr 2023 21:01:44 +0200 Subject: [PATCH] hosts/astatine: add host --- flake.nix | 1 + hosts/astatine/configuration.nix | 36 +++++++++++++++++++++++ hosts/astatine/hardware-configuration.nix | 33 +++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 hosts/astatine/configuration.nix create mode 100644 hosts/astatine/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index d3bffa8..8582f56 100644 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,7 @@ storage-2 = generateNixosSystem "storage-2"; web-2 = generateNixosSystem "web-2"; dn42-ildix-service = generateNixosSystem "dn42-ildix-service"; + astatine = generateNixosSystem "astatine"; _iso = generateNixosSystem "_iso"; }; diff --git a/hosts/astatine/configuration.nix b/hosts/astatine/configuration.nix new file mode 100644 index 0000000..48320a6 --- /dev/null +++ b/hosts/astatine/configuration.nix @@ -0,0 +1,36 @@ +{ config, pkgs, lib, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ]; + + boot.kernelParams = [ "console=ttyS0,115200n8" ]; + + # 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/sda"; # or "nodev" for efi only + boot.loader.grub.extraConfig = " + serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1 + terminal_input serial + terminal_output serial + "; + + + networking.hostName = "astatine"; + + clerie.monitoring = { + # enable = true; + id = "%MONITORING_ID%"; + pubkey = "%MONITORING_PUBKEY%"; + }; + + system.stateVersion = "23.05"; +} + diff --git a/hosts/astatine/hardware-configuration.nix b/hosts/astatine/hardware-configuration.nix new file mode 100644 index 0000000..b022305 --- /dev/null +++ b/hosts/astatine/hardware-configuration.nix @@ -0,0 +1,33 @@ +# 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 + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ohci_pci" "ehci_pci" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/ff68d582-80b9-4c3b-8b9a-bbe7089e882d"; + 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.enp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}