diff --git a/flake.lock b/flake.lock index 72ecb448..b5b0b7fd 100644 --- a/flake.lock +++ b/flake.lock @@ -472,6 +472,26 @@ "type": "github" } }, + "nixhw": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1720299715, + "narHash": "sha256-VezUOQZnluy6lahyxOo2W55kGsyh7AhfiF1/NAwdYgM=", + "owner": "alyraffauf", + "repo": "nixhw", + "rev": "03c553f3acd2339f034dc67e8d37505b2e32925e", + "type": "github" + }, + "original": { + "owner": "alyraffauf", + "repo": "nixhw", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1719075281, @@ -590,6 +610,7 @@ "home-manager": "home-manager_2", "hyprland": "hyprland", "iio-hyprland": "iio-hyprland", + "nixhw": "nixhw", "nixpkgs": "nixpkgs_2", "nixpkgsUnstable": "nixpkgsUnstable", "nixvim": "nixvim", diff --git a/flake.nix b/flake.nix index 2d50f8df..3832cd4a 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,7 @@ home-manager.url = "github:nix-community/home-manager/release-24.05"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; iio-hyprland.url = "github:JeanSchoeller/iio-hyprland"; + nixhw.url = "github:alyraffauf/nixhw"; nixvim.url = "github:nix-community/nixvim/nixos-24.05"; nur.url = github:nix-community/NUR; raffauflabs.url = "github:alyraffauf/raffauflabs"; @@ -19,6 +20,7 @@ disko.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; iio-hyprland.inputs.nixpkgs.follows = "nixpkgs"; + nixhw.inputs.nixpkgs.follows = "nixpkgs"; nixvim.inputs.nixpkgs.follows = "nixpkgs"; raffauflabs.inputs.nixpkgs.follows = "nixpkgs"; wallpapers.inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/fallarbor/default.nix b/hosts/fallarbor/default.nix index 4aefa41a..097c06c3 100644 --- a/hosts/fallarbor/default.nix +++ b/hosts/fallarbor/default.nix @@ -9,10 +9,15 @@ }: { imports = [ ./disko.nix - ./hardware.nix ./home.nix + inputs.nixhw.nixosModules.framework-13-intel-11th ]; + ar.hardware = { + enable = true; + sound = true; + }; + boot.loader = { efi.canTouchEfiVariables = true; systemd-boot.enable = true; diff --git a/hosts/fallarbor/hardware.nix b/hosts/fallarbor/hardware.nix deleted file mode 100644 index 9adf8879..00000000 --- a/hosts/fallarbor/hardware.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: { - boot = { - blacklistedKernelModules = ["cros-usbpd-charger"]; - - extraModulePackages = with config.boot.kernelPackages; [ - framework-laptop-kmod - ]; - - initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"]; - - kernelModules = [ - # https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage - "cros_ec_lpcs" - "cros_ec" - ]; - - kernelPackages = pkgs.linuxPackages_latest; - - kernelParams = [ - "nvme.noacpi=1" # https://community.frame.work/t/linux-battery-life-tuning/6665/156 - ]; - }; - - environment.systemPackages = [pkgs.framework-tool] ++ lib.optional (pkgs ? "fw-ectool") pkgs.fw-ectool; - - hardware = { - acpilight.enable = true; - enableAllFirmware = true; - sensor.iio.enable = true; - }; - - services = { - fprintd.enable = true; - fwupd.enable = true; - - udev.extraRules = '' - # Ethernet expansion card support - ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20" - ''; - }; - - ar.hardware = { - enable = true; - cpu.intel = true; - gpu.intel = true; - laptop = true; - ssd = true; - sound = true; - }; -} diff --git a/hosts/lavaridge/default.nix b/hosts/lavaridge/default.nix index e5609800..52a0cc66 100644 --- a/hosts/lavaridge/default.nix +++ b/hosts/lavaridge/default.nix @@ -9,10 +9,15 @@ }: { imports = [ ./disko.nix - ./hardware.nix ./home.nix + inputs.nixhw.nixosModules.framework-13-amd-7000 ]; + ar.hardware = { + enable = true; + sound = true; + }; + boot.loader = { efi.canTouchEfiVariables = true; systemd-boot.enable = true; diff --git a/hosts/lavaridge/hardware.nix b/hosts/lavaridge/hardware.nix deleted file mode 100644 index 7d14b515..00000000 --- a/hosts/lavaridge/hardware.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: { - boot = { - extraModulePackages = with config.boot.kernelPackages; [ - framework-laptop-kmod - ]; - - initrd.availableKernelModules = ["nvme" "sd_mod" "thunderbolt" "usb_storage" "xhci_pci"]; - - kernelModules = ["cros_ec" "cros_ec_lpcs"]; - kernelPackages = pkgs.linuxPackages_latest; - }; - - environment.systemPackages = [pkgs.framework-tool]; - - hardware = { - enableAllFirmware = true; - sensor.iio.enable = true; - }; - - services = { - fprintd.enable = true; - fwupd.enable = true; - - udev.extraRules = '' - # Ethernet expansion card support - ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20" - ''; - }; - - ar.hardware = { - enable = true; - cpu.amd = true; - gpu.amd = true; - laptop = true; - ssd = true; - sound = true; - }; -}