From 8606d37717517c624d17913043b1b08aea39acc4 Mon Sep 17 00:00:00 2001 From: derped Date: Sun, 29 Sep 2019 08:09:26 +0200 Subject: [PATCH] Lilim is dead. Long live Lilim! --- machines/Lilim/configuration.nix | 4 +- machines/Lilim/hardware-configuration.nix | 69 ++++++----------------- machines/Lilim/options.nix | 2 +- services/desktop.nix | 4 -- services/udev.nix | 6 -- 5 files changed, 20 insertions(+), 65 deletions(-) diff --git a/machines/Lilim/configuration.nix b/machines/Lilim/configuration.nix index 972d613..80886bc 100644 --- a/machines/Lilim/configuration.nix +++ b/machines/Lilim/configuration.nix @@ -10,7 +10,7 @@ networking.dhcpcd.extraConfig = "noarp"; - environment.systemPackages = with pkgs; [ firmware_surface xdiskusage ]; + environment.systemPackages = with pkgs; [ xdiskusage ]; - system.stateVersion = "19.03"; + system.stateVersion = "19.09"; } diff --git a/machines/Lilim/hardware-configuration.nix b/machines/Lilim/hardware-configuration.nix index 2578165..dc2c66b 100644 --- a/machines/Lilim/hardware-configuration.nix +++ b/machines/Lilim/hardware-configuration.nix @@ -1,77 +1,42 @@ { pkgs, ... }: -let - 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 = [ - musnix_channel ]; - - musnix = { - enable = true; - alsaSeq.enable = true; - ffado.enable = true; - soundcardPciId = "00:14.0"; - kernel.realtime = false; -# kernel.packages = pkgs.linuxPackages_4_19_rt; - rtirq.enable = false; - }; + ]; boot = { - loader.systemd-boot.enable = true; + loader.systemd-boot = { + enable = true; + signed = true; + signing-key = "/secret/secureboot/db.key"; + signing-certificate = "/secret/secureboot/db.crt"; + }; loader.efi.canTouchEfiVariables = true; cleanTmpDir = true; - kernelPackages = pkgs.linuxPackages_surface; # 4_19 worked + kernelPackages = pkgs.linuxPackages_latest; - initrd.kernelModules = [ "hid-multitouch" ]; - 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 = { + initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" "rtsx_pci_sdmmc" ]; + kernelModules = [ "kvm-intel" "uinput" ]; + kernelParams = [ "intel_iommu=on" ]; + 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."/" = - { device = "/dev/disk/by-uuid/8c3a5a07-9ee1-4154-9f3f-6abc379073aa"; + { device = "/dev/disk/by-uuid/b37b48a8-5dcb-4f4d-ad71-1b26500b3e5f"; fsType = "ext4"; - options = [ "noatime" ]; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/D2A2-C705"; + { device = "/dev/disk/by-uuid/546A-A3D1"; fsType = "vfat"; }; - swapDevices = [ ]; - hardware = { - firmware = with pkgs; [ firmwareLinuxNonfree i915-firmware firmware_surface ]; + firmware = with pkgs; [ firmwareLinuxNonfree ]; cpu.intel.updateMicrocode = true; enableAllFirmware = true; ksm.enable = true; @@ -100,7 +65,7 @@ in { powerManagement = { enable = true; - # cpuFreqGovernor = "powersave"; + cpuFreqGovernor = "powersave"; }; services.upower.enable = true; diff --git a/machines/Lilim/options.nix b/machines/Lilim/options.nix index e83af3b..b8c07b7 100644 --- a/machines/Lilim/options.nix +++ b/machines/Lilim/options.nix @@ -45,7 +45,7 @@ with lib; }; config.system.copySysConf = { - enable = true; + enable = false; addToNixPath = false; }; } diff --git a/services/desktop.nix b/services/desktop.nix index 8937f71..f098b6a 100644 --- a/services/desktop.nix +++ b/services/desktop.nix @@ -44,7 +44,6 @@ in mkIf (elem "desktop" cfg.services) { i3 = mkIf (elem "i3" cfg.desktop.wms) (import ./desktop/i3.nix { inherit pkgs; }); default = elemAt cfg.desktop.wms 0; }; - # add switch for Lilim multitouch = { enable = true; invertScroll = true; @@ -56,8 +55,5 @@ in mkIf (elem "desktop" cfg.services) { naturalScrolling = false; horizontalScrolling = true; }; - # Still waiting for streamlined dpi settings... will write a propper solution once it's done >.< - # see https://github.com/NixOS/nixpkgs/pull/25892 - dpi = ifelse (cfg.hostName == "Lilim") 192 null; }; } diff --git a/services/udev.nix b/services/udev.nix index c10bb6a..e813439 100644 --- a/services/udev.nix +++ b/services/udev.nix @@ -4,10 +4,4 @@ with lib; mkIf (elem "udev" config.machine.services) { hardware.steam-hardware.enable = true; - services.udev.extraRules = '' - # IPTS Touchscreen (SP2017) - SUBSYSTEMS=="input", ATTRS{name}=="ipts 1B96:001F SingleTouch", ENV{ID_INPUT_TOUCHSCREEN}="1", SYMLINK+="input/touchscreen" - # IPTS Pen (SP2017) - SUBSYSTEMS=="input", ATTRS{name}=="ipts 1B96:001F Pen", SYMLINK+="input/pen" -''; }