-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
generic-linux-gpu: add support for GNU Shepherd #8382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Some things of note:
Footnotes |
291fa1d to
eb7ba57
Compare
|
Changed "shepherd" to "GNU Shepherd" and reworded the long description of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I didn't install the Shepherd file because doesn't really have a "services"
directory, it has files1 (viz./etc/shepherd.scmand$XDG_CONFIG_HOME/shepherd/init.scm). So we don't really have a standard place to install the file (do we place it under a/etc/shepherd/? or under$XDG_CONFIG_HOME/shepherd/init.d?).
Not being a user of Guix, I can't tell you where to symlink the service definition. But you must have a symlink somewhere so that you can create a gcroot. Without it, Nix will garbage-collect the drivers at some point, and you will be left with a broken system after reboot.
Perhaps the setup script can add the link somewhere in /etc, then add the service to the Guix configuration. Or instruct the user how to do add it. And to run sudo guix system reconfigure on update, or something like that.
Perhaps Guix experts can provide some ideas on how to do this in an automated manner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the setup script can add the link somewhere in
/etc[...]
Makes more sense, since it's a service closer to the system. /etc/shepherd/non-nixos-gpu.scm.
[...] how to do this in an automated manner?
Not sure on how to automate this, but i'll try this setup for non-nixos-gpu-setup on my system:
#!/bin/bash
set -e
# Install the Shepherd service file and ensure that the store path won't be
# garbage-collected as long as it's installed.
unit_path=/etc/shepherd/non-nixos-gpu.scm
ln -sf @@resources@@/non-nixos-gpu.scm "$unit_path"
ln -sf "$unit_path" "@@statedir@@"/gcroots/non-nixos-gpu.scm
herd load root /etc/shepherd/non-nixos-gpu.scmI didn't run any "update" commands because just by running this herd load the files were added to /run/opengl-driver.
I'll experiment with home-manager on a test branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got the service to install the drivers at /run/opengl-driver but I couldn't make it update them.
I tried to delete (rm -rf) the /run/opengl-driver, but that just nuked my graphical environment.
eb7ba57 to
d9b406a
Compare
20a669f to
e858a35
Compare
Also encourage contribution for other init systems.
e858a35 to
7334f62
Compare
Opening up support for other init systems.
Description
This PR outlines GPU driver support for Linux distros featuring an init system other than systemd.
The first supported init system is GNU Shepherd, as it's the default init system on GNU Guix.
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.