grimm-nixos-laptop/common/hardware/laptop.nix
2025-01-27 10:38:55 +01:00

58 lines
1.2 KiB
Nix

{
pkgs,
config,
lib,
...
}:
let
inherit (config.grimmShared) enable laptop_hardware graphical;
in
{
config = lib.mkIf (enable && laptop_hardware.enable) {
environment.systemPackages =
with pkgs;
[
lm_sensors
lshw
pciutils
usbutils
ddcutil
python312Packages.py-cpuinfo
(writeShellScriptBin "lsiommu" ./lsiommu)
]
++ lib.optionals graphical [
opentabletdriver
ddcui
wootility
];
services.udev.packages = with pkgs; [ yubikey-personalization ];
boot.bcache.enable = false;
services.libinput.enable = true;
# hardware.opentabletdriver.enable = true;
# systemd.user.services.opentabletdriver.after = [ "local-fs.target" ];
services.udisks2.enable = true;
boot = {
kernelParams = [
"nohibernate"
];
loader.efi.canTouchEfiVariables = true;
initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
loader.systemd-boot.enable = true;
};
};
options.grimmShared.laptop_hardware = {
enable = lib.mkEnableOption "grimm-laptop";
};
}