108 lines
3.1 KiB
Nix
108 lines
3.1 KiB
Nix
{ 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 = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
|
|
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.efi.canTouchEfiVariables = true;
|
|
cleanTmpDir = true;
|
|
kernelPackages = pkgs.linuxPackages_surface; # 4_19 worked
|
|
|
|
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 = {
|
|
"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";
|
|
fsType = "ext4";
|
|
options = [ "noatime" ];
|
|
};
|
|
|
|
fileSystems."/boot" =
|
|
{ device = "/dev/disk/by-uuid/D2A2-C705";
|
|
fsType = "vfat";
|
|
};
|
|
|
|
swapDevices = [ ];
|
|
|
|
hardware = {
|
|
firmware = with pkgs; [ firmwareLinuxNonfree i915-firmware firmware_surface ];
|
|
cpu.intel.updateMicrocode = true;
|
|
enableAllFirmware = true;
|
|
ksm.enable = true;
|
|
opengl = {
|
|
driSupport = true;
|
|
extraPackages = with pkgs; [ intel-media-driver libvdpau-va-gl vaapiIntel vaapiVdpau intel-media-driver ];
|
|
driSupport32Bit = true;
|
|
extraPackages32 = with pkgs.pkgsi686Linux; [ libvdpau-va-gl vaapiIntel vaapiVdpau ];
|
|
};
|
|
|
|
pulseaudio = {
|
|
enable = true;
|
|
support32Bit = true;
|
|
package = pkgs.pulseaudioFull;
|
|
zeroconf.discovery.enable = false;
|
|
extraClientConf = ''
|
|
autospawn = no
|
|
'';
|
|
};
|
|
|
|
bluetooth = {
|
|
enable = true;
|
|
powerOnBoot = true;
|
|
};
|
|
};
|
|
|
|
powerManagement = {
|
|
enable = true;
|
|
# cpuFreqGovernor = "powersave";
|
|
};
|
|
services.upower.enable = true;
|
|
|
|
time.timeZone = "Europe/Berlin";
|
|
}
|