hardware.nix

mail@pastecode.io avatar
unknown
nix
22 days ago
1.6 kB
15
Indexable
Never
{ config, pkgs, ... }: {
  imports = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> ];

  fileSystems."/boot" = {
    device = "/dev/disk/by-uuid/A142-38A5";
    fsType = "vfat";
  };

  fileSystems."/" = {
    device = "/dev/disk/by-uuid/f55ae95c-a41b-4fc1-bbed-99e0ae00000e";
    fsType = "ext4";
  };

  boot = {
    kernelPackages = pkgs.linuxPackages_latest;
    initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
    kernelModules = [ "kvm-intel" ];
    kernel.sysctl = { "vm.dirty_writeback_centisecs" = 1500; };
    loader.systemd-boot.enable = true;
    loader.efi.canTouchEfiVariables = true;
    tmp.useTmpfs = true;
  };
  
  hardware.cpu.intel.updateMicrocode = true;
  hardware.pulseaudio.enable = true;
  networking.hostName = "nuc";
  networking.networkmanager.enable = true;
  time.timeZone = "Europe/Copenhagen";
    
  services.udev.extraRules = ''
    ACTION=="add", TEST=="power/control", ENV{ID_VENDOR}!="Logitech", ATTR{power/control}="auto"
    ACTION=="add", TEST=="parameters/power_save", ATTR{parameters/power_save}="1"
  '';

  services.xserver.displayManager.setupCommands = ''
    ${pkgs.xorg.xrandr}/bin/xrandr --output HDMI-1 --gamma 1:0.7:0.6 --brightness 0.8
  '';

  services.printing = {
    enable = true;
    drivers = [ pkgs.hplip ];
  };

  hardware.printers.ensurePrinters = [{
    name = "hp";
    deviceUri = "usb://HP/LaserJet%20MFP%20M129-M134?serial=VNFNC99999";
    model = "drv:///hp/hpcups.drv/hp-laserjet_mfp_m129-m134.ppd";
    ppdOptions = { PageSize = "A4"; };
  }];
}
Leave a Comment