mirror of
https://github.com/Zagitta/gpu-unlock.git
synced 2026-12-03 19:44:49 +07:00
[PR #186] Add a Nix flake and opt-in NixOS module #184
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Zagitta/gpu-unlock#184
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Zagitta/gpu-unlock/pull/186
Author: @bearice
Created: 10/26/2026
Status: 🔄 Open
Base:
main← Head:nix-flake📝 Commits (6)
b48a9aeAdd reusable Nix flake and opt-in NixOS moduled80ef28docs: shorten Nix setup instructionsbb33197Fix NixOS unstable initrd and kernel-module installation compatibility55d6e71Move Nix support under packaging and adapt to upstream 1.1.05f0a572Address NixOS review feedback after rebase onto 2.0b17ebbeWarn when NixOS cannot re-unlock after suspend; keep -Werror in checks📊 Changes
10 files changed (+514 additions, -0 deletions)
View changed files
📝
.gitattributes(+2 -0)➕
.github/workflows/nix.yml(+37 -0)📝
README.md(+2 -0)➕
flake.lock(+27 -0)➕
flake.nix(+66 -0)➕
packaging/nix/README.md(+73 -0)➕
packaging/nix/check-initrd.py(+82 -0)➕
packaging/nix/checks.nix(+54 -0)➕
packaging/nix/module.nix(+75 -0)➕
packaging/nix/package.nix(+96 -0)📄 Description
NixOS users can import the module, select explicit PCI targets, and build a boot generation that runs the unlock before NVIDIA binds the device. The module builds against the consumer's
boot.kernelPackagesand supports systemd and scripted initrds where available.This adds:
packaging/nix/, alongside the other distribution packaging.hardware.nvidia.gpuUnlockoptions for targets, package overrides, and resume handling. Both the module and resume handling default to disabled.Validation:
nix flake checkpassed onx86_64-linuxwith the locked NixOS 26.05 nixpkgs and unstable (3ec636362e18), including module compilation, firmware extraction, and inspection of the built initrds. Scripted initrd checks run only where supported.920e57aon an RTX 3080 Laptop 16GB (10de:249c), NixOS 26.05, Linux 6.18.57, and NVIDIA Open 595.71.05. The loaded module matched the flake build; unlock completed before NVIDIA loaded; post-FLR selectors remainedss0=0x88888888,ss1=0x8; handoff returned 0 with no retained pages. NVIDIA rebound normally, a 4096-element CUDA vector-add matched CPU results exactly, and a Strata chat request succeeded. No NVIDIA Xid or unlock errors were observed.920e57a.Kernel sources and existing distribution installers are unchanged. Build checks require no GPU and do not validate hardware performance or suspend/resume behavior.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.