shadow icon indicating copy to clipboard operation
shadow copied to clipboard

Adding NixOS support

Open zyansheep opened this issue 2 years ago • 2 comments

Adding nix support would be pretty easy, but (like guix #2304) doesn't support absolute paths like /bin/bash and the like in shell scripts.

Would this project be open to a PR request that changed all the absolute paths to paths sourced from PATH and added some combination of flake.nix, flake.lock and/or a shell.nix to the root directory?

zyansheep avatar Sep 12 '22 21:09 zyansheep

We need to discuss with @sporksmith, who is away for a bit. But we'll get back to you soon!

robgjansen avatar Sep 15 '22 20:09 robgjansen

Discussed this a bit with @robgjansen . I think we agree that guix and/or nix support are potentially nice, but we can't dedicate much effort to them right now.

Adding nix support would be pretty easy, but (like guix https://github.com/shadow/shadow/issues/2304) doesn't support absolute paths like /bin/bash and the like in shell scripts.

Would this project be open to a PR request that changed all the absolute paths to paths sourced from PATH

I think we'd be open to small-ish PRs to make things more guix/nix compatible. Unfortunately I think this isn't totally trivial. e.g. in the shadow config we currently require the absolute path to the binary to exec, partly because we don't want there to be any ambiguity about which binary is getting executed. Maybe we could mitigate that by logging the expanded paths and including them in configs exported via --show-config, though.

When I was experimenting with guix I worked around the current limitations by using guix containers and adding sym-links into /bin etc. Maybe you could use a similar workaround for now?

and added some combination of flake.nix, flake.lock and/or a shell.nix to the root directory?

Probably not for now. We don't want to merge something that we're not also going to maintain, which means we'd need to add nix configuration(s) into our CI and keep them working.

sporksmith avatar Sep 27 '22 16:09 sporksmith