From 710e9a7343321b7231af06ce485655780b5289d8 Mon Sep 17 00:00:00 2001 From: Polen Date: Thu, 5 Jun 2025 23:09:31 -0400 Subject: [PATCH] attmps number 34 --- devices/server/configuration.nix | 9 ++++---- devices/server/disk-config.nix | 10 -------- devices/server/hardware-configuration.nix | 28 +++++++++++++++++++++++ flake.nix | 1 + 4 files changed, 33 insertions(+), 15 deletions(-) create mode 100644 devices/server/hardware-configuration.nix diff --git a/devices/server/configuration.nix b/devices/server/configuration.nix index 5e41ae8..37650d0 100644 --- a/devices/server/configuration.nix +++ b/devices/server/configuration.nix @@ -5,21 +5,20 @@ }: { imports = [ # Include the results of the hardware scan. - ./hardware-configuration.nix ./disk-config.nix ]; boot.loader = { - systemd-boot = { + grub = { enable = true; - configurationLimit = 10; + version = 2; + device = "/dev/sda"; }; - efi.canTouchEfiVariables = true; }; services.openssh.enable = true; - boot.kernelModules = ["msr"]; + #boot.kernelModules = ["msr"]; networking.hostName = "server"; diff --git a/devices/server/disk-config.nix b/devices/server/disk-config.nix index 8f36ed4..aa6c8cc 100644 --- a/devices/server/disk-config.nix +++ b/devices/server/disk-config.nix @@ -11,16 +11,6 @@ size = "1M"; type = "EF02"; }; - esp = { - name = "ESP"; - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; root = { name = "root"; size = "100%"; diff --git a/devices/server/hardware-configuration.nix b/devices/server/hardware-configuration.nix new file mode 100644 index 0000000..c129ae1 --- /dev/null +++ b/devices/server/hardware-configuration.nix @@ -0,0 +1,28 @@ +# 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 = [ "uhci_hcd" "ehci_pci" "hpsa" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + # 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.enp3s0f0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp3s0f1.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0f0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0f1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/flake.nix b/flake.nix index 1c134be..f9fe91a 100644 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,7 @@ modules = [ disko.nixosModules.disko ./devices/server/configuration.nix + ./devices/server/hardware-configuration.nix ./modules ]; };