You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 :-)
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.
I needed to use
nix-copy-cloure
to a machine that didn't/couldn't have a system-wide nix install. That requires having anix-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 addedexport 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: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.The text was updated successfully, but these errors were encountered: