Nixgl: https://github.com/nix-community/nixGL

Also, it seems like this requires the latest “stateversion”, since this is a new feature.

This is pretty big, because it makes it easy to use applications that use the GPU from nixpkgs on non Nixos systems.

  • moonpiedumplings@programming.devOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    Ah. You’re on Void. Indeed, it does look like Void doesn’t have an implementation of systemd-tmpfiles. Here is the file from my system, it’s only creating a single symlink, which is basically the same thing you are doing:

    [moonpie@nefertem home-manager]$ cat /etc/tmpfiles.d/non-nixos-gpu.conf 
    L+ /run/opengl-driver - - - - /nix/store/2r6vmqh1vkivsrmr6n1vh1862i2qndqz-non-nixos-gpu
    

    Oops, the below is for artix. I was nosy but not nosy enough and I saw a comment where you mentioning you used void after you wrote all of this. I’m gonna leave it here since it was an enjoyable rabbit hole.

    I did some digging, and it looks like it is possible to use systemd-tmpfiles outside of systemd. It’s just a binary that creates files/directories/symlinks based on a format, so it’s pretty easy to extract, or reimplement entirely.

    Artix has their own, an extraction from the systemd package: https://packages.artixlinux.org/packages/system/x86_64/etmpfiles/

    It looks like that package is required by the base package, which is the core package set declaring the minimal dependencies needed to have a working system, so it’s highly likely you have it installed.

    I think it automatically starts too, but I can’t find a hard source for this. Based on this page: https://wiki.artixlinux.org/Main/Migration#Download_the_Artix_packages it looks like etmpfiles is needed before you select/install the init system, which suggests that. This reddit post, where a user has an issue where etmpfiles isn’t installed, so their service manager complains and dies.

    If you have a service named something related, like tmpfile or the like, then it does autostart.

    • juipeltje@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 month ago

      Yeah, i was using Void but atm i’m using Guix. From what i can tell Guix doesn’t have an implementation for it either, but my current setup works so that’s good lol. I just have a shepherd service that executes the script in my users’ .nix-profile as root. The tmpfiles.d method is basically what this project is doing as well. I ended up not using it because of that, but i also don’t like that it adds more projects that you have to depend on to get it working compared to the manual setup that we’re doing.