From 5243670d89a787b454b971a787c7a040150f9a1e Mon Sep 17 00:00:00 2001 From: xeovalyte Date: Wed, 25 Dec 2024 10:57:48 +0100 Subject: [PATCH] Updated surface configuration --- flake.nix | 4 ++- hosts/surface/default.nix | 4 +-- hosts/surface/hardware-configuration.nix | 40 ++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 hosts/surface/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index d60d1da..c2c4d95 100644 --- a/flake.nix +++ b/flake.nix @@ -69,7 +69,9 @@ modules = [ ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - inputs.nixos-hardware.nixosModules.surface-go + inputs.nixos-hardware.nixosModules.microsoft-surface-go + nixos-cosmic.nixosModules.default + ./hosts/surface ]; }; diff --git a/hosts/surface/default.nix b/hosts/surface/default.nix index 37d6f32..f0ee371 100644 --- a/hosts/surface/default.nix +++ b/hosts/surface/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ lib, pkgs, ... }: { imports = [ @@ -73,7 +73,7 @@ enable = true; }; - boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelPackages = lib.mkForce pkgs.linuxPackages_latest; system.stateVersion = "24.05"; diff --git a/hosts/surface/hardware-configuration.nix b/hosts/surface/hardware-configuration.nix new file mode 100644 index 0000000..620649d --- /dev/null +++ b/hosts/surface/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" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/09e81450-2741-4218-a2e5-780515cd90b9"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/FC00-C9A3"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/30618725-d8ff-40c9-b218-6b1f7aaf9155"; } + ]; + + # 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.wlp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}