Skip to content
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

Idea: be a multi-call binary like busybox to transparently call nix-* commands inside chroot #21

Open
bjornfor opened this issue Dec 11, 2020 · 2 comments

Comments

@bjornfor
Copy link

I needed to use nix-copy-cloure to a machine that didn't/couldn't have a system-wide nix install. That requires having a nix-store binary in $PATH for non-interactive login shells.

I wrote a wrapper script around nix-user-chroot that allowed having all the nix-* commands being symlinks to itself. Then I put the symlinks in $HOME/bin and added export PATH=$HOME/bin:$PATH to ~/.bashrc. When the wrapper script gets invoked from a symlink, it'd call the real nix-user-chroot like this:

nix-user-chroot /path/to/store $argv0

Might be cool to have this functionality directly in the upstream program.

Issue: would probably need some kind of install phase where we ask the user where /path/to/store is. Perhaps the --install flag (listed as wish in the readme) could do this.

@bjornfor
Copy link
Author

Another thing I played with was editing ~/.bashrc to automatically enter the nix-user-chroot on login. We'd probably have to make that easily opt-in/out, because I noticed that I couldn't run ubuntu's 'sudo' program inside nix-user-chroot (seuid forbidden?). Although I didn't have sudo rights on that system anyway :-)

@Mic92
Copy link
Member

Mic92 commented Dec 12, 2020

I would be happy to review this, but there are already to many other projects on my plate to implement this. In fact having an integrated nix installer was also in my mind when I was starting the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants