2024-04-28 15:54:53 +00:00
# Surface Pro 9
2024-05-07 22:02:59 +00:00
{
config ,
lib ,
pkgs ,
modulesPath ,
2024-12-06 18:04:47 +00:00
namespace ,
2024-05-07 22:02:59 +00:00
. . .
} :
2024-07-03 19:10:33 +00:00
let
2024-10-02 19:31:15 +00:00
bootUUID = " 6 5 7 9 - B 6 C B " ; # The UUID of the boot partition.
luksUUID = " 9 9 3 6 b 1 8 6 - 9 6 a 5 - 4 e 4 3 - 9 a b a - 0 e 0 a 0 e b 5 8 7 d f " ; # The UUID of the locked LUKS partition.
2024-07-03 19:10:33 +00:00
in
2024-05-07 22:02:59 +00:00
{
imports = [ ( modulesPath + " / i n s t a l l e r / s c a n / n o t - d e t e c t e d . n i x " ) ] ;
boot = {
2024-08-27 21:40:47 +00:00
# NOTE: Uncomment to use a default kernel and skip full kernel rebuilds
#kernelPackages = lib.mkForce pkgs.linuxPackages_latest;
2024-12-09 21:06:14 +00:00
kernelModules = [ " k v m - i n t e l " ] ;
2024-09-14 15:19:55 +00:00
# NOTE: Loading the camera driver results in a kernel panic on 6.10 kernels. See https://github.com/linux-surface/linux-surface/issues/1516
blacklistedKernelModules = [
" i n t e l - i p u 6 "
" i n t e l - i p u 6 - i s y s "
] ;
2024-08-13 00:09:08 +00:00
# Enable antenna aggregation
extraModprobeConfig = ''
options iwlwifi 1 1 n_disable = 8
'' ;
2024-12-14 23:00:26 +00:00
initrd . kernelModules = [
" k v m - i n t e l "
" s u r f a c e _ a g g r e g a t o r "
" s u r f a c e _ a g g r e g a t o r _ r e g i s t r y "
" s u r f a c e _ a g g r e g a t o r _ h u b "
" s u r f a c e _ h i d _ c o r e "
" s u r f a c e _ h i d "
" h i d _ m u l t i t o u c h "
" 8 2 5 0 _ d w "
" i n t e l _ l p s s "
" i n t e l _ l p s s _ p c i "
" x h c i _ p c i "
" t h u n d e r b o l t "
" n v m e "
" u s b _ s t o r a g e "
" s d _ m o d "
" s u r f a c e _ k b d "
" p i n c t r l _ t i g e r l a k e "
] ;
2024-05-07 22:02:59 +00:00
2024-09-02 19:11:27 +00:00
kernelParams = [
2024-09-03 15:53:45 +00:00
" p c i = h p i o s i z e = 0 " # Prevent ACPI interrupt storm. See https://github.com/linux-surface/linux-surface/wiki/Surface-Pro-9#acpi-interrupt-storm
2024-12-19 20:21:40 +00:00
" i 9 1 5 . p e r f _ s t r e a m _ p a r a n o i d = 0 " # Enable performance support. See https://wiki.archlinux.org/title/Intel_graphics#Enable_performance_support and https://github.com/NixOS/nixos-hardware/issues/1246
2024-09-03 15:53:45 +00:00
] ;
2024-05-07 22:02:59 +00:00
} ;
2024-07-03 19:10:33 +00:00
# Configure the main filesystem.
2024-12-06 18:04:47 +00:00
$ { namespace } . filesystem = {
2024-07-05 13:36:11 +00:00
enable = true ;
partitions = {
boot = " / d e v / d i s k / b y - u u i d / ${ bootUUID } " ;
luks = " / d e v / d i s k / b y - u u i d / ${ luksUUID } " ;
2024-05-07 22:02:59 +00:00
} ;
2024-07-05 13:36:11 +00:00
swapFile = {
2024-07-03 19:10:33 +00:00
enable = true ;
2024-07-05 13:36:11 +00:00
size = 16384 ;
2024-05-07 22:02:59 +00:00
} ;
} ;
2024-06-08 18:36:28 +00:00
hardware = {
cpu . intel . updateMicrocode = lib . mkDefault config . hardware . enableRedistributableFirmware ;
2024-12-15 18:07:27 +00:00
/*
FIXME : temporarily disable due to conflict with kernel 6 .12 +
ipu6 = {
enable = true ;
platform = " i p u 6 e p " ;
} ;
* /
2024-06-08 18:36:28 +00:00
} ;
2024-05-07 22:02:59 +00:00
2024-08-27 21:40:47 +00:00
# Limit the number of cores Nix can use
nix . settings . cores = 8 ;
2024-05-07 22:02:59 +00:00
# Install/configure additional drivers, particularly for touch
environment . systemPackages = with pkgs ; [ libwacom-surface ] ;
2024-04-23 18:46:17 +00:00
}