diff --git a/machines/Lilim/hardware-configuration.nix b/machines/Lilim/hardware-configuration.nix index bed052e..bcffce0 100644 --- a/machines/Lilim/hardware-configuration.nix +++ b/machines/Lilim/hardware-configuration.nix @@ -1,7 +1,28 @@ { pkgs, ... }: let - musnix_channel = (fetchTarball "https://github.com/musnix/musnix/archive/master.tar.gz"); + musnix_channel = (fetchTarball "https://github.com/musnix/musnix/archive/master.tar.gz"); + version = "5.0.10"; + patchlevel = "1"; + linux-surface = pkgs.fetchFromGitHub { + owner = "jakeday"; + repo = "linux-surface"; + rev = "${version}-${patchlevel}"; + sha256 = "1q8dv7j6gwgszqavb35aswwfn7c7mwkc2xqd2v8gvxnjk7sp4747"; + }; + + buildFirmware = (name: subdir: src: pkgs.stdenvNoCC.mkDerivation { + name = "${name}-firmware"; + src = src; + nativeBuildInputs = [ pkgs.unzip ]; + sourceRoot = "."; + installPhase = '' + mkdir -p $out/lib/firmware/${subdir} + cp -r * $out/lib/firmware/${subdir} + ''; + }); + + i915-firmware = buildFirmware "i915" "i915" "${linux-surface}/firmware/i915_firmware_skl.zip"; # vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; in { imports = [ @@ -12,23 +33,28 @@ in { alsaSeq.enable = true; ffado.enable = true; soundcardPciId = "00:14.0"; - kernel.realtime = true; - kernel.packages = pkgs.linuxPackages_4_19_rt; - rtirq.enable = true; + kernel.realtime = false; +# kernel.packages = pkgs.linuxPackages_4_19_rt; + rtirq.enable = false; }; boot = { loader.systemd-boot.enable = true; loader.efi.canTouchEfiVariables = true; cleanTmpDir = true; -# kernelPackages = pkgs.linuxPackages_4_19; + kernelPackages = pkgs.linuxPackages_surface; # 4_19 worked initrd.kernelModules = [ "hid-multitouch" ]; - initrd.availableKernelModules = [ "hid-microsoft" "hid-multitouch" "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; - kernelModules = [ "kvm-intel" "hid-microsoft" "hid-multitouch" "uinput" ]; - kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; }; + initrd.availableKernelModules = [ "hid" "surface_acpi" "hid-microsoft" "hid-multitouch" "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; + kernelModules = [ "intel_ipts" "kvm-intel" "hid-microsoft" "hid-multitouch" "uinput" ]; + kernel.sysctl = { + "kernel.nmi_watchdog" = 0; + "fs.inotify.max_user_watches" = 524288; + "vm.dirty_writeback_centisecs" = 1500; + }; kernelParams = [ "threadirq" ]; extraModulePackages = [ ]; + extraModprobeConfig = "options snd_hda_intel power_save=1 power_save_controller=Y"; }; fileSystems."/" = @@ -45,7 +71,7 @@ in { swapDevices = [ ]; hardware = { - firmware = with pkgs; [ firmwareLinuxNonfree firmware_surface ]; + firmware = with pkgs; [ firmwareLinuxNonfree i915-firmware firmware_surface ]; cpu.intel.updateMicrocode = true; enableAllFirmware = true; enableKSM = true; diff --git a/machines/Lilim/options.nix b/machines/Lilim/options.nix index 4a3b9ae..999d8ba 100644 --- a/machines/Lilim/options.nix +++ b/machines/Lilim/options.nix @@ -32,7 +32,6 @@ with lib; services = [ "containers" "desktop" - "docker" "udev" "cups" ];