From a24fb237a94b1bf8a55b8cf3557908c4599d0f0e Mon Sep 17 00:00:00 2001 From: dadada Date: Fri, 25 Mar 2022 20:48:12 +0100 Subject: [PATCH] Add agares configuration --- nixos/agares/configuration.nix | 39 +++++++++++++++++++++++++ nixos/agares/hardware-configuration.nix | 33 +++++++++++++++++++++ nixos/configurations.nix | 9 ++++++ 3 files changed, 81 insertions(+) create mode 100644 nixos/agares/configuration.nix create mode 100644 nixos/agares/hardware-configuration.nix diff --git a/nixos/agares/configuration.nix b/nixos/agares/configuration.nix new file mode 100644 index 0000000..5db0ca4 --- /dev/null +++ b/nixos/agares/configuration.nix @@ -0,0 +1,39 @@ +{ config, pkgs, lib, ... }: +{ + imports = [ + ./hardware-configuration.nix + ]; + + dadada = { + admin.enable = true; + networking.localResolver.enable = true; + }; + + networking.hostName = "agares"; + networking.domain = "dadada.li"; + + # Use the GRUB 2 boot loader. + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + boot.loader.grub.device = "/dev/sda"; + + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + }; + + networking.firewall = { + enable = true; + allowPing = true; + allowedTCPPorts = [ + 22 # SSH + ]; + }; + + virtualisation.libvirtd.enable = true; + + environment.systemPackages = [ pkgs.curl ]; + + system.stateVersion = "22.05"; +} diff --git a/nixos/agares/hardware-configuration.nix b/nixos/agares/hardware-configuration.nix new file mode 100644 index 0000000..a113934 --- /dev/null +++ b/nixos/agares/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" "ehci_pci" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/sda1"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; + + swapDevices = [ ]; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = lib.mkDefault false; + networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; + networking.interfaces.enp2s0.useDHCP = lib.mkDefault true; + networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; + + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/configurations.nix b/nixos/configurations.nix index 8180186..71be4c7 100644 --- a/nixos/configurations.nix +++ b/nixos/configurations.nix @@ -61,4 +61,13 @@ in ./pruflas/configuration.nix ]; }; + + agares = nixosSystem rec { + system = "x86_64-linux"; + modules = (nixpkgs.lib.attrValues self.nixosModules) ++ [ + (adapterModule system) + ./modules/profiles/server.nix + ./agares/configuration.nix + ]; + }; }