From 6f5965b6787e830b0c6936a367daecff84fc9d4e Mon Sep 17 00:00:00 2001 From: Andre Date: Sun, 28 Apr 2024 11:54:53 -0400 Subject: [PATCH] Moar Surface 9 tweaks --- flake.lock | 6 +++--- flake.nix | 2 +- hosts/Khanda/default.nix | 7 +++++++ hosts/Khanda/hardware-configuration.nix | 15 +++++++++++---- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index c940042..ad123f3 100644 --- a/flake.lock +++ b/flake.lock @@ -222,11 +222,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1714076141, - "narHash": "sha256-Drmja/f5MRHZCskS6mvzFqxEaZMeciScCTFxWVLqWEY=", + "lastModified": 1714253743, + "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7bb2ccd8cdc44c91edba16c48d2c8f331fb3d856", + "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f63c11f..53ad264 100644 --- a/flake.nix +++ b/flake.nix @@ -80,7 +80,7 @@ Khanda = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = defaultModules.base ++ [ - nixos-hardware.nixosModules.microsoft-surface-pro-intel # FIXME: Needs kernel recompile to enable + nixos-hardware.nixosModules.microsoft-surface-pro-intel ./hosts/Khanda ]; }; diff --git a/hosts/Khanda/default.nix b/hosts/Khanda/default.nix index 9e05a84..0e43676 100644 --- a/hosts/Khanda/default.nix +++ b/hosts/Khanda/default.nix @@ -38,6 +38,13 @@ }; }; + # Limit number of simultaneous builds so we have two free cores. + # 5 max jobs * 2 cores each = 10 cores in total. + nix.settings = { + max-jobs = 5; + cores = 2; + }; + # Configure the virtual machine created by nixos-rebuild build-vm virtualisation.vmVariant.virtualisation = { memorySize = 2048; diff --git a/hosts/Khanda/hardware-configuration.nix b/hosts/Khanda/hardware-configuration.nix index 534d6ed..66fde01 100644 --- a/hosts/Khanda/hardware-configuration.nix +++ b/hosts/Khanda/hardware-configuration.nix @@ -1,6 +1,4 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. +# Surface Pro 9 { config, lib, pkgs, modulesPath, ... }: { @@ -25,7 +23,7 @@ "/" = { device = "/dev/disk/by-uuid/b34afd29-94ff-421b-bb96-8497951abf58"; fsType = "btrfs"; - options = [ "subvol=@" ]; + options = [ "subvol=@,compress=zstd" ]; }; "/boot" = { @@ -45,4 +43,13 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + # Install/configure additional drivers, particularly for touch + environment.systemPackages = with pkgs; [ + libwacom-surface + ]; + microsoft-surface = { + ipts.enable = true; + surface-control.enable = true; + }; }