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

Ability to simply enter the sandbox #108

Open
pbsds opened this issue Apr 30, 2024 · 3 comments
Open

Ability to simply enter the sandbox #108

pbsds opened this issue Apr 30, 2024 · 3 comments

Comments

@pbsds
Copy link

pbsds commented Apr 30, 2024

I would love if nix-portable could simply drop me into the sandbox (in my case bwrap) where the store and in turn nix profile are available, without going via a nix derivation.
nix-portable nix run nixpkgs#bash will fetch the newest nixpkgs version, and then build bash, causing me to have to wait, while nix-portable nix-shell -p bash both changes the ps1 and will require me to update the channel every now and then.

my current workaround/illegal incantation:

nix-portable ../../../../../../../../../../../../../"$(command -v "$SHELL")"

and in .bashrc/.profile:

if test -d $HOME/.nix-profile/bin; then
    export PATH="$HOME/.nix-profile/bin:$PATH"
fi
@chaserhkj
Copy link

You can pin a version of nixpkgs so that it is used every time:

nix-portable nix registry pin nixpkgs

After this nix-portable nix run should always use the version you pinned. You can use nix registry to change the pin as well.

@pbsds
Copy link
Author

pbsds commented May 17, 2024

I found that entering a nix bash shell caused everything sourced from /etc/skel to fail, where a lot of the SLURM logic is set up on this host. Here I explicitly want to enter the bwrap without neccesarily entering a nix shell

@nesqi
Copy link

nesqi commented Aug 7, 2024

I would also like to be able to just drop into the sandbox.

In my case I don't even have the flake on the machine I'm running nix-portable on. Instead I do a 'nix copy' to that host and 'nix profile install' to access the binaries. But since the profiles are in /nix I need to be in the sandbox to access it. It seems possible to get a shell by running 'nix-portable nix-shell -p', but it feels like a hack.

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

3 participants