0

I have installed a Nix package on my ubuntu os, that depends on doas, and for it to function, it's binary need's to have the suid bit set - and it isn't in the default nix-env installation. On NixOS you can enable a suid wrapper for doas (nixos wiki), but that has to be put into /etc/nixos/configuration.nix, which doesn't exist out of NixOS.

Does anyone know how to set that configuration value or get doas to function in a different way

1 Answer 1

0

Install doas using Ubuntu's package manager:

sudo apt install doas

That will install doas with SUID, so maybes that's all you need, but it depends on the behavior of your unnamed Nix package that uses doas. If that package just looks for doas on the PATH environment variable it got when it was launched, you should be fine. However, lots of Nix packages have wrapper scripts that overwrite the PATH, in order to make the system more pure and reliable. If your Nix package is using the wrong doas, you will want to somehow override or reconfigure the definition of your Nix package (perhaps using an overlay) so that instead of using pkgs.doas, it uses the following little Nix package I wrote called doas-link, which just creates a symbolic link to the one installed by Ubuntu:

  pkgs.stdenv.mkDerivation {
    name = "doas-link";
    phases = [ "installPhase" ];
    installPhase = ''
      mkdir -p $out/bin
      ln -s /usr/bin/doas $out/bin/
    '';
  }

If you tell me more details about what package you're using and how you are building it, then I might be able to help further.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.