init: targets.genericLinux.gpu module #8057
Open
+496
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes #8033 where the rationale for why this is needed is given. In short, this module builds a set of GPU drivers and provides a command (to be run with
sudo) that installs a Systemd service which sets up/run/opengl-driversymlink on boot. When the home configuration is activated, the symlink is checked and if it is missing or if outdated drivers are found, the user is instructed to run the setup command. I have been using this approach for about two months and it works much better than nixGL.I have put this under
targets.genericLinux, and I have also moved nixGL there for consistency. I think that's the right place; admittedly, I've no idea how things work on darwin, but searching for "darwin" or "macos" in the nixGL repo didn't turn up anything. I have kept the move as a separate commit so that it is easy to undo if needed. But that does mean that half of the commit messages refer to the module under a different name. I can rebase and reword if needed.Checklist
Change is backwards compatible.
Code formatted with
nix fmtornix-shell -p treefmt nixfmt deadnix keep-sorted --run treefmt.Code tested through
nix run .#tests -- test-allornix-shell --pure tests -A run.all.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
If this PR adds an exciting new feature or contains a breaking change.