29 ms·
>> Nix and NixOS ruined me. It’s hard to go back. I don't know. Not much about all this setup feels appealing. The apparent learning curve for nix looks...stee
by _ytji 6y ago
>> Nix and NixOS ruined me. It’s hard to go back.
I don't know. Not much about all this setup feels appealing. The apparent learning curve for nix looks...steep. I've been using linux for a pretty long time (I think kernel 2.1 was fresh when I started). I've done the slackwares and debians and redhats and arches and gentoos etc. And I have zero desire to put such effort into having a working system.
I realize the post is prefaced with a warning that it's over-engineered. I guess my question is- can I use nix without going so hard down the rabbit hole? I don't think I have the time to invest like my gentoo (read: teenage) years.
I'm pretty satisfied with doing a minimal install of fedora, setting up i3 and firefox and calling it a day. Maybe I'm just older and more crotchety than I thought.
- k_bx 6y agoYou can use Nix on your Linux (Ubuntu, maybe Gentoo) for the projects you want without going full NixOS.
- danieldk 6y agoAnd macOS! Catalina's read-only system volume has made the installation a bit more difficult. But once you have set it up, you get many of the same benefits (per-project virtual environments, home-manager, etc.). We use NixOS on three machines around the house, but I use Nix + home-manager on my MacBook, and various Ubuntu servers at work. It's nice that I can largely use the same configuration across all machines. Just a home-manager switch and I am in my native environment.
- k_bx 6y agoRight, sorry, forgot to mention macOS even though I’m using Nix there myself for our commercial project’s dependencies
- asdf-asdf-asdf 6y agoi was planning to try out Nix on MacOS, because i always wanted to try out Nix and i use MacOS, but then Catalina happened,a and suddenly there were problems with Nix on Catalina. last time i checked the install-instructions on Catalina, you had to create an unencrypted volume to store the nix-things, which i'd prefer not to do (i understand those files are probably non-personal, so no need to encrypt them, but i don't want to have to remember that half of my hard-drive is unencrypted) is that still required or is there a simpler approach now?
- danieldk 6y agoThe separate volume is still required. As far as I understand if you use an encrypted volume, it does not mount early enough in the login process and you have resort to more hacks to make it work. Ideally the Nix store would be in some non-root location. But that requires a completely new binary cache among other things (since /nix store paths are hardcoded in binaries, scripts, etc). Also making /nix a symlink doesn't really work in some cases, since realpath reports the actual path and that may break builds/applications. It used to work so nicely out of the box :(, but I can also understand why Apple wants to enforce read-only system volumes, since it blocks nastier rootkits, etc.
- Wicher 6y agoI don't have any OSX boxes, but wouldn't bind-mounting the real the /some/where/nix to /nix solve the realpath problem? No need to write to / either (as you would have to do with the symlink approach).
- takeda 6y agoIf it is possible, then I think it should work. I believe this might be the way they are planning to go, because someone mentioned about a separate partition. Honestly, I think they should just relocate it to a different location that can be persisted and rebuild the packages. I don't think people care about the location as long as they don't have to recompile every single thing. This could also be useful to catch all bugs where /nix was assumed.
- johnramsden 6y agoI've used NixOS, it's a great project and has some benefits that can't be overstated, however if you're going to give it a try completely you kind of have to go down the rabbit hole. You will basically be learning a programming language that will let you configure your system. It took quite a bit of getting used to to understand how the language nix works, as it wasn't familiar to something I had used before. One might not have as much difficulty getting used to it as I did if they are experienced with functional programming, which I've only dipped my hands into before. I'd recommend giving it a try if you have some time on your hands to get used to it, but you shouldn't be expecting a quick switch.
- MarcScott 6y agoI disagree. While to be a power user you might have to learn all the syntax of the OS, I have been using NixOS for a couple of years, and have my configuration set up by borrowing other configs from the Web. Additionally I'm a heavy Emacs user, and couldn't type a single line of elisp. I get that I'd be better in Emacs if I knew elsip, but that doesn't stop me configuring my text editor by borrowing code from others.
- tinco 6y agoSo with NixOS your process would look like this. Open up your editor on one of your devices thats already running. Write up a nix config that sets up i3 and firefox, could be just a couple of lines. Save it on a usb drive along with nix itself. Boot your new pc off the USB drive and your set. And thats just the first time you use nix. Next time you just reuse that thumbdrive, or redownload it, and get your config from a git repo you are tracking your config in. I have a git repo that has configuration for three types of devices I run in my personal setup (desktop, nas, webserver). They all inherit from my base configuration which has stuff like the user configuration and maybe my vim how I like it. The server adds docker and runs the docker containers that it should. The nas mounts the raid array etc. If I want to know how I configured my nas three years ago, all I have to do is read the nix file I checked onto github. Thats powerful.
- rustybolt 6y ago> Write up a nix config that sets up i3 and firefox, could be just a couple of lines You forget the step "find out what to write in the nix config file". Might take anywhere from less than a minute to forever, depending on experience, google-fu, and documentation.
- tinco 6y agoWell obviously, I'm just pointing out why you would want to spend some time figuring it out. NixOS isn't just another linux distro, it's the next generation of operating systems.
- abrouwers 6y agoI don't know, the "benefits" have been well preached for years, and I don't see NixOS gaining popularity (though, I tend to focus on the linux community news, so might be missing the visibility). To me, NixOS is a cool concept, but I think it solves a problem that not a lot of people have. I mean, how often are people "redoing their systems from scratch," deploying to new machines, etc? That's like a once-every-four-year thing for me, and it's way easier to just dump a list of packages.
- grumpyprole 6y agoThere is a learning curve to NixOS, but it has saved me huge amounts of time over the last 6+ years. I wrote a configuration.nix file describing my ideal Linux install once and I've been using it largely unchanged for years. Upgrading and migrating to a new machine has been painless. I can also easily change any part of my setup with minimal effort (e.g. to switch from connman to network manager is a one-line change). The NixOS configuration language is a unifying layer of abstraction and allows people to more easily re-use the work of others (compare with pasting commands from a how-to blog post).
- dr3adward 6y ago> I wrote a configuration.ni x file describing my ideal Linux install once and I've been using it largely unchanged for years. I use custom install and configuration scripts for various Linux distros and Windows installs, this is not a feature unique to NixOS, just a different implementation. I use a shell script for Linux and a PowerShell script for Windows.
- ZoomZoomZoom 6y agoBut the crucial difference is that you maintain your scripts, while with NixOS it's pushed to the OS maintainers for the most part.
- eeh 6y agoAs a keen NixOS user/contributor, if your only needs are i3 and Firefox, then I do not recommend NixOS to you. ~Any distribution can meet your needs. NixOS is great for: * shortening the divide between the user and upstream: not just release lag, but also the ability to contribute to upstream. NixOS makes it trivial to write a patch and deploy it your system, something I wouldn't usually bother with Debian, for example, because the same process was so frictionful. * configuring services * packaging ad-hoc code/scripts
- foopdoopfoop 6y ago> As a keen NixOS user/contributor, if your only needs are i3 and Firefox, then I do not recommend NixOS to you. ~Any distribution can meet your needs. I really disagree with this. NixOS is also great for simple use cases like this because it's robust. I know a lot of people who switched to Linux, need to get something to work, follow some online tutorial/directions blindly, and just break shit pretty badly. This isn't contrived: even seemingly-inoculous commands like "pacman -Sy" on Manjaro/Arch can fuck your shit up (it basically amounts to a partial upgrade). NixOS doesn't let you break shit like this. (Literally, upgrades are atomic and packages can never have missing dependencies.) And, even if somehow you did, you then have a nice configuration.nix to quickly get back up to speed.
- danieldk 6y agoThis is a benefit, but other distributions are catching up. For example, Fedora Silverblue has an immutable root filesystem and provides atomic upgrades/rollbacks through OSTree. Ubuntu 20.04 supports making ZFS snapshots as an APT pre-installation hook and thus also support rollbacks.
- pkulak 6y agoAnd don't forget OpenSUSE, which has been making btrfs snapshots before and after every upgrade for years(?) now. OpenSUSE doesn't seem to ever get the recognition it deserves.
- eeh 6y ago
- kick 6y agoI really dislike Nix/NixOS, but I think it's kind of unreasonable to claim something is unappealing because of a learning curve. Pretty much everything on the planet has a learning curve; if a project is genuinely innovative or aiming for a paradigm shift, and you find the benefits of it worthwhile, there's probably always going to be a learning curve. That said, are we really reading the same post? What's presented here is...really simple, and you should be pretty much familiar with most of it if you actually set up Gentoo and Arch in the past; pretty much everything directly translates that requires user interaction in this, and the package format is pretty similar to write & read, too.
- methyl 6y ago> it's kind of unreasonable to claim something is unappealing because of a learning curve. It's not unreasonable at all. It all depends who is claiming that. Consider Mac OS and compare it to any Linux in terms of the learning curve. Can my mother say that Linux is unappealing because it's to hard to learn it? Of course. Even among engineers there are people to prefer just getting the stuff done without spending hours or weeks on configuring their environment (even if it could pay off).
- pjmlp 6y agoLike game developers, graphical developers, app developers, actually anyone selling desktop and mobile OS software. The domain still waiting for Desktop Linux to happen.
- kick 6y agoThe appealing features of whatever it is are still appealing despite the learning curve. To highlight what I object to, because I feel I may have come across ambiguously: Not much about all this setup feels appealing. The good features about, say, OS X, are not made less appealing because of the rest of OS X. They're still appealing properties.
- elbear 6y agoI think you're missing a variable: point of view. Give positive points to any feature you find appealing. Give negative points to any feature you find unappealing. If you have the person you're speaking to go through the same process, you might find you've assigned points differently. And the net sum might be closer to zero for them. That's what makes going through the entire process unappealing for them.
- lloeki 6y ago> The apparent learning curve for nix looks...steep. It looks like so, indeed the manual is fairly extensive yet it probably lacks a hands-on approach. That's what I'm aiming to solve by writing a couple of articles explaining pragmatically how to use Nix (not NixOS, I'm not quite there yet), starting as a Homebrew replacement. And really, at the end of the day the new language is not really harder than having to learn Ruby and the Formula DSL, or ABS idioms and its shell idiosyncrasies in PKGBUILDs.
- pknopf 6y agoI've been able to achieve that same end goal, having deterministic/reproducible/reverting/history/etc with Ubuntu. Essentially, I boot Docker images on bare metal. https://godarch.com/ https://godarch.com/ My recipes: https://github.com/pauldotknopf/darch-recipes https://github.com/pauldotknopf/darch-recipes I have the same exact images, bit-for-bit, running on 3 different machines. I have a zshrc alias that allows me to sync my current machine with my work image that I have stored on Docker Hub.
- the_duke 6y agoI recently stumbled on Darch, but decided not to try it because the repo seems pretty dead. (last commit Feb 2019) Is this a non-issue?
- pknopf 6y agoI use it daily. I'm open to any ideas/improvements people want to make, but it's <air-quote> done </air-quote> in my eyes.
- the_duke 6y agoGood to know, I'll give it another look.
- pknopf 6y agoHeads up though, I will probably be deprecating the "recipes" format for 1.0, opting to use a pure Dockerfile approach. See my recipes repo for an example.
- nvrspyx 6y agoIt's "done" in your eyes, but you're still working towards a 1.0 release? It might just be me, but this is a bit confusing.
- 6y ago
- temptemptemp111 6y agoDarch is an alternative
- haddr 6y agowe had to setup a simple linux for the purpose of diplsaying some stats on the attached screen. choices were: debian and nixos. debian would take approx half day to setup (given other project tasks). nix os was chosen and it took 2 weeks and now it is rather hard for non-nix user to fix anything.
- toyg 6y agoTo be fair, at one point that was the general Linux experience: half a day on Windows, a week on Linux and then “nobody else can fix it”. I’m not arguing for Nix (had a look and it seemed more complex than I can bear at the moment), just that new tech in general needs time before it can be properly compared.
- majewsky 6y agoWell, sure, anything that's unfamiliar to you is hard to fix. For me it would be exactly the other way around, because I'm quite familiar with NixOS and mostly unfamiliar with Debian.
- dr3adward 6y ago> The apparent learning curve for nix looks...steep. How is that not a good thing? I enjoy nothing more than learning a lot in a short amount of time.
- rkangel 6y agoI think the Nix/NixOS debate gets confused by two separate goals: * A workstation machine where you do everything from development to watching netflix * A server (whether VM, Metal, Container) The former wants convenience and flexibility. I agree with you - I also use Fedora because (particularly with Lenovo hardware), you install it and you're done. Everything works. I don't want to have to go and write nix expressions because I want to run a not-very-obscure thing that isn't packaged. It's ok for me that my workstation is a 'pet' and I blow it away every 6 months to a year. The latter case is more interesting and has some specific requirements on it. We all know about configuration drift. The idea of getting completely deterministic setups, and unifying how you do that across VMs, native and containers is great.
- k2enemy 6y agoI agree. Or at least I used to! I set up a server a few years ago running NixOS and it required a steep learning curve, but it seemed worthwhile at the time. Fast forward to today and I want to add a new service on the server and I've completely forgotten everything I learned about Nix and I'm considering switching back to debian.
- VLM 6y ago"The former wants convenience and flexibility." Thanks but no thanks, if those were my priorities I'd just use my chromebook. Or a mac if I had to run locally hosted stuff old school style. This NixOS stuff is very interesting, feels like living in the future. Turning it into Windows10 is exactly what would repel me from enjoying it. To some extent my chromebook is completely deterministic in that there is no setup other than my wifi credentials and google login. Its weird and fun to compare.
- rkangel 6y agoFedora Silverblue is something I'm keeping my eye on, as a way of getting some of the benefits of NixOS without any of the pain.
- abathur 6y agoI think there are more nuanced value conflicts around the workstation case. There's nothing wrong with the values you're working from, but they've slipped down my list over the past few years. Nix can certainly be limiting in some ways. But everything can--we just habituate. It's possible to find interesting tools that aren't at all cross-platform, or that require hours of DIY spelunking to get compiling, or that are only in some other repository. It's possible to find something you want to use that either isn't packaged for or is broken in every package manager. I use Nix (on macOS and NixOS) for roughly the same reasons: convenience and flexibility. But from a different angle, I guess. It is freeing to know that everything I need to make forward progress on all of my personal and professional projects is specified. I have the flexibility to resume work on the projects I care about with almost no friction beyond securing new hardware.
- shivasword 6y agoNix can be approached incrementally by starting with the package manager on your current machine. Perhaps use home-manager to build out a user environment or nix-shell for custom local development environments.
- chpatrick 6y agoI went down the same path as you and now run NixOS. The biggest advantage is that all the tweaks you have to do every time you install are now just a couple of lines in a file you only write once. It's very hard to break the system because you can always boot a previous configuration. Everything is customizable like Gentoo but if you don't modify a package its binary will be fetched from a central server so installation is very fast.
- MarcScott 6y agoI'm no Linux expert. I used Ubuntu for a few years and then switched to NixOS a couple of years ago. Setup is no more difficult to Arch, and certainly a lot easier than Gentoo. For me the fact that I can replicate my machines with a couple of config files is the major driver. That and the ability to install a package in a shell, use it, then exit the shell and not have it installed globally is amazing. Of course, you can use the nix package manager on any Linux distro and even macOS if you want a gentler introduction.
- pkulak 6y ago> That and the ability to install a package in a shell, use it, then exit the shell and not have it installed globally is amazing. I can't even count the number of packages I have installed because I needed them once. I have an entire Node.js ecosystem installed because I needed to run a frontend from another team for 20 minutes. Could I have done all that in a single shell, then had it automatically cleaned up when I was done? My current solution is to spin up a container, but that becomes a pain and I end up getting lazy and just globally installing everything again.
- onlydnaq 6y ago> Could I have done all that in a single shell, then had it automatically cleaned up when I was done? Yes, that is a pretty standard workflow for most nix users. You either set up a shell.nix for your project with all of its dependencies, or if you need a certain tool once you just write for example: ‘nix shell -p iotop’ to enter a shell where iotop is in the path.
- pkulak 6y agoWow, that's pretty great. I'm gonna spin up a Nix VM shortly, see how it goes.
- karatestomp 6y agoI haven't used it in a while but Vagrant used to be great for "setting this up with apt and the language's package manager would be straightforward, but containerizing it would be a pain" one-offs, to keep it off your base system. And didn't require you to keep an entire image around to do it again, just the vagrant config file.
- zamber 6y agoYou might get more mileage from Fedora Silverblue. Toolbox (a regular Fedora ran via podman) gives a disposable container for running dev stuff. The rpm-ostree package manager allows for fearless upgrades as you can always boot into an earlier version of the core OS. There is small learning curve for getting to know rpm-ostree and toolbox tends to be a hindrance if you want IDE integration. Also you have to reboot after installing packages to the core OS, that's mainly why they recommend using flatpaks, but it's optional. Note that it's still beta but pretty reliable as you can always downgrade and wait till they fix stuff that may be broken after an upgrade. When it comes to actual setup needed it's not much different than a regular distro. No language to learn, no additional setup required. Initially I played around with toolbox, wrote a 30 line bash script for initial setup for it and eventually ditched using it. You can still use RPM Fusion and install regular .rpm's. One thing to note is that they recommend to use the default partition layout as custom ones can (and do) break.
- eximius 6y agoYou can absolutely use NixOS without understanding what the article goes through. For example, I use NixOS and I don't know any of this (but I'm looking forward to learning it). For example, on other *Nixes, you install and uninstall packages, maybe configure them, but you're not BUILDING packages. All of the complexity of this article is in the superset of what you'd normally do. For the most part, just add things to systemPackages in configuration and `nix-rebuild switch` or install via `nix-env -i` if you want user scoped installs.
- aidenn0 6y agoThe most complex thing you'll need to do is learn is whatever something like this (taken from my laptop's config, enables acpid, openssh, tlp, sddm, and make plasma5 and E available as sessions): services = { acpid.enable = true; openssh.enable = true; tlp.enable = true; xserver = { enable = true; layout = "us"; libinput.enable = true; displayManager.sddm.enable = true; desktopManager.plasma5.enable = true; desktopManager.enlightenment.enable = true; }; }; and then after the OS is install firefox to your local user profile: nix-env -iA nixos.firefox-bin You will also need to partition your harddrive, but the install/live USB includes the KDE partition manager, so you don't even need to use the commnd-line for that.
- takeda 6y agoYes you absolutely can just install nix[1] it should work on any Linux, I used it in OS X myself and some things are slightly less smooth than Linux, but it still works well. I also highly suggest to start with Nix Pills[2] it goes so by step how to create derivations and conventions in nixpkgs. Once you get familiar, you can see how you can make a reproducible dev environment, the author has a blog how to do it for rust[3] but many things still apply, I for example did a template for python [4], I eventually plan to put a less trivial app with unit tests once I get some free time. [1] https://nixos.org/nix/ https://nixos.org/nix/ [2] https://nixos.org/nixos/nix-pills/index.html https://nixos.org/nixos/nix-pills/index.html [3] https://christine.website/blog/how-i-start-nix-2020-03-08 https://christine.website/blog/how-i-start-nix-2020-03-08 [4] https://github.com/takeda/example_python_project https://github.com/takeda/example_python_project
- fizixer 6y ago> I don't know. Not much about all this setup feels appealing. Exactly. While reading the post all I could think of were flashbacks of dependency hell and not one thing I was reading appeared to be helpful in eliminating it. But now I have to put up with the crazy cryptic language that I've never seen before. Thanks, but no thanks.
- jml7c5 6y agoNix is probably the best solution to dependency hell I've seen. I would read more before dismissing it.
- takeda 6y agoLOL, you've must not paid attention or have some weird definition of dependency hell [1], because the way nix operates makes it nearly impossible (I mean you can technically write an app that requires incompatible versions of the same library, that can't work together, but then that app wouldn't work anywhere else as well, not just with nix) [1] https://en.wikipedia.org/wiki/Dependency_hell https://en.wikipedia.org/wiki/Dependency_hell
- mudita 6y agoI, too, have no desire to put so much work into having a working system (but I guess, there’s no way around nix for me, if I want to use haskell and ghcjs). Unfortunately from my own recent personal experience it does indeed have a steep learning curve . I really like the general idea of nix, I think it’s going in the right direction and I am very grateful for all the people doing amazing work there and I wanted to give it a try for a long time, now. But my recent experience with nix on MacOs has mostly just been incredibly frustrating. I started using nix one or two weeks ago, because I needed it for a project with haskell-miso (which I very much like, by the way). As long as I just stuck to using the default.nix provided by Miso, everything worked fine, more or less, but as soon as I tried to go beyond that to customize things for the needs of my own project, the problems started to accumulate. I needed to google for and apply manual fixes for some very basic things, because nix did not play well with neither macOS Catalina (nix needs access to /nix) nor with fish. Some haskell packages I need like constructible were broken in the default channel and I had no idea how to fix those packages. In the end I ended up switching to a “stable” version. I do not understand why nixpgs-unstable is the default channel, by the way. Sometimes things seem easy in some guides and I thought I understood them, but then when I tried them they just won’t work. For example I was hoping that nix-shell -p 'haskell.packages.ghcjs.ghcWithPackages (pkgs: with pkgs; [ miso ])’ would give me a shell with the ghcjs compiler and the package miso, but that resulted in an error (after waiting for the result for quite some time and a lot of text scrolling by). I tried following guides and didn’t try to do anything especially crazy, but somehow I ended up fucking up my haskell build environment so much, that I couldn’t do anything Haskell-related anymore. Still don’t how I managed to do that. I tried rolling things back through nix-env -G 1 but that didn’t work. Somehow the only think that helped me was deleting everything nix-related and trying again. I then switched away from the unstable channel in the very beginning and now things seem to somewhat work, more or less. When I was 15 years younger I really enjoyed playing around with the configuration of my computer, trying different window managers and editors etc., but nowadays I have work I care about and limited time and I want my computer to just work and not get in the way. Nix really, really got in the way. It’s been incredibly frustrating the last few days, when I wanted to work on my project, but spent several days fighting with nix instead. Sorry for the rant, again, I very much like the project and I really hope it succeeds, I just wanted to share my own experience with it, as a beginner.