Manage T450s, X1EG2 and Framework 13 from pinned NixOS inputs while retaining machine-specific storage and hardware configuration. Changes: Shared Configuration: - Extract common, KDE, desktop, development and Steam modules - Share Emacs, VS Code, htop, DevOps tools and Docker across hosts - Remove obsolete apps and global project language runtimes Framework: - Import the 11th-generation Intel hardware profile - Enable Steam and ZFS with tookland/home mounted at /home - Document manual ext4 root and ZFS installation steps - Require installer-generated hardware configuration before installation Validation: - Evaluate both ThinkPads and Framework with test hardware - Check Nix syntax, formatting and whitespace
173 lines
3.5 KiB
Nix
173 lines
3.5 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
unstable,
|
|
...
|
|
}:
|
|
|
|
{
|
|
imports = [
|
|
./hardware-configuration.nix
|
|
../../modules/common.nix
|
|
../../modules/kde.nix
|
|
../../modules/development.nix
|
|
../../modules/desktop-apps.nix
|
|
../../modules/gaming.nix
|
|
];
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
boot.initrd.luks.devices = {
|
|
"luks-rpool-nvme-WDS500G3X0C-00SJG0_2017B0802813-part2".device =
|
|
"/dev/disk/by-id/nvme-WDS500G3X0C-00SJG0_2017B0802813-part2";
|
|
};
|
|
|
|
boot.zfs.extraPools = [ "shire" ];
|
|
# Preserve the original root-pool import policy across the release upgrade.
|
|
boot.zfs.forceImportRoot = true;
|
|
|
|
services.zfs.autoScrub.enable = true;
|
|
|
|
networking.hostName = "bilbo";
|
|
|
|
hardware.graphics = {
|
|
enable = true;
|
|
enable32Bit = true;
|
|
extraPackages = with pkgs; [
|
|
intel-media-driver # LIBVA_DRIVER_NAME=iHD
|
|
intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
|
|
libvdpau-va-gl
|
|
];
|
|
};
|
|
environment.sessionVariables = {
|
|
LIBVA_DRIVER_NAME = "iHD";
|
|
}; # Force intel-media-driver
|
|
|
|
services.xserver.videoDrivers = [ "nvidia" ];
|
|
|
|
hardware.nvidia = {
|
|
modesetting.enable = true;
|
|
powerManagement.enable = false;
|
|
powerManagement.finegrained = true;
|
|
open = false;
|
|
nvidiaSettings = true;
|
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
};
|
|
|
|
hardware.nvidia.prime = {
|
|
offload = {
|
|
enable = true;
|
|
enableOffloadCmd = true;
|
|
};
|
|
intelBusId = "PCI:0:2:0";
|
|
nvidiaBusId = "PCI:1:0:0";
|
|
};
|
|
|
|
services.tailscale.enable = true;
|
|
|
|
services.undervolt = {
|
|
enable = true;
|
|
coreOffset = -100;
|
|
};
|
|
|
|
virtualisation.libvirtd = {
|
|
enable = true;
|
|
qemu = {
|
|
package = pkgs.qemu_kvm;
|
|
runAsRoot = true;
|
|
swtpm.enable = true;
|
|
};
|
|
};
|
|
|
|
hardware.nvidia-container-toolkit = {
|
|
enable = true;
|
|
package = unstable.nvidia-container-toolkit;
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
unstable.android-studio
|
|
android-tools
|
|
ffmpeg
|
|
gimp
|
|
adwaita-icon-theme
|
|
kdePackages.kcalc
|
|
lutris
|
|
unstable.mailspring
|
|
nextcloud-client
|
|
unstable.nvidia-container-toolkit
|
|
nvtopPackages.full
|
|
pinentry-qt
|
|
syncthing
|
|
thunderbird
|
|
unstable.threema-desktop
|
|
wineWow64Packages.waylandFull
|
|
zoom-us
|
|
];
|
|
|
|
fonts.packages = with pkgs; [
|
|
noto-fonts
|
|
noto-fonts-cjk-sans
|
|
noto-fonts-cjk-serif
|
|
];
|
|
|
|
services.sanoid = {
|
|
enable = true;
|
|
templates = {
|
|
production = {
|
|
autoprune = true;
|
|
autosnap = true;
|
|
hourly = 36;
|
|
daily = 30;
|
|
monthly = 3;
|
|
};
|
|
};
|
|
datasets = {
|
|
"rpool/home" = {
|
|
use_template = [ "production" ];
|
|
};
|
|
"shire/clw/projects" = {
|
|
use_template = [ "production" ];
|
|
};
|
|
"shire/clw/Documents" = {
|
|
use_template = [ "production" ];
|
|
};
|
|
};
|
|
};
|
|
|
|
services.syncthing = {
|
|
enable = true;
|
|
user = "clw";
|
|
dataDir = "/home/clw/Sync";
|
|
configDir = "/home/clw/.config/syncthing";
|
|
};
|
|
|
|
programs.steam = {
|
|
package = pkgs.steam.override {
|
|
extraPkgs = (
|
|
pkgs: with pkgs; [
|
|
gamemode
|
|
]
|
|
);
|
|
extraProfile =
|
|
let
|
|
gmLib = "${lib.getLib (pkgs.gamemode)}/lib";
|
|
in
|
|
''
|
|
export LD_LIBRARY_PATH="${gmLib}:$LD_LIBRARY_PATH"
|
|
'';
|
|
};
|
|
};
|
|
programs.gamemode.enable = true;
|
|
|
|
networking.firewall.enable = false;
|
|
|
|
system.stateVersion = "23.11";
|
|
|
|
users.users.clw.extraGroups = [
|
|
"libvirtd"
|
|
"kvm"
|
|
];
|
|
}
|