This is shelling out to nix-shell ( https://github.com/jetpack-io/devbox/blob/97c19c370287e203bb... ) which means that it will only support bash AFAIK. I've seen a lot of discussions around using nix-shell for dev environments, but read somewhere that is not really made for this purpose originally, rather for just building packages, bash being only one of the limitations. I tried to experiment myself with nix-shell,…
Show HN: Devbox – Easy, predictable shells and containers
91–100 of 196 posts
Re: Show HN: Devbox – Easy, predictable shells and containers
#92Earlier quoted context omitted.
Nix can build Docker containers, VM's, ISO images, etc. I build ISO's from nix all the time to run special compute nodes. The machines boot from the ISO, so every boot they get the same, sane environment.
Yeah I know, my whole comment was about nix-shell and about this project posted here, not generally on nix.
Re: Show HN: Devbox – Easy, predictable shells and containers
#93This is shelling out to nix-shell ( https://github.com/jetpack-io/devbox/blob/97c19c370287e203bb... ) which means that it will only support bash AFAIK. I've seen a lot of discussions around using nix-shell for dev environments, but read somewhere that is not really made for this purpose originally, rather for just building packages, bash being only one of the limitations. I tried to experiment myself with nix-shell,…
> [I] read somewhere that [nix-shell]'s not really made for this purpose originally, rather for just building packages, bash being only one of the limitations.
Yeah, nix-shell was originally made for debugging Nix builds. The first capability it gained was setting up the build environment of a given package, which equips you with the same compiler, linker configuration, etc., as the package would get if you ran nix-build, or when the package is built on CI/CD or whatever. It even loads the bash functions that the build system invokes so that you can experiment with manually adding steps before and after them and things like that.
But it's gained other capabilities since then, like `nix-shell -p`, whose purpose is a more general try-before-you-buy CLI and magic shebangs. It also has two descendants, `nix shell` which is just about letting you set up software, and `nix develop` which is more oriented toward setting up whole development environments and all the env vars associated with it. Anyway I think that's mostly trivia; it doesn't pose any problems for devbox afaict.
> I tried to experiment myself with nix-shell, but I think it doesn't provide separation on the machine on which you run, it's not a chroot nor a docker container
That's true, and that's really the beauty of it: you can set up complex toolchains and use them as if they were simply part of your normal system, but without worrying that they unwittingly depend on parts of your base system that may be unique to you. Likewise, they don't require any permanent changes to your normal, global environment at all. If you've used Python before, you can think of nix-shell like a generalized venv.
> If you are interested in some level of separation to make sure that a dev environment is "safe" to run on your machine without making side effects to things external to the project
Nix can provide sandboxing for builds, for proper packages. So if you want to make sure your environment is complete, adding to your Nix shell development environment to make a complete package may help you.
But the purpose of shells like this isn't to protect you from running `rm -rf /`, if that's what you're after. It doesn't protect you from dogecoin miners in your `npm install` hooks, if you're just using Nix to provide `nodejs` and then running `npm install` as usual.
What something like this does do is allow you to use all that software without installing it. So if you open up a new session, none of that stuff will be loaded.
Nix can generate container images and VMs for you, though, and that is also one of the things `devbox` can do, if your isolation concerns have more to do with security (disallowing access to your system) than 'purity' (disallowing dependency on your system, not installing things to your system).
I hope that makes sense :)
Re: Show HN: Devbox – Easy, predictable shells and containers
#94This is shelling out to nix-shell ( https://github.com/jetpack-io/devbox/blob/97c19c370287e203bb... ) which means that it will only support bash AFAIK. I've seen a lot of discussions around using nix-shell for dev environments, but read somewhere that is not really made for this purpose originally, rather for just building packages, bash being only one of the limitations. I tried to experiment myself with nix-shell,…
I have been avoiding nix for a while since I had a bad time with it several years ago, however recently used it for a small Haskell/Latex environment for literal programming and found it worked really well. I’m probably going to invest time into learning it now, as the online docs seem to have gotten better.
Re: Show HN: Devbox – Easy, predictable shells and containers
#95This is shelling out to nix-shell ( https://github.com/jetpack-io/devbox/blob/97c19c370287e203bb... ) which means that it will only support bash AFAIK. I've seen a lot of discussions around using nix-shell for dev environments, but read somewhere that is not really made for this purpose originally, rather for just building packages, bash being only one of the limitations. I tried to experiment myself with nix-shell,…
I have been avoiding nix for a while since I had a bad time with it several years ago, however recently used it for a small Haskell/Latex environment for literal programming and found it worked really well. I’m probably going to invest time into learning it now, as the online docs seem to have gotten better.
Re: Show HN: Devbox – Easy, predictable shells and containers
#96Earlier quoted context omitted.
Yeah I know, my whole comment was about nix-shell and about this project posted here, not generally on nix.
nix-shell would happily run inside of any container, vm, etc.
Re: Show HN: Devbox – Easy, predictable shells and containers
#97Re: Show HN: Devbox – Easy, predictable shells and containers
#98Re: Show HN: Devbox – Easy, predictable shells and containers
#99 A consistent shell for everyone on the team
Declare the list of tools needed by your project via a
devbox.json file and run devbox shell. Everyone working
on the project gets a shell environment with the exact
same version of those tools.
Why not just use a Dockerfile?Re: Show HN: Devbox – Easy, predictable shells and containers
#100And it will be great if users can build and deliver devbox images with a CI/CD systems like GitHub Action.