9 ms·
The Determinate Nix Installer
- grhmc 4y agoGraham here, CEO of DetSys. I'd be happy to answer any questions I can about the new installer and what we're up to!
- tikhonj 4y agoDoes it work on macOS? Edit: Oh, just saw the link to GitHub with the supported systems, missed that the first time I read the page.
- flexiondotorg 4y agoYes, macOS is supported. X86_64 and Apple Silicon
- nicce 4y agoThere are no binaries for every package in Apple Silicon (but there are many). Also, many Linux-purpose binaries install but they might not work after all. For example Buildah for Podman.
- pmarreck 4y agoThis looks good. I know I'm about to speak towards the OS version and not the Nix that can run atop other distros, but I definitely had some hiccups on the way to my NixOS-on-ZFS-root install (1), such as the configuration of the root user, whether to declaratively or dynamically configure non-root users and wifi networks (and having a working wifi driver that worked with my onboard chip to begin with... I truly believe that linux installs should not be expected to have to bootstrap via Ethernet at this point). Admittedly, a few of these things were due to not using the official GUI installer, but IMHO the commandline non-GUI install of NixOS should be as painless as possible as well. (1) https://openzfs.github.io/openzfs-docs/Getting%20Started/NixOS/Root%20on%20ZFS.html https://openzfs.github.io/openzfs-docs/Getting%20Started/Nix... Regarding your argument against Bash, isn't it true that this is just a different version of the same bootstrapping problem, and that downloading a temporary but specific Bash version would get around that? (I agree that working with Bash leaves a lot to be desired. But it's also more accessible to end-users to hack on, observe, and learn from, than a compiled Rust binary is. And tools like Copilot and ChatGPT and https://www.shellcheck.net/ https://www.shellcheck.net/ make working in Bash MUCH more painless, I've found.) Couple more questions: 1) Is your installer idempotent? (I think it is, since you track what's been done in a JSON structure; just confirming! If the JSON file is lost, are you still idempotent though? lol) 2) Are you a profitable company or just a group of Nix believers?
- deleted 4y ago[deleted]
- grhmc 4y agoWhew, let's go. On NixOS: I generally agree, though it can be tricky to get that done with NixOS. I bet we can make some inroads there. Easy questions: > idempotent It isn't currently idempotent, but we're working on "curing" which brings some idempotency to it, and allows for "rescuing" installations that aren't working correctly. Curing will also support creating a JSON document for installs that don't already have one. > profitable company or just a group of Nix believers We are a for-profit company, and we are a group of Nix believers :). Bash: Bash is really hard to get right, and really hard to make fast, and really hard to extend its featureset to more complicated use cases. We could "just" download a bash, but when we're trying to navigate disk encryption and APFS volumes and mounts ... it is quite a lot easier to write and test that code in a "bigger" language. Also note that it isn't just Bash that we'd need to download, but coreutils and other utilities that Bash is really built on top of. We tried to fix a pretty simple bug last year in the Bash installer, and it took two weeks to validate a relatively straightforward, one line change was valid on all the platforms we target.
- aidenn0 4y ago> Also note that it isn't just Bash that we'd need to download, but coreutils and other utilities that Bash is really built on top of. We tried to fix a pretty simple bug last year in the Bash installer, and it took two weeks to validate a relatively straightforward, one line change was valid on all the platforms we target. This clarifies a lot of what confused me in TFA. I maintained millions of lines of bash code, some of which is decades old and run into only a single bash incompatibility that wasn't fixable with shopt. On the other hand, incompatibilities in programs bash is running are rampant, particularly between GNU and non-GNU systems (and even within GNU there are more surprises than you might think). The phrase "different bash implementations" was a major red herring for figuring out what you were talking about.
- pmarreck 4y agoFollowup question then: Are you hiring? :) What type of work do you do? (is it "sysadmin-flavored," etc.?)
- rmorey 4y agoI have nix currently installed from the official installer in multi-user mode on macOS - I believe it works fine, would there be any benefit to me uninstalling and reinstalling via your installer? edit: i went ahead and uninstalled, and reinstalled via this, and WOW that was fast
- grhmc 4y agoI'm delighted to see your edit :). Our installer makes a few configuration choices that upstream doesn't, but the main driving goal for us is to be reliable, safe, and easy to undo.
- kirbyfan64sos 4y agoDoes the multi-user mode work on SELinux-enabled systems and, if not, is it possible to install in single-user mode? The default installer's multi-user mode doesn't work with SELinux enforcing (https://github.com/NixOS/nix/issues/2374 https://github.com/NixOS/nix/issues/2374), and I didn't see a flag for enabling single-user mode when I used `install --help`. (There are some projects to make SELinux support work like https://github.com/dnkmmr69420/nix-with-selinux https://github.com/dnkmmr69420/nix-with-selinux, but it's not clear to me if that would even work with this installer in particular.)
- Alekhine 4y agoI'm on Fedora and had to turn SELinux off to get nix to work properly.
- grhmc 4y agoI commented elsewhere in the thread, but we have an open issue for SELinux support: https://github.com/DeterminateSystems/nix-installer/issues/124 https://github.com/DeterminateSystems/nix-installer/issues/1.... Hopefully we can get that rolling soon.
- pxc 4y agoThis would be huge for making Nix viable at certain organizations, as I'm sure you already understand! I would love to just be able to point people at an installer like this for usage with SELinux.
- anon291 4y agoWhat do you see as the biggest roadblock for Nix and how do you intend to address it?
- SuperSandro2000 4y agoOne if the bigger issues right now are mass rebuilds and content agreed derivations hopefully address that at least partly. Sadly there is not much work happening on them lately.
- bokchoi 4y agoThank you, this is great! I love the focus on OSX support and on uninstalling. As a nix newbie, it can be difficult to resolve some issues and sometimes re-installing is the simplest option. Is the end result of installing via the bash install script and this new installer the same? Can I use the new tool to uninstall nix installed via the bash script?
- grhmc 4y agoThanks! The end result is not quite the same. For example, we turn on flakes, nix-command, and make a couple other minor tweaks to the Nix configuration to make what we think are user-friendly improvements. For example: https://github.com/DeterminateSystems/nix-installer/blob/main/src/action/common/place_nix_configuration.rs#L29-L39 https://github.com/DeterminateSystems/nix-installer/blob/mai... Our installer also supports some environments that the upstream installer has a harder time with. The new installer can't _yet_ uninstall a Nix installed from the upstream installer, but our upcoming work on "curing" will bring that.
- Laaas 4y agoI do wonder why auto-optimise-store isn't enabled by default. Is there a historical reason for it? Would Eelco accept a PR making it the default?
- bokchoi 4y agoOh and as long as you're being opinionated about installing and making it easy for newcomers, have you considered including an option to install home-manager and nix-darwin? My uneducated guess is they are typically used by folks on OSX.
- pxc 4y agoSetting those up is the hardest thing someone who knows nothing about Nix might otherwise want to do right at the beginning. Nix-Darwin OOTB would be absolutely killer imo, since it provides such a great experience once it's in place.
- JamesSwift 4y agoHave you used home-manager as well? Would be interested to hear your thoughts on the two, and what specifically makes nix-darwin so nice overall. I haven't used it before, just home-manager.
- pxc 4y agoI've played with Home Manager, but I've never really used it long term as much as I have Nix-Darwin. (I'm not super interested in HM's dotfile management features, since I already have tools I like for that.) What's nice about Nix-Darwin for me is mainly how NixOS-like it is. I like keeping its config under /etc and treating systems using it like NixOS. There are a few modules that I think are pretty impressive and atypical for the Nix world, like the Homebrew module. I'm not sure if HM has something comparable.
- JamesSwift 4y agoHomebrew is a big gap in home-manager. In fact, my current setup (and the most common I think) is to use homebrew for casks, home-manager for everything else (and I also do some Brewfile management with home-manager).
- 4y ago
- JamesSwift 4y agoAny thoughts on adding max-jobs/cores to the default config? I've always set mine to `max-jobs = auto` and `cores = (sysctl -n hw.ncpu)` on mac.
- SuperSandro2000 4y agoNix should use similar values already by default but if you are regularly build heavy builds those settings are not good enough and need tweaking.
- deleted 4y ago[deleted]
- Wowfunhappy 4y agoWhat is the minimum (ie, oldest) version of macOS the installer will work on?
- ingenieroariel 4y agoGreat work Graham and team, I'll be switching to it on OSX. I wonder if you took a look at some of the modifications done by portable-nix (https://github.com/DavHau/nix-portable https://github.com/DavHau/nix-portable), most important ones being: a) Allowing user to choose the location of the nix folder (for example $HOME/.nix) by using bwrap or proot b) Same binary for Win/Linux/OSX on x86_64 (Also see https://ahgamut.github.io/2022/07/27/ape-rust-example/) And then, somewhat unrelated: c) Can it be used within NixOS as nix.package = ?
- grhmc 4y agoI've seen some of those changes from DavHau before, they're good! We've also been looking at the statically built version of Nix which is good for "single user" / home-directory-managed installs of Nix. It's a great idea and simplifies the onboarding a good bit. And, it adds some extra behavior which is a little weird. It also doesn't work on macOS, and we're hoping to nail down a (mostly...) consistent experience across the three. No, it can't be used that way on NixOS, but we could put something out that sets up a similar experience on NixOS! Good idea!
- unshavedyak 4y agore: NixOS, not sure exactly what this entails, but i'd love a standardized approach to getting my Nix Flakes onto a NixOS system. Right now i have this adhoc bootstrap process and it feels a bit silly. I get it's slightly different to getting Nix itself installed, BUT, it's also somewhat related from a user point of view. It would be interesting to see something handle this out of the box.
- infogulch 4y agoNix for windows through ape? Don't tease me.
- SuperSandro2000 4y agoYou don't need a nix installer inside of nixos.
- claytonjy 4y agoAs a very nix-curious non-user, this looks like a good place to start; is it? I'm mostly interested in managing my home directory to start (replace gnu stow for dotfiles), but also to manage all my other software in a way that ports nicely between systems and OSes (skip over brew, flatpak, apt, etc.). I think this means home-manager, right? Should I just start here with Determinate Nix, or somewhere else?
- grhmc 4y agoI'd recommend: 1. Start learning with https://zero-to-nix.com/ https://zero-to-nix.com/ 2. Take a look at https://github.com/nix-community/home-manager https://github.com/nix-community/home-manager Good luck!
- the_gipsy 4y agoI still use stow, but for my nix and home-manager config dirs only. The rest of my dotfiles is generated from home-manager, and my system nix stuff from nixos-rebuild. I am successfully sharing a config between my work and my personal laptop, it's something really amazing. I've only used nix on NixOS, so I don't know about installing nix on top of an existing (non-NixOS) OS. A collegue is running just home-manager on ubuntu, with some success.
- trallnag 4y agoHave you considered something like Ansible instead? It's not as clean as Nix but works good enough in my opinion.
- GNOMES 4y agoThis is currently how I manage my dot files + app installs on my different hosts. Nix is interesting for me from an immutable point of view though (mainly NixOS).
- JamesSwift 4y agoYes you are basically describing home-manager. I dont use NixOS so I'm not sure if home-manager is a necessary addon there, but on Mac I use nixpkgs + home-manager.
- yoyohello13 4y agoI've been wanting to give Nix a try for a long time. However, I run Fedora and as far as I've seen Nix is pretty incompatible with SELinux. I'm not really ready to take the plunge and move to NixOS so I've just kind of been holding out.
- grhmc 4y agoThanks for calling that out. Our installer (and the upstream installer) don't support SELinux yet, but there is work in that direction. Here's our tracking issue: https://github.com/DeterminateSystems/nix-installer/issues/124 https://github.com/DeterminateSystems/nix-installer/issues/1... and there is an upstream Nix issue, too: https://github.com/NixOS/nix/issues/7850 https://github.com/NixOS/nix/issues/7850.
- Daegalus 4y agoIf you install it from the community RPM installer, it works as they have SELinux support added: https://github.com/nix-community/nix-installers https://github.com/nix-community/nix-installers
- viraptor 4y agoIs there anything specific that comes up? I'm running it on Fedora and haven't run into any issues yet.
- MuffinFlavored 4y agoAs somebody who was curious about Nix, I was pretty turned off by my first exerpeince. I also found it humorous/ironic that for something that is all about like... deterministic and reproducible or whatever: https://github.com/NixOS/nix/issues/458#issuecomment-1019743603 https://github.com/NixOS/nix/issues/458#issuecomment-1019743... it touched the system in a bunch of places and was a zoo to uninstall
- grhmc 4y agoI wonder if you've tried our installer? Part of its reason for existing is the ability to safely / completely uninstall.
- pxc 4y agoYou used to be able to uninstall Nix on macOS with just `rm`. But the move towards multiuser by default combined with macOS changes restricting filesystem access really complicated things. :-\ Some of this, though: > touched the system in a bunch of places is probably unavoidable. For a daemon to persist, you have to plug into launchd. To get a writable /nix, you need a special volume. To plug into all the shell environments and set appropriate environment variables, you need to configure a bunch of shells. Some of that can be improved, for sure. Some of the logic for setting Nix profiles could be moved out of shell scripts, and then only a few static environment variables could be set in /etc/environment instead of modifying shell startup configurations to source a special script, for example. But the messiest part of a tool like Nix is always going to be where it plugs into some other system which has none of Nix's guarantees and isn't under Nix's control. An improved installer (maybe just like the one in the OP! I haven't tried it yet) is probably the best that can be done here, in automating the handling of those messy points of integration. But it will be a matter of hammering out bugs over time like for any old installer, rather than something that relies on the kinds of guarantees Nix tries to make for its own internal operations. An uninstaller for Nix is something that can (and should!) be done well, but not by simply relying on Nix's usual guide rails.
- JamesSwift 4y agoYeah the Mac experience is less than ideal for sure. There seems to be some animosity to mac on the core team (not a dig, just an observation) so I think they tend to dance around the platform for UX things (and even functional support at times). I think Determinate are trying to fill that gap somewhat.
- NoraCodes 4y agoAs a NixOS-on-server user, I'm super happy to see this! It makes things so much easier for using Nix on my existing desktops.
- ki_ 4y agoI like nix because it seems like an alternative to docker. Yet. Im never going to use it, because it has complexity and i dont understand why. Which is why i dont use docker nor nix. I can work with both, i just dont want to waste my time on them unless i have no other option.
- outworlder 4y agoIt's not a Docker alternative, they are very different. There's some overlap in the sense that you can package an app using both. But that would be like saying APT is a Docker alternative. Docker (and containers in general) will provide filesystem, process and network isolation. Your process can pretend it has the whole machine for itself (and even a different linux distribution) even though it's not true. A Nix package will not do any of that. The package manager solves the problem of managing application packages, versioning, and dependencies; and doing so in a way that's 'immutable'. There's some filesystem abstraction (specially if you use nix-shell) so you can pretend that a particular version is the only one that's installed in the machine, or that a package is installed when it's not. There's complexity but there's a reason for that.
- rgoulter 4y ago> It's not a Docker alternative, they are very different. There's some overlap in the sense that you can package an app using both. But that would be like saying APT is a Docker alternative. They do share one use case: run software without having to install it. I think Docker mostly is about running services in an isolated manner, and is easy to distribute (because its images will run the same way in each host). -- But, I do see some CLI tools provide a docker container, too. Nix, with its flakes, supports a `nix run` command which is very similar to `docker run` (if you're thinking of "run without installing" rather than "process / network isolation"). -- In that sense, it is like 'Docker, but without containers'. e.g. you can run `nix run nixpkgs#helix` and try out helix, or even `github:helix-editor/helix` to build & run helix from its source.
- xhevahir 4y agoI've tried Nix/Nixos a few times over the past years and at some point decided that the documentation was bad enough that any further tinkering would be a waste of my time. So, when it was announced that a group of users would be making a concerted effort to improve the documentation I was hopeful, but looking at this thread--in which Determinate Systems (or one of their employees) is blamed for running roughshod over other contributors--I'm not anymore: https://discourse.nixos.org/t/parting-from-the-documentation-team/24900 https://discourse.nixos.org/t/parting-from-the-documentation...
- pxc 4y agoIt's true that trust and respect between people who have poured themselves into Nix, NixOS and Nixpkgs was seriously damaged, and that this set the Nix documentation efforts back. However, the documentation team still exists and meets— there are still people dedicating much effort to improving the official and community documentation in a concerted way. I feel that those events are more an interpersonal wound internal to the community than they are the death knell for the overall effort to renew the Nix ecosystem's documentation, or a sign that Determinate Systems is not at all invested in the health and integrity of the community and its volunteer organizations. I think turning wholly pessimistic about those things at this point would be a big overcorrection.
- xhevahir 4y agoNo one said it's a death knell. I'm saying that the documentation has sucked for a long time, and that I'm not hopeful enough of its improvement that I would be willing to do the considerable work to overcome the shoddiness of the manuals, the many contradictory tutorials, etc.
- JamesSwift 4y agoThanks for linking that. It was a pretty interesting read, one that I hadn't come across before. Has me seeing things slightly differently, and will keep it in mind when viewing future efforts.
- noloblo 4y agocurl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix https://install.determinate.systems/nix | sh -s -- install on wsl 2 doesnt work gives error and quits saying can't get lock on /etc/passwd pid 629
- abathur 4y agoI'm not directly involved with detsys or this project, but I went ahead and reported this upstream. Crosslinking in case you want to subscribe to that thread: https://github.com/DeterminateSystems/nix-installer/issues/281 https://github.com/DeterminateSystems/nix-installer/issues/2... I know the primary dev on this project does use wsl, so hopefully this'll make sense to them.
- noloblo 4y agoYes I'm still getting the error so I'm unable to install in wsl2 windows 10 and not planning to upgrade to windows 11
- cyanydeez 4y agoStill interesting to see people piping random installs
- ar_lan 4y agoAhhh! I'm so happy about this!
- mplanchard 4y agoThis is really exciting, thank you for this work! We use nix at work to manage our dev environments, rust production builds, and docker images. We have a pretty solid setup path for new developers that basically looks like: 1) install nix 2) run setup Looks like we might be able to get that down to just step two thanks to y'all.