diff --git a/flake.lock b/flake.lock index 9be0e05..cd0c9ac 100644 --- a/flake.lock +++ b/flake.lock @@ -81,26 +81,6 @@ "type": "github" } }, - "nixos-hardware": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1780310866, - "narHash": "sha256-fPBRVf6A5xlACYcOI59shGrjURuvwu0lRsDoSCEXt/I=", - "owner": "NixOS", - "repo": "nixos-hardware", - "rev": "4ed851c979641e28597a05086332d75cdc9e395f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixos-hardware", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1780453794, @@ -122,7 +102,6 @@ "home-manager": "home-manager", "niri-float-sticky": "niri-float-sticky", "nix4vscode": "nix4vscode", - "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs" } }, diff --git a/flake.nix b/flake.nix index 98d084e..2c2b0db 100644 --- a/flake.nix +++ b/flake.nix @@ -23,11 +23,6 @@ url = "github:nix-community/nix4vscode?tag=nix4vscode-v0.0.12"; inputs.nixpkgs.follows = "nixpkgs"; }; - - nixos-hardware = { - url = "github:NixOS/nixos-hardware"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; outputs = @@ -36,7 +31,6 @@ home-manager, niri-float-sticky, nix4vscode, - nixos-hardware, ... }: let @@ -66,9 +60,7 @@ nixosConfigurations = { fantomitechno-laptop = nixpkgs.lib.nixosSystem { inherit system; - modules = commonModules "laptop" ++ [ - nixos-hardware.nixosModules.framework-13-7040-amd - ]; + modules = commonModules "laptop"; }; fantomitechno-desktop = nixpkgs.lib.nixosSystem { inherit system; diff --git a/hosts/laptop/hardware-configuration.nix b/hosts/laptop/hardware-configuration.nix index b69c4ae..bdbdb7c 100644 --- a/hosts/laptop/hardware-configuration.nix +++ b/hosts/laptop/hardware-configuration.nix @@ -21,13 +21,41 @@ "thunderbolt" "usb_storage" "sd_mod" + "cros_ec" + "cros_ec_lpcs" ]; kernelModules = [ ]; }; kernelModules = [ "kvm-amd" ]; - extraModulePackages = [ ]; + extraModulePackages = with config.boot.kernelPackages; [ + framework-laptop-kmod + ]; + kernelParams = [ + "quiet" + "loglevel=3" + "systemd.show_status=auto" + "rd.udev.log_level=3" + # There seems to be an issue with panel self-refresh (PSR) that + # causes hangs for users. + # + # https://community.frame.work/t/fedora-kde-becomes-suddenly-slow/58459 + # https://gitlab.freedesktop.org/drm/amd/-/issues/3647 + "amdgpu.dcdebugmask=0x10" + # Enables the amd cpu scaling https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html + # On recent AMD CPUs this can be more energy efficient. + "amd_pstate=active" + ]; }; + # Custom udev rules + services.udev.extraRules = '' + # Ethernet expansion card support + ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20" + ''; + + # Needed for desktop environments to detect/manage display brightness + hardware.sensor.iio.enable = true; + fileSystems."/" = { device = "/dev/disk/by-uuid/b3eaa7e8-812e-4a8b-b491-5a9d3fe50b08"; fsType = "ext4"; @@ -42,8 +70,23 @@ ]; }; + services.xserver.videoDrivers = [ "modesetting" ]; + + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + + hardware.amdgpu.initrd.enable = true; + swapDevices = [ ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + # AMD has better battery life with PPD over TLP: + # https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13 + services.power-profiles-daemon.enable = true; + + services.fstrim.enable = true; }