From 9a1a29cf68f62cc3ef1774424d7565e9ab7a3d80 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Tue, 24 Feb 2026 19:00:21 +0100 Subject: versione di hardware per odino --- odino/nixos/boot.nix | 8 +++++++ odino/nixos/hardware-configuration.nix | 40 ++++++++++++++++++++++++++++++++++ odino/nixos/hardware.nix | 23 +++++++++++++++++++ odino/nixos/networking.nix | 3 ++- 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 odino/nixos/hardware-configuration.nix diff --git a/odino/nixos/boot.nix b/odino/nixos/boot.nix index 6b00a5a..52b2d3e 100644 --- a/odino/nixos/boot.nix +++ b/odino/nixos/boot.nix @@ -1,11 +1,19 @@ {pkgs, ...}: { boot = { kernelPackages = pkgs.linuxPackages_6_18; # NOTE: soltanto versioni LTS per il server + kernelModules = [ "kvm-intel" ]; kernelParams = [ "boot.shell_on_fail" ]; + initrd = { + availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + kernelModules = [ ]; + }; + loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; + + extraModulePackages = [ ]; }; } diff --git a/odino/nixos/hardware-configuration.nix b/odino/nixos/hardware-configuration.nix new file mode 100644 index 0000000..39fd4ba --- /dev/null +++ b/odino/nixos/hardware-configuration.nix @@ -0,0 +1,40 @@ +# 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" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/31eed536-5936-4814-bb60-73fcc4fabdc5"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/1DD7-85F5"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/8478cb29-8a67-4842-b9ed-16a226506cb7"; } + ]; + + # 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.eno1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/odino/nixos/hardware.nix b/odino/nixos/hardware.nix index e69de29..7049ed2 100644 --- a/odino/nixos/hardware.nix +++ b/odino/nixos/hardware.nix @@ -0,0 +1,23 @@ +{config, lib, pkgs, modulesPath, ...}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/31eed536-5936-4814-bb60-73fcc4fabdc5"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1DD7-85F5"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/8478cb29-8a67-4842-b9ed-16a226506cb7"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/odino/nixos/networking.nix b/odino/nixos/networking.nix index a69d4fb..ca9cf74 100644 --- a/odino/nixos/networking.nix +++ b/odino/nixos/networking.nix @@ -1,6 +1,7 @@ -{...}: { +{lib, ...}: { networking = { hostName = "odino"; + useDHCP = lib.mkDefault true; nameservers = [ "208.67.222.222" "208.67.220.220" ]; -- cgit v1.3