From 01f3c697d3ab0179ec8a8ebbcd0c084852376cb4 Mon Sep 17 00:00:00 2001 From: Lyes Saadi Date: Sat, 4 May 2024 22:20:24 +0200 Subject: [PATCH] Adding the rest of the hardware files --- flake.nix | 3 +- .../configuration.nix} | 6 ++- hardware/lyes-pc/hardware-configuration.nix | 54 +++++++++++++++++++ 3 files changed, 60 insertions(+), 3 deletions(-) rename hardware/{lyes-pc.nix => lyes-pc/configuration.nix} (98%) create mode 100644 hardware/lyes-pc/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index a9e46af..4b60f8d 100644 --- a/flake.nix +++ b/flake.nix @@ -16,9 +16,8 @@ modules = [ ./configuration/configuration.nix nix-flatpak.nixosModules.nix-flatpak - ./hardware/lyes-pc.nix + ./hardware/lyes-pc/configuration.nix nixos-hardware.nixosModules.lenovo-thinkpad-x1-extreme-gen4 - /etc/nixos/hardware-configuration.nix ]; }; }; diff --git a/hardware/lyes-pc.nix b/hardware/lyes-pc/configuration.nix similarity index 98% rename from hardware/lyes-pc.nix rename to hardware/lyes-pc/configuration.nix index 11aaa5f..6ef01c4 100644 --- a/hardware/lyes-pc.nix +++ b/hardware/lyes-pc/configuration.nix @@ -1,6 +1,10 @@ -{ config, pkgs, ... }: +{ ... }: { + imports = [ + ./hardware-configuration.nix + ]; + # Optimisation # nixpkgs.hostPlatform = { diff --git a/hardware/lyes-pc/hardware-configuration.nix b/hardware/lyes-pc/hardware-configuration.nix new file mode 100644 index 0000000..834f6e3 --- /dev/null +++ b/hardware/lyes-pc/hardware-configuration.nix @@ -0,0 +1,54 @@ +# 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" "thunderbolt" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/2a1aab81-a8df-4781-8946-f00ac1d48db7"; + fsType = "btrfs"; + options = [ "subvol=nixos_root" ]; + }; + + boot.initrd.luks.devices."luks-8d74423e-0529-46e3-87b9-b948c568a6c3".device = "/dev/disk/by-uuid/8d74423e-0529-46e3-87b9-b948c568a6c3"; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/2a1aab81-a8df-4781-8946-f00ac1d48db7"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/2a1aab81-a8df-4781-8946-f00ac1d48db7"; + fsType = "btrfs"; + options = [ "subvol=nixos_nix" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/94CB-9035"; + fsType = "vfat"; + }; + + 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.wlp9s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + # high-resolution display +}