- Add .gitignore for common languages, tools, and OS/editor artifacts - Configure .gitattributes for Git LFS (fonts, images, archives, ISOs) - Add README with repo description - Add flake.nix defining inputs and outputs for NixOS, Home Manager, and related modules - Introduce home-manager configs: - Base home.nix with packages, services, and programs - Hyprland WM configuration (waybar, fuzzel, keybindings, theming) - Vim (nixvim) setup with LSP and plugins - Zsh setup with aliases, Oh My Zsh, clipboard helpers - Systemd user services (e.g., librespot) - Add scripts (GPU monitor, RAM build helper, install automation) - Add host configurations: - Nixbook (Apple laptop) with hardware, disko, and install script - Nixstation (desktop) with firewall, virtualization, Btrfs scrub timer - Nixtest (test VM) with QEMU + Alpine-based install test harness - Common modules (network, NVIDIA, rclone, screen, keychron, users) - Include statix config for linting
51 lines
1.2 KiB
Nix
51 lines
1.2 KiB
Nix
# Under maintanence
|
|
{ pkgs
|
|
, ...
|
|
}:
|
|
let
|
|
# Optional helper for manual (re)binding at runtime
|
|
vfioBindScript = pkgs.writeShellScriptBin "vfio-bind" ''
|
|
#!${pkgs.runtimeShell}
|
|
DEV="$1" # e.g. 0000:81:00.0
|
|
echo vfio-pci > /sys/bus/pci/devices/$DEV/driver_override
|
|
${pkgs.kmod}/bin/modprobe -i vfio-pci
|
|
echo "$DEV" > /sys/bus/pci/drivers/vfio-pci/bind
|
|
'';
|
|
in
|
|
{
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
boot = {
|
|
# Load vfio early and bind the second GPU before NVIDIA can claim it
|
|
initrd = {
|
|
kernelModules = [ "vfio_pci" ];
|
|
preDeviceCommands = ''
|
|
DEVS="0000:81:00.0 0000:81:00.1"
|
|
for DEV in $DEVS; do
|
|
echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override
|
|
done
|
|
modprobe -i vfio-pci
|
|
for DEV in $DEVS; do
|
|
echo $DEV > /sys/bus/pci/drivers/vfio-pci/bind
|
|
done
|
|
'';
|
|
};
|
|
|
|
kernelParams = [
|
|
"intel_iommu=on"
|
|
"iommu=pt"
|
|
];
|
|
|
|
kernelModules = [
|
|
"vfio_pci"
|
|
"vfio"
|
|
"vfio_iommu_type1"
|
|
"vfio_virqfd"
|
|
];
|
|
blacklistedKernelModules = [ "nouveau" ];
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
vfioBindScript # optional manual tool
|
|
];
|
|
}
|