21 ms·
Nix – Death by a Thousand Cuts
- jonotime 2y agoThoughts on a love/hate relationship with Nix on the desktop.
- unstruktured 2y agoI don't think he touched on whether server side is a more valid use case, but was nice to read someone elses take on using it for a desktop. Thanks for the contribution. He did find functional programming to be sort of mystic so I don't know if I trust his take on assesing the nix language itself. TLDR; just stick with ubuntu or arch unless you feel like experimenting
- jonotime 2y agoAuthor here. Your TLDR is spot on. Yes, my intent was to be on desktop use since most things I read dont consider that specifically. I did talk about how I would keep this running on some simple home servers since I think that's where Nix shines. But some of my servers are raspberry pis, which I mentioned I am worried to run Nix on due to resource limitations. I should probably just try it.
- dhon_ 2y agoI wish remote build/deploy for Raspberry Pi was in a better state - it seems like a perfect fit for NixOS. I've got x86 servers running NixOS that are deployed using Colmena, but it seems to fall apart when I add cross compilation into the mix.
- aidenn0 2y agocross compilation is hit-or-miss, but using qemu/binfmt works just fine, if a bit slow.
- lilyball 2y agoI'm running NixOS on a raspberry pi and I deploy to it with deploy-rs¹. This works pretty well for me. My dev machine is an Apple Silicon laptop with nix-darwin installed and I use its nix.linux-builder module to run an aarch64-linux VM as a remote builder to build the rpi's system. All this means the rpi never has to do any building itself, and doesn't even need the nixpkgs source installed either. If you want to do this yourself, I recommend using https://github.com/nix-community/raspberry-pi-nix https://github.com/nix-community/raspberry-pi-nix so the system is configured much more closely to how the stock raspberry pi image works. The benefit of this is better reliability of stuff like bluetooth. ¹https://github.com/serokell/deploy-rs https://github.com/serokell/deploy-rs
- Arnavion 2y agoI dabbled with NixOS many years ago for a much shorter time than the author has spent on it, so I have much less experience with it. My main problem with it was that the problem of declarative config is basically solved at the software-level already. System services have always been able to be configured by dropping files in /etc. Lots of software also specifically supports config dropins, so that merging configs from multiple sources is even easier. Even stuff like creating users and groups can be done on systemd distros by dropping in config files. Similarly configuring user software is mostly about dropping files in ~/.config etc. Package managers vary. Alpine's apk is the best in that `/etc/apk/world` is the list of packages you want, and every run of `apk upgrade` will install and uninstall packages accordingly to match that list, but it doesn't have dropins. apt and zypper don't even have a config file, only an opaque database that you can only interact with using the commands. But you can maintain your own packages list and then script apt/zypper to diff against that list and install/uninstall accordingly. (zypper in particular does maintain a list of packages, except it's a list of packages that you *don't* install explicitly but are just auto-installed as dependencies of the ones that you did, which is funny to me.) I get declarative config on all my devices (a mix of OpenSUSE, Debian, Ubuntu and postmarketOS, across servers, desktops, laptop, phone) with just an Ansible-like setup. For each device I have a `$hostname.roles` file that contains one role per line. Each role corresponds to a `role.$role` directory that contains any files that should be deployed as part of that role (both under homedir as well as at the system level) as well as a `packages` file that lists any packages that should be installed for that role. Then there's a small shell script that matches the hostname of the machine against this directory and ensures that all files exist, and that all the required packages are installed and no extras are installed. Also the entire directory is in version control so I have a log and reasoning recorded for every change. The author mentions rebuilding a laptop to do another laptop's job by applying the other's Nix config. I have also used my script to rebuild a few devices after their disks died and I had to reinstall the OS from scratch, so it ticks that checkbox too. And of course I've added and removed roles occasionally to add/remove features from individual devices. NixOS would give me a way to rollback the entire config, but I can also do that with this. In case I need to rollback to packages that no longer exist in the distro repository, I have btrfs snapshots to roll back to. NixOS would give me a way to install multiple versions of packages, but this is something I've never needed. I primarily stick with distro software so it is always consistent, and if two distro softwares require different versions of the same dependency, distros already know how to solve that (make two coinstallable packages). The one time I tried to build someone else's Nix project (and they even had a Dockerfile with nix in it to do the build so it would be completely independent of the host), it didn't build for me, so I'm not sure how reproducible it really is. But that might've just been a problem for that one project. I'm sure Nix(OS) has benefits for other people, but for me the benefits that I would care about are handled entirely by dropping files in the right places, and I don't have to use a different OS or package manager or bespoke programming language to do that.
- RestartKernel 2y agoTrying to get Eduroam working soured me on NixOS as a desktop/laptop OS. If conventional methods fail, you're left with a completely non-standard OS designed to prevent quick hacks. But NixOS spoiled my entire mindset around Linux. Going back to anything else feels like a massive downgrade. We would be better off today if declarative operating systems became the standard back when they could.
- soraminazuki 2y agoWi-Fi should just work like any other Linux distro, assuming you have a desktop environment like GNOME or Plasma installed.
- IshKebab 2y agoProbably not very helpful telling him that it should work!
- pzmarzly 2y agoeduroam is not your everyday WPA{2,3}-PSK, it's WPA2-EAP. There are official shell scripts to provision certificates, but they only seem to work on major distros, and for some reason the eduroam website made different scripts for every university. Also, for most people this is their first (and last) experience with 802.1X, especially setting it up themselves. In my experience few years ago, it was a pain to set it up on everything except macOS and iOS (which come with eduroam certificates preinstalled in their trust stores).
- arccy 2y agoeduroam is less one network standard implemented by universities, more like, individual university networks that are set up similarly enough that they have a chance of talking to each other's auth servers and maybe working.
- gf000 2y agoBut then it would suck equally as much on any other Linux distro, NixOS has no relevance here. (I have also suffered from tying to connect to eduroam on Linux laptops).
- rowanG077 2y agoNix for me has been a great source of stability. I used to run ubuntu and was never happy. Packages randomly broke, the UI lagged a lot, I always had to dig to get things working. One day when I head a uni deadline an automated updated destroyed my wifi funcionality. I had some experience with nix from work so in anger I installed NixOS. Wifi worked and I finished my uni assignment. Haven't installed anything else on my computers since, and that was 6 years ago. Sure things can be a pain. But NixOS has never broken in unexpected ways. I know if I update things may go wrong. But I can always go back and try again a newer version a few weeks later. The biggest drawback is really that "random executable from the internet" does not work out of the box. And sometimes you have to spend a lot of time to package something yourself. But all in all It has saved me time and a lot of pain. I dare even say I no longer have a toxic relationship with my OS.
- VTimofeenko 2y agoFor those pesky random executables there's a couple of escape hatches -- buildFHSenv and nix-ld. This is also predicated on good provenance of the executables in question. One should probably not even ldd sketchy binaries: https://jmmv.dev/2023/07/ldd-untrusted-binaries.html https://jmmv.dev/2023/07/ldd-untrusted-binaries.html
- micahcc 2y agosteam-run seems to be able to run everything. It uses bubble wrap to keep the OS isolated and add /usr/bin stuff most exes want.
- SuperSandro2000 2y ago*it won't be in the future because it is no longer the grabbag for everything. Also linking things to /usr/bin is done by the fhs which uses bubblewrap, not steam-run.
- soraminazuki 2y agoEven proper packaging is far easier compared to other package managers. Typical distros push users away from packaging their own software, so users end up relying on ad-hoc solutions instead. Nix instead makes packaging easier by having proper tools to abstract away the nitty gritty details. For random binaries, autoPatchelfHook works miracles.
- Havoc 2y agoI found getting started quite easy. But then you discover there are like 4-5 different ways to manage packages and not much consensus in the community on what the correct way is. That was kinda discouraging
- aidenn0 2y agoI think there probably actually isn't one "correct" way. Anything that is best configured with a nixos module should probably be in your system configuration, but beyond that there are probably a lot more than 5 different ways and they have their advantages and disadvantages. What I settled on was a per-user declarative setup (first with "nix-env -r", now with "nix profile"). Then I use nix shells to run software for one-offs. If I find I am running the same software from a nix shell a lot, I toss it in my declarative file. Plenty of people hate this setup, and do something completely different (e.g. imperative managing of profiles, or using home-manager, or a dozen direnv setups). I don't necessarily think any of them are wrong, but they are not for me for various reasons.
- pxc 2y agoA fairly clear hierarchy emerges with enough experience, I think, but I don't know if there's explicit consensus about it of the kind that could make its way into documentation. Here are the rules of thumb, though (in a kind of priority order): 0. If you're new and on the fence about using flakes, go ahead. (If you know you don't want them, fine.) 1. Prefer declarative installation to imperative installation. 2. If a module exists, prefer using it to configure a package to just adding that package to a list of installed packages. 3. 'Native' packages are better than 'alien' packages. 3a. Packaged for Nix is better than managed externally. (I.e., prefer that programs live in the Nix store rather than Flatpak or Homebrew.) 3b. Prefer packages built from source to packages carved out of foreign binaries. 4. Prefer to just rely on Nixpkgs for things that are already in Nixpkgs; only bother with other sources of Nix code (likely distributed as 'flakes') if you know you need them. 5. Prefer smaller installation scopes to larger installation scopes— when installing a package, go with the first of these that will work: per-session (i.e., ephemeral dev env) -> per-user -> system-wide). 6. Prefer Nixlang to not-Nixlang (YAML, JSON, TOML, whatever). 7. If you're not sure, go for it. If you follow these guidelines you'll make reasonable choices and likely have a decent time. The most important rule is #1, so once you know your OS, your task is to make sure you have at least one module system available to you. (On NixOS, that's NixOS and optionally Home Manager. On other Linux, that's Home Manager. On macOS, that's Home Manager and/or Nix-Darwin.) After that, everything can find its natural place according to the constraints above. If you need to break or relax a rule, it'll be obvious. Inevitably you'll end up with things installed in a handful of ways and places, but you'll know why each thing belongs where it is, and you can leave yourself a note with a '#' character anywhere that you think a reminder might be useful. :)
- trod1234 2y ago[dead]
- craftkiller 2y ago> ZFS on Linux [...] The recommended way to do this is to use LUKS, not native ZFS encryption. FWIW I've been using native zfs encryption on nixos and it works great. It lacks neat features like being TPM-backed or having multiple keys, but if all you need is password-based encryption then I think native ZFS encryption is better since you'll be able to do encrypted zfs send/recv, you'll have granular control over which datasets are encrypted (or encrypted with different passwords), you'd get cross-platform support for the encryption (for example, my FreeBSD home server can receive and decrypt my laptop backups), and you aren't adding another layer of complexity.
- rcxdude 2y agoI think the main reason ZFS's native encryption isn't recommended is that there's known bugs in its implementation, especially around key rotation and send/recv.
- aidenn0 2y ago> I think the main reason ZFS's native encryption isn't recommended is that there's known bugs in its implementation, especially around key rotation and send/recv. Is that still the case? I thought the send/recv bugs at least were squashed a couple years ago?
- quectophoton 2y agoI'm subscribed to this GitHub issue to follow the situation: https://github.com/openzfs/zfs/issues/12014 https://github.com/openzfs/zfs/issues/12014 It might not be the only issue related to ZFS native encryption but, at the very least, as long as this one isn't closed I'm assuming it's still not safe.
- snailmailman 2y agoI’ve also been using ZFS native encryption on my machine. I wouldn’t describe it as flawless- but that’s mainly due to how nixos-unstable works. There have been several times where the latest “stable” ZFS doesn’t support any of the newest kernels, and the “latest working” kernel goes EOL, and so nixos completely drops it. And my options every time seem to be -roll all the way back to latest “LTS” kernel. This sometimes breaks things. -skip ahead to a beta release of ZFS (this isn’t always an option, and do I really want an unstable file system?) -just don’t update for like a month and wait for new ZFS to release, supporting a newer kernel. And there really isn’t a good option here. Theoretically there’s another option where I maybe keep using the EOL kernel version, and update the rest of my system normally, but I haven’t figured out how to configure that. So I just pick whichever option breaks the least amount of things each time. It’s definitely more of a ZFS issue than something NixOS-specific, but it’s annoying when I’m suddenly greeted with “That kernel version is EOL now.” And the update fails. And there is no easy way to ignore that and accept the risk of a slightly-outdated kernel.
- ris 2y agoI think this is quite a fair commentry (although I quite like the Nix language personally) - as a nixpkgs developer even I don't use NixOS on the desktop. For me it shines on servers and development environments.
- tuananh 2y ago> as a nixpkgs developer even I don't use NixOS on the desktop that's not every encouraging :)
- ris 2y agoWhy? It just isn't what draws me to Nix. I've never even really tried NixOS on the desktop TBH.
- tuananh 2y agonothing. it's just from someone with no experience with nix like me, it feel weird that someone is already deep into Nix but isn't tempted to use it daily.
- cbrozefsky 2y agoYou can use it daily, intimately, without using nixos. Using it for dev environments on macos for example, and servers. Did that for years before I installed nixos on my desktop.
- woile 2y agoI've been using nix in a Mac for a year now. Recently I got a new Lenovo machine and first thing I did was install nixos, it's actually much better than I was expecting. You do notice that nix is designed around nixos
- wpm 2y agoMaybe it’s everyone else using it on their daily driver that got it wrong? It’s like doubting Kubernetes because one of the maintainers doesn’t run their desktop in KubeVirt.
- nunez 2y agoI'd like more clarity on this: > The advantage over docker here is that (when using Flakes) Nix builds are completely reproducible. Docker containers may be isolated, but surprisingly they are not deterministic out of the box. With some work you can make docker deterministic, but thats what you need, its much easier to use Nix. as the whole purpose of the Dockerfile is to create a reproducible environment.
- theossuary 2y agoI guess you could consider a docker image a "reproducible environment," but it's certainly not a reproducible build; running docker build twice on the same directory isn't guaranteed to give you the same image. You could put in the work to make it a reproducible build, but it doesn't do anything to help you achieve that. Nix defaults to reproducible builds, and requires flags for "impure" non-reproducible builds. It does this by requiring all dependencies be managed by nix, and all sources be copied into the nix store.
- JamesSwift 2y agoIts reproducible at a superficial level. Tags are mutable, so someone can push a different “3.1” between build 1 and 2, which results in a different build. You can also be fuzzy with tags, so if you say “from nginx:3” as your base (or nginx:latest) then build 1 and 2 can change because of a new tagged build upstream. Then theres the million app-level changes that can creep in, eg copying local source is non-deterministic, apt-update, git clone, etc. Nix requires you to be fully explicit about the hash of the content you expect in each of those cases and so if you build it twice it is actually the same build.
- jonotime 2y agoAuthor here. The idea with nix flakes is it has a lock file which should guarantee the same build. This is like package-lock.json or pdm.lock which contains dependency checksums for every package. Docker works more like your standard package manager. If you ask for mysql 5, today you may get mysql 5.1, but next week you may get mysql 5.2. So it does not come with a guarantee.
- aidenn0 2y ago
- nunez 2y agoMy setup is a smorgasbord of dotfiles and symlinks. It's been built up over 13 years, so it's very well seasoned and has served me well, but I've long been meaning to move to Nix to make my setup cleaner. The bad in this article isn't that bad, so now I'm amped even more to do this!
- anirrudh 2y agoI've been daily driving nixOS on my desktop, and manage my work and personal macOS machines with flakes. I love this ecosystem, and have even managed to make folks at work use nix devShells -- frankly, the learning curve is pretty steep; the payoff is that I've learned so much. I've been very happy with it -- I run a windows VM with libvirt/KVM/QEMU when I want to game, and use the same to run "local" LLMs. While docker is a great technology, I actually prefer using nixOS containers (which are, under the hood, systemd-nspawn containers). When I worked on my startup briefly, I built nixOS images with everything needed for raspberry pis; all I needed to do was use dd to burn the image to an SD Card. For me, nix is a wonderful and perfect solution for building stable software.
- ChocolateGod 2y agoI use NixOS, one of the annoying things to me is the documentation and error reports. I swapped my installation to a Flake managed install a few months ago, and parts of my Nix files that were perfectly fine before started throwing out errors (specifically HomeManager), which no amount of Googling the error message that gone thrown got me any closer to a solution. I looked at documentation recently to try and enable PGO/LTO and Zen 3 optimizations (don't mind compiling everything) and I think I saw at least 10 ways and none worked (gcc errors, etc).
- lolinder 2y agoThis is why I haven't switched my NixOS to flakes yet. The community discussions always act as though flakes should be the default that everyone should use now, but I figure that the developers know what they're doing and haven't made them the blessed path yet for a reason. So far so good—my system is far more stable than it was under Debian and I've yet to run into anything that didn't have an easy answer. I have a suspicion that because the Nix community is disproportionately likely to contain early adopters, the general mood in the forums is less risk-averse than I am with my primary stacks.
- sshine 2y ago> I figure that the developers know what they're doing and haven't made them the blessed path yet for a reason. My take is: flakes don’t align with centralised nixpkgs and ultimately don’t solve any problems that can’t be solved without flakes. They’re just an interface for a decentralised module system. You can use them, they’re feature-complete, and they don’t align with nixpkgs: it doesn’t make sense for individual packages to have their own flakes, nixpkgs can already be loaded as a flake. FlakeHub tries to popularise flakes, but I don’t know if there is a flake discovery problem to solve. Ekala Project is designing a poly-repo alternative to nixpkgs (ekapkgs) and they don’t embrace flakes. So... Flakes have reached full maturity: a decentralised package format that has stalled its adoption status within the main Nix toolchain.
- 0x457 2y ago
- FrostKiwi 2y agoHave my server infrastructure on NixOS. Huge boost in productivity and stability, would never go back to standard linux. But man if something breaks it's a nuke going off. Sry for the long post, but thought I share my experience: Mass storage on a big encrypted RaidZ array of spinning rust, no issues. Bootloader, /boot, Encrypted Root and Databases on Mirrored NVME Drives. And man is that a nailbiter on each update. Setup my drives during 22.11 following NixOS Root on ZFS instructions [1], which were amended following reports of systems becoming unbootable [2] and mostly removed later [3]. Besides initially being a broken setup [4] with an increasing amount of mounts each update stalling any system writes and causing updates to fail, it became a well running machine after that was fixed. Then during the 24.05 update and with no config change, the system became unbootable [5]. After a tough recovery [6] I never figured out how to do mirrored bootloaders again, switched to a single bootloader setup. To this day I have interactions I don't understand and am trying to fix [7], which sometimes causes updates to knock services offline due to the `nixos-rebuild switch` process stopping services, going to update the bootloader, failing due to missing mounts and exiting with services being offline, prompting manual intervention. [1] https://github.com/openzfs/openzfs-docs/blob/1211e98faf1f37af1de5eb8f3ce0a1c87f71a0e6/docs/Getting%20Started/NixOS/Root%20on%20ZFS/1-preparation.rst https://github.com/openzfs/openzfs-docs/blob/1211e98faf1f37a... [2] https://github.com/openzfs/openzfs-docs/commit/1211e98faf1f37af1de5eb8f3ce0a1c87f71a0e6 https://github.com/openzfs/openzfs-docs/commit/1211e98faf1f3... [3] https://github.com/openzfs/openzfs-docs/commit/4fb5fb694f44c81639d28c1b73fce2093e7ccac4 https://github.com/openzfs/openzfs-docs/commit/4fb5fb694f44c... [4] https://github.com/NixOS/nixpkgs/issues/214871 https://github.com/NixOS/nixpkgs/issues/214871 [5] https://github.com/openzfs/openzfs-docs/issues/531 https://github.com/openzfs/openzfs-docs/issues/531 [6] https://github.com/openzfs/openzfs-docs/issues/531#issuecomment-2430689864 https://github.com/openzfs/openzfs-docs/issues/531#issuecomm... [7] https://discord.com/channels/568306982717751326/1328541099672997888/1328541099672997888 https://discord.com/channels/568306982717751326/132854109967...
- mrnipper 2y agoI replied to your issue at https://github.com/openzfs/openzfs-docs/issues/531 https://github.com/openzfs/openzfs-docs/issues/531. Not sure if it will be any help, but that's how I'm doing my mirrored zpool EFI boot partitions.
- sigmonsays 2y agoi use nixos on VMs, my desktop (Gaming and productivity) and servers. I use flakes for everything. I've painfully learned how to do everything I need. My only big complaint is updating systemd. I have yet to figure out the systemd update bug. Sometimes nixos-rebuild-switch takes my network offline when updating systemd. It's incredibly annoying to update a box and have it drop offline. My work around is to do a 'diff' and when systemd is updated, I reboot manually and only update the boot image.
- aidenn0 2y agoDoes it stay offline? My network often bounces when updating systemd, but I haven't seen it stay down.
- sshine 2y agoMine does that too, sometimes.
- bdd 2y agoI believe https://github.com/nixos/nixpkgs/pull/372196 https://github.com/nixos/nixpkgs/pull/372196 fixes this if you are using systemd-networkd. It was merged to master last week and made it to unstable branches (https://nixpk.gs/pr-tracker.html?pr=372196 https://nixpk.gs/pr-tracker.html?pr=372196).
- jonotime 2y agoYup, I have had that several times too.
- SuperSandro2000 2y agoProbably because it restarts the network service. You can configure the systemd unit to be only reloaded or nothing at all m
- sigmonsays 2y agohow do you do that?
- yoyohello13 2y agoI courted making the switch to NixOS a couple times, but I just don't really see the value add to me right now. Yes, if you have a lot of machines then it maybe make sense. At this point I just use Nix home manager for my dotfiles/userspace programs on a normal distro and I feel like I get 90% of the benefit without any of the headaches.
- poincaredisk 2y ago>At this point I just use Nix home manager for my dotfiles/userspace programs on a normal distro and I feel like I get 90% of the benefit without any of the headaches. If it works for you, sounds good! I comment because I recently had opposite thoughts - that maybe I should migrate off nix home manager - to keep 90% of benefits (nixos) and avoid all the headaches (home manager quirks). Funny how opposite experience we have. For me I love nixos because how when I configure something it just works, and how when I break something I can just undo that easily. And I like how my system don't get more cruft with time and stays lean.
- tombert 2y agoThe reason I keep it around on my laptop is mostly because of the snapshotting. I generally do know my way around Linux command line nowadays, but with Ubuntu and Arch (especially early in my career when I didn't know what I was doing), I would get into states that break the video driver, or break GRUB, or make the machine unstable, and the only thing I could do was reinstall the whole OS. With NixOS, since it's all declarative, if I end up really breaking something, I can always reboot and choose a previous generation. It makes things a lot less scary for me, I can experiment with and play with different boot parameters and drivers and I know that I won't be stuck spending two hours reinstalling everything. It changes the entire way that I work. For example, on my current laptop (Lenovo Thinkpad, AMD), I was having an issue with my USB ports idling out, so sometimes the first ~4 seconds of my typing wasn't registering since the USB port had to wake up. The solution involved adding a kernel parameter `usbcore.autosuspend=-1`. Had this been something like Ubuntu, I have been burned enough trying to add kernel params that I might honestly have just lived with the annoyance because I didn't want to risk everything breaking, but because I knew that there was no actual risk with NixOS, I was able to fix it permanently, and I have the solution committed to Git if I ever have to do this on another computer.
- aidenn0 2y agoAnybody know what author is talking about with gnome and plasma not being allowed in the same configuration? I don't currently have both configured, but I ran this way from somewhere in the neighborhood of 20.09 to 23.05 with no difficulties.
- dandanua 2y agoDesktop NixOS is my daily driver for almost 3 years. I don't bother diving into deep technicalities, flakes or other complicated stuff. I define programs and settings that I need in the configuration.nix. That's all. And it works perfectly! For complicated stuff I run containers such as docker or podman (you could use distrobox too), so I don't have a headache while trying to achieve it in NixOS (but I respect everyone who does this and makes this system grow).
- _huayra_ 2y agoI've been on the fence about Nix. I've wanted to love it (and do love the concept), but between the Waiting-for-Godot situation for flakes, the weird language, and the occasional political infighting I've seen pop up about the community, I still haven't switched. I'm no language expert, but I genuinely don't understand why it wouldn't have been better to build some equivalent DSL in Haskell to do this given the similar lazy nature of the language. DSL for most things, then open the hood and do actual Haskell for crazier use cases. I get that Nix started before Haskell became less academic and slightly more usable in the mainstream and has built up momentum, but the lack of tooling for understanding what is going wrong when incrementally building up a config is very confusing. I'd be curious if anyone has go to or from NixOS compared to declarative distros compared to the atomic distros like ublue [0] and has any thoughts. I'm a bit split about what to move to next (though my >5 year Tumbleweed install on most of my machines is holding up no problem). [0] https://universal-blue.org/ https://universal-blue.org/
- Zambyte 2y agoI switched away from Nix OS and eventually landed on GNU Guix, which I have stayed on for about 4 years now. One of the main reasons I switched away from Nix was because of the language, and how underdocumented it all felt. GNU Guix was a breath of fresh air, using a language with decades of academic backing outside of the context of Guix (SICP was awesome for getting into it) and the whole system is very well documented, with a nearly Arch-wiki quality manual built into the OS in the info pages.
- jonotime 2y agoOh, I'm interested. Are you using it on servers, or desktop? My concern is the community is small, while Nix's has been booming.
- bjoli 2y agoI am using it on my home server that serves my web page and also a lot of things for my home network. It runs some guix containers and some VMs. Nothing fancy. All declared in a couple of files.
- mcpar-land 2y agofor me there are two kinds of pain in software troubleshooting: 1) I Don't Know The State: there's some weird little bit of state hanging around somewhere I don't know about that's messing with my end result. Once I learn about this state, correcting it is trivial. I hate this kind of problem solving, it's not mentally stimulating, I don't learn a lot, looking up answers online is often not helpful. And when I fix it, I don't gain a lot beyond just the problem not happening anymore. (examples: secret config file i didn't know about, an application edited its own config, file permissions were wrong, symlink was wrong, cache is invalid, etc.) 2) I Don't Understand The Concept: the idea of what something is supposed to do or why hasn't clicked for me yet. Getting to that state will take some time as I wrap my head around it. Once I do, I have that knowledge forever and can build on it to understand even more concepts. I _love_ this kind of problem solving. It's mentally stimulating, it builds on itself, increases mastery, problems are easily found / troubleshot online because people are dealing with similar issues and not their own machine's personal state. NixOS has been almost entirely the second kind of problem solving for me. The first two weeks were basically a full time job of fussing with my config but once I got it, I got it forever. Writing my first derivation was confusing, but now it's easy and it'll always be easy. I think this is why Nix has been able to "get away with" having the abysmal, fragmented documentation that it has for so long - it's so good at being a near-stateless, all-encompassing declarative configuration that even outdated blog posts, random people's personal configs on github, even the nixpkgs source code can be helpful enough to solve your problem (and that's often all you have to go on!!!)
- zie 2y agoSo a server that's dedicated to well-supported(by nixos) services running NixOS is awesome. it's easy to upgrade every 6 months and generally very painless. Everything else is a PITA though. Of course if you use an LTS like Debian Stable or Ubuntu, you only have to upgrade every 5-ish years, so unless you always need the latest and greatest release of something, it maybe isn't worth the hassle. Trying to hack on other people's junk with NixOS is just asking for pain. Just use Ubuntu LTS like everyone else. That's generally easy and painless.
- Brian_K_White 2y ago"Trying to hack on other people's junk with NixOS is just asking for pain." To me that's a large part of the very definition of a useful general purpose OS is that it's flexible and enables you to do whatever you need to do today, without the developers having previously somehow planned and provided for exactly that thing. It's like the systemd argument all over. The exact thing systemd aims to prevent is the exact thing that made the original unix so powerful and useful that 40 years after architecting it, it still worked because they didn't try to think of every possibility, they gave you a toolbox that let you do whatever you might need to do. Where systemd sees a shell script as "unmanaged chaos" I see "unconstrained utiliy", a useful toolbox including a saw that doesn't have it's own opinions about me what boards I can cut. If "Trying to hack on other people's junk with NixOS is just asking for pain." that is basically the definition of "this is not a useful operating system that empowers me to get things done". It's useful maybe as a crafted firmware for a static device. (Not saying that nixos inflexibility is driven by the same paternal "we'll give you the whitelist of actions Poettering thinks are valid" attitude as systemd. In nixos it's merely a natural consequence of indirection and layering. They aren't trying to remove any agency from the user/admin, it's just the simple indirection itself that makes pre-planned and standardized things easier at the expense of anything direct and unplanned becoming harder. Like instead of having an OS that may or may not be driven by ansible, let's replace the OS with just ansible, and now there is no way to do anything any other way except by figuring out how to write a playbook to do it.)
- grumpyprole 2y ago> To me that's a large part of the very definition of a useful general purpose OS is that it's flexible and enables you to do whatever you need to do today, NixOS gains most of its power from restrictions. These restrictions enable awesome things like starting a shell with all dependencies in seconds versus minutes using alternative technologies (used by great effect by replit). Nix works surprisingly well for most software, but anything with a ton of dynamic dependencies is going to cause issues. Even knowing what the dependencies might be statically can be hard. Sure, providing an OS with no restrictions and complete flexibility is an option, but then you'll just end up no better off. Whatever the future of operating systems will be, it certainly will involve more restrictions and less flexibility.
- bfrog 2y agoI love the ideas behind Nix. But as noted here, there's a thousand cuts to be found. My biggest issue has been packaging binary distributed programs. These often want files in a particular directory somewhere, often want to find relative path libraries or plugins, want certain configuration options in etc... None of that Just Works, there's a whole confusing method to try and monkey patch the software to work but its long list of not being able to find the information you want, not being able to do what you want, or simply limitations around how nix wants to structure things that make it really really frustrating. If something like Nix were to be done again... I'd really recommend starting with something like a strongly typed flake like language with tooling a lot closer to that of cargo from rust from the get go. Errors should be easy, projects should be easily setup independently, etc. Where every project can simply be built as an independent thing. Sure there's downsides, but the upsides are that... you don't have the impossible task of managing one of the largest mono repos, if not the largest, on github. With all of the insane issues that entails. It wouldn't be that terrible to have a crates.io equivalent to publish, test, and share flakes. Now I think I might've just created flakehub... but flakehub still relies on nix the tool and nix the language which are far from easy to work with.
- SuperSandro2000 2y agoThat's just proprietary software assuming you are on something Debian or red hat like. The problem is on them being closed and hostile towards improvement. Also for someone not knowing Rust it is also very intimidating and if you start to go into more complex things you are easily out of luck with the tutorials out there. The monorepo is not that big of an issue. More often you are being bitten by badly maintained software that doesn't work with a 3 year old compiler or upstream is unwilling to move forward because of LTS support or something.
- jcmfernandes 2y agoI'm relatively new to nix, and this cut close: > At this point NixOS has been around for 2 decades, but it still feels like it has not settled on good recommended workflows for incoming users. Yes. This was a major pain point when I was getting started. The IRC community has been helpful in this regard. I also really don't like that nixpkgs serves as both a lib and a package set. Be one! I don't want "special" inputs in my config.
- otabdeveloper4 2y ago> good recommended workflows for incoming users Users of what exactly? Workflows for configuring a desktop to play Steam games is vastly different from workflows for managing a cattle fleet of enterprisey servers.
- jcmfernandes 2y agoOn how to assemble your config. Every config I open does things a little bit different, from the get-go, when using flakes. Add package sets as overlays to nixpkgs or pass inputs downstream? How to parametrize "system"? What's stuff like flake-parts and flake-utils for? Should I use them? All these came to my mind on the first day.
- otabdeveloper4 2y agoIt's not really a "config", it's actually a program that plugins into your infrastructure-as-code process to build system images. As expected, people here love to bikeshed and have vastly different opinions on "best practices".
- jcmfernandes 2y agoI understand that, but even nixos refers to configuration.nix as a "configuration file" in its documentation. IMO, it's totally OK that people have different opinions on what are best practices. However, I would still like to see official documentation showing beginners how to do things, comparing a few options.
- Brian_K_White 2y agoInstead of having an OS that might be driven by ansible, let's just replace the OS with ansible.
- Baeocystin 2y agoThe older I get, the more I realize that so much of the divide in the tech field is simply between the two camps of "the tools are the interesting part" vs "getting things done with the tools is the interesting part".
- deleted 2y ago[deleted]
- azeirah 2y agoThe more I use nix, the more I understand it's both. Nix is genuinely so fucking great, but the ecosystem and docs and language are a mess. It needs to be cleaned up, and things _are_ getting better. The core philosophy of Nix is so damn solid though, and that's the real innovation here. As long as its philosophy manage to stick around, then it's ok.
- rob_c 2y agoIt's basically, I refuse to learn how to containerize. Just learn, use, promote best practices and stop forking the ecosystem _even_ further... There, I got that off my chest.
- jvandreae 2y agoThe problem with docker is less the containerization and more the half-baked build system.
- jjmarr 2y agoWell, yeah. Nix is attempting to be better than containerization. Saying "improvements aren't necessary because we already have 'good-enough' technology" is a meaningful argument when the improvements aren't significant. In my view, they are significant because Nix can be used to create a fully featured OS instead of just a VM.
- pzmarzly 2y ago> they are significant because Nix can be used to create a fully featured OS instead of just a VM Look up Bootable Containers project by RedHat [0]. Fully featured OS built from a Containerfile, bootable on bare metal. I agree that Nix design is much better than Docker, and has a bunch of features that OCI ecosystem doesn't (e.g. remote builds[1], partial downloading of the build tree, non-linear build process[2], nix store import/export, overlays, I/O isolation, much better composability), but "creating OS instead of VM" [did you mean container?] is not one of them. [0] https://github.com/containers/bootc https://github.com/containers/bootc [1] You can use DOCKER_HOST, and I'm happy that this option is there, but Nix does it better. [2] Perhaps with BuildKit it's no longer true, I haven't checked what happens if you have multi-staged build with one stage depending on multiple previous ones (which are otherwise unconnected). I think Earthly can parallelize this scenario https://earthly.dev/ https://earthly.dev/
- tombert 2y agoI love NixOS, it's my daily driver on my personal laptop, but it definitely has given me more than its fair share of headaches. If everything you're going to do is in Nixpkgs, great! Nix will mostly "Just Work" and you'll get all the nice declarative goodness that you want. Since Nixpkgs is constantly getting updated, this isn't that weird of a thing. The thing that's been most annoying to me is when I try and run generic Linux programs, only to be unceremoniously told "You can't run generic Linux programs in NixOS because we break dynamic linking". Suddenly something that would take about ten seconds on Ubuntu involves me, at the very least, making a Flake that has an FHS environment, or me making a package so that no one else has to deal with this crap [1]. I didn't really want to know how to make my own Nix package, and I don't really want to be stuck maintaining one now, but this is just part of Nix. This means that it's still not something I could easily recommend to someone non-technical like my parents, unlike Ubuntu. You have to be willing and able to occasionally hack up some code if you want your system to be consistently useful. To be clear, there's a lot of stuff I really like, I don't plan on removing it from my laptop, and for something like a server (where the audience is sort of technical by design), I really have no desire to ever use anything but NixOS, but it's a little less impressive for desktop. [1] https://github.com/NixOS/nixpkgs/pull/366367 https://github.com/NixOS/nixpkgs/pull/366367
- lilyball 2y agoYou can run generic Linux stuff if you install nix-ld¹, the only tricky bit is having to customize the set of libraries given to nix-ld for your use-case. It includes various common libraries by default, but depending on what you want to run you may have to add to it. ¹https://search.nixos.org/options?channel=unstable&show=programs.nix-ld.enable&from=0&size=50&sort=relevance&type=packages&query=nix-ld https://search.nixos.org/options?channel=unstable&show=progr...
- tombert 2y agoInteresting, I didn't realize that that was an option. I've been getting by with buildFHSenv and Flakes, which, despite my complaints, really isn't that annoying. My goal at this point is to eventually compile all my flakes and take on Lutris.
- lilyball 2y ago> It seems very cool that you can roll back in the case of a catastrophic upgrade failure, but has that every happened to you? Not me. Rollbacks saved me from completely destroying my entire system. I managed to fill up my boot partition in a way that deployed successfully but left the whole system unbootable after reboot, and the only way I managed to save it without having to completely wipe and reinstall from scratch (which means losing all my data) was to load the SD card onto my laptop, fix the boot partition by hand to ensure the kernel from the previous generation was valid, and edit the bootloader config to delete the offending configuration (because accidentally trying to boot it would re-corrupt the boot partition). I've also used rollbacks in other less catastrophic situations, such as when I broke wireless (since I build remotely on a much more powerful machine and deploy over SSH).
- bpye 2y agoI use NixOS on my home router and rollbacks also saved me from a Firewall misconfiguration that broke all network connectivity.
- ssalka 2y agoJust want to flag that the first image likening Nix to the Holy Trinity has a spelling error in the text "The Operating Systam".
- antiphase 2y agoThe whole thing is full of speling and grammar errors. The author desperately needs a copy editor.
- captainepoch 2y ago> It seems very cool that you can roll back in the case of a catastrophic upgrade failure, but has that every happened to you? Not me. It did, and thanks to that rollback feature, my system was working in a few minutes.
- edude03 2y agoNix has been my daily driver for about 10 years, all 10 on servers, and about 3/4 on a laptop. The thing that hits close to home for me, is the inability to use software that doesn't support nixes opinions on how to do version management (for example a post of mine from years ago[^0]), software that likes mutable state for its configuration (Gnome for example) and yeah, trying new things that aren't packaged for nix means writing a nix derivation. That said, I feel like nix does more good than harm for me so the paper cuts are bearable. [0]: https://community.roonlabs.com/t/unable-to-get-roon-to-start-on-nix-linux/20923 https://community.roonlabs.com/t/unable-to-get-roon-to-start...
- James_K 2y agoI only wish Guix had a more robust nonfree packages I think it could really give Nix a run for its money.
- nemoniac 2y agoIf you're looking for robust, nonfree packages for Guix, you can find them here: https://github.com/nonguix/nonguix https://github.com/nonguix/nonguix
- James_K 2y agoI know about nonguix. It's the only way the wifi drivers work on my laptop. But it doesn't have half the stuff Nix does. I need a nix service running in my system configuration to install Teams and Discord. That channel is practically unmaintained compared with Nix, I'd guess because it's not an official part of Guix.
- akimbostrawman 2y ago>Teams and Discord Try flatpaks
- James_K 2y agoWhy? Nix works just as well and I already have it running.
- akimbostrawman 2y agobc you just complaint about it?
- _emacsomancer_ 2y agoAlso, for a wider search for packages across non-official channels: https://toys.whereis.social/ https://toys.whereis.social/
- 2y ago
- 0x457 2y agoIt reads like the author didn't even try to understand NixOS. > But not always. Why? Because there are so many ways the context can vary as everyone is doing different things. Is that config you found: This whole section reads like author gives ChatGPT code snippets and asks it to explain. Nix snippets are not very copy-pastable because everyone creates different abstractions to reduce boilerplate. I have probably done "JSON -> list of packages" conversion 3 different ways in my codebase.
- grep_name 2y agoI've been using nixOS on my laptop for over a year now and I still don't have an answer for 'my version of firefox/darktable has a bug in it, but I can't update it without upgrading the entire rest of all the software installed on my machine.' I keep thinking there has to be a way around this, but it doesn't seem like there is one that's clean and not hacky / brittle. Other than that I love it, but that's a pretty huge caveat
- thomastjeffery 2y agoAs with most situations in Nix, there is an elegant and clean solution; but that solution is also hacky and somewhat obfuscated. The problem really stems from how tightly entangled packages are to the nixpkgs source tree. Nix offers the most foundationally modular system possible, and it organizes its packages in a monolithic source tree! This means that despite installed packages being totally isolated in the /nix/store/, the package source (what Nix calls a "derivation") is semantically tied to whatever specific dependency version was implemented in the contemporary nixpkgs source. If you want to provide users more than one version of a package inside the same source tree, you must put the version in the name, like SDL2 or python3.11. I started this GitHub issue a long time ago: https://github.com/NixOS/nixpkgs/issues/93327 https://github.com/NixOS/nixpkgs/issues/93327. Somewhere buried inside may lie the answer to your question. Either way, I have mostly given up on wrapping my head around the current ecosystem of half-baked solutions to this mess; despite still actively using NixOS in ignorance.
- Chris_Newton 2y agoHave you come across Nix Package Versions¹ yet? If you’re looking to work around a recent bug or other unwanted change by installing a slightly older version of some package from nixpkgs, Marcelo Lazaroni built a nice page to help with that and wrote up an explanation² of how it works. This only works for versions of your package that do exist in nixpkgs but aren’t currently the default for your chosen channel, so it doesn’t help if your channel is out of date and you want to install a newer version that hasn’t been packaged yet. But then that’s the case in almost any Linux distro if you rely on installing your software from the distro’s native package repo, and much the same solutions exist in NixOS as in other distros. Although if you’re really determined, you can also start writing your own derivations to automate building the latest versions of your favourite applications before they’re available from nixpkgs… ¹ https://lazamar.co.uk/nix-versions/ https://lazamar.co.uk/nix-versions/ ² https://lazamar.github.io/download-specific-package-version-with-nix/ https://lazamar.github.io/download-specific-package-version-...
- sunshine-o 2y agoI really like Nix but recently I ended up in a very tricky situation: If you you are cut from the internet or end up with a very slow connection you can end up totally blocked. As a minor configuration change can require you to download a lot of data. I also found out there is not much you can do to protect you from this.
- Cyph0n 2y agoIf you’re using flakes, this is minimized, as long as you don’t cleanup (GC) your Nix store and don’t update your lock file.
- sunshine-o 2y agoYes but the problem is the underlying complexity of modern systems. Actually kudos to NixOS for hiding it very well from you. My system is fully configured with flakes and in practice the smallest change in configuration can trigger the need for connectivity, usually to download a new dependency. I mean if you have VMs in the cloud, who cares. If you have a laptop or a small network that require to be fully operational even if connectivity is lost, think about it twice.
- bsimpson 2y agoEasy keyboard access is also a baked in assumption. I found my way to Nix because I wanted to try SteamOS on nicer hardware than the Steam Deck. Bazzite is the recommendation in that space now, but at the time, there were a lot of equally unknown options. There's a community called Jovian that has replicated the SteamOS setup atop NixOS, using Valve's own sources. Using official sources and taking the chance to learn a new functional programming language seemed like as good a place to start as any. When it works, it's great; however, +1 to all the gripes. _Everything_ in Nix is set by writing to a text file and calling a CLI to rebuild. If you don't have ready access to a keyboard, you might not be able to so much as change the timezone. You can end up on obsolete versions of evergreen software like Chrome too, because Nix wants to own everything, and nothing changes until you rebuild.
- 2y ago
- emarthinsen 2y agoI use NixOS as my daily driver. I concur. I wouldn't recommend it for most people (even for me, when I decided to give it a try). I'd probably just go Arch if I were to do it over again. The concept behind Nix/NixOS is amazing, but it needs to be polished. Flakes are the future, but they are languishing in this experimental status. Even simple things like installing packages from stable and unstable channels are too hard to figure out. The documentation is terse and the community answers are often not enlightening. A big complaint of mine is that the builds should be reproducible, but I find I sometimes need to run `nixos-rebuild switch` several times to get a successful build. The error messages mysteriously resolve themselves. For me, this doesn't pass the bar for being considered reproducible. Don't get me started on using an NVIDIA graphics card also. Granted, part of my difficulties is that I was running Wayland, which doesn't have the best NVIDIA support, but I felt like I was just doing an exhaustive search through the potential config settings to see what worked. Ultimately, I found just the right combination of settings to get everything working buttery smooth. I ripped out the NVIDIA card and put an AMD card in.
- amelius 2y agoI'm on an NVIDIA Jetson, so I guess I'll just have to wait before this stuff becomes practically usable for me ...
- Philpax 2y agoMy experience has been in complete agreement with yours: I love the theory, but the practice is so, so painful. And yes, I also had to settle for your NVIDIA fix. I suspect I would have had a marginally better time on Arch as there are more people beating their heads against it and documenting how they made it work. NixOS documentation is piss-poor in comparison.
- SuperSandro2000 2y agoMost people don't realize that you can read the arch wiki and put the same settings into the nixos options. Where is the point in replicating that all again?
- Cyph0n 2y agoI generally agree. Nix is an excellent build tool. I use it for all of my projects now. And when building is tricky, e.g. Elixir, I rely on Nix devshells to get my tools setup. NixOS is an amazing server distro. My primary home server VM is running NixOS and it has been rock solid and easy to maintain. I plan to run NixOS exclusively as I add more machines. But I haven’t had a good experience with NixOS on my development VM (as compared to Ubuntu or Debian). You end up spending more work than expected up front just to get something working. One recent frustrating experience was trying to get VS Code Server to run on NixOS so that I could connect to it over SSH. Ultimately I just gave up.
- moonlit1 2y ago(Declarative rclone https://github.com/nix-community/home-manager/pull/6101 https://github.com/nix-community/home-manager/pull/6101)
- jonotime 2y agoNeat. Thanks.
- kerkeslager 2y agoWhenever I see "declarative" these days, I get suspicious. See what people are promising when they say "declarative" is a dream. You just tell the computer the final state you want, and the language does what it needs to do to get there. The problem here, is that in order for that to work, the language has to know how to get where you want it to go, and give you vocabulary to tell it that. That "how to get there" and "vocabulary" has to be written in a (gasp!) general-purpose language. So now, you come across a situation where you need the declarative language to do something it doesn't know how to do. So now you're forced into the position of helping create the declarative language. And as it turns out, creating a declarative language in a general-purpose language is a lot harder than just using a general-purpose language to tell the computer how to go where you need it to go in the first place, because you have to delve into an existing codebase which is inevitably giant. I've begun to refer to this anti-pattern as "Configuration-Oriented Programming" (COP). I'm being a little facetious here--I've not looked into Nix enough to have any educated opinions on it. But it sounds like my outsider impression that Nix is a COP might not have been too far off.
- sweetsocks21 2y agoI will say I really love the outcome of a Nix development environment. Especially with nix-direnv having a reproducible build environment by doing git clone on any machine is amazing. NixOS has also saved my ass a couple times doing kernel updates on an old laptop, rollbacks are nice. Having consistent commands "nix build"/"nix run" is great. It's a universal build system that works across different technology stacks. Pain to setup, but bliss when it's working. The bad part is the impenetrable errors and obscure configuration. Although, with the rise of LLMs I find it's not as bad. Getting a non-trivial flake.nix setup is much easier now. Could never remember the override system before, but can manage with Chat GPT haha.
- davidee 2y agoI've tried Nix on a couple of occasions, most recently about two months ago, and ended up coming to the conclusion that it's just not for me. I can see the value in a completely declarative configuration for my OS. But the hurdles to get something worthwhile out of that value prop are just too high with my (low) level of skill (in this area) coupled with the limited time I have to build new skills. There are other things I want to invest my time in, but I can totally see this being where someone wants to spend some of their time. I've never found setting up a Linux distro the way I want it particularly hard and once in a while I like to just start from a blank slate to see what's new—so yeah, not for me.
- Havoc 2y agoIm temporarily keeping nix on single use machines and lxc. Eg places that are just a docker host etc. for that and cicd uses cases it should be fine. The multitude of ways things can be configured spooked me a bit for desktop use though.
- SuperSandro2000 2y agoI've used Debian for 3 years and all the problems I had with it and that are now solved with NixOS and replaced with a complete new set of problems I could only dream in my wettest dreams on Debian. Only going back over woodwork to Debian.
- Cloudef 2y agoNix has been a godsend at dealing with different dev environments and (cross-)compiling complicated software stacks. When you write a proper nix derivation that runs inside a nix sandbox it does not matter where you run it, you'll have high guarantee it replicates the result for you anywhere.
- choobacker 2y agoI'm a NixOS user and contributor. This post is fair. Nix is very flexible, and it hasn't yet stabilised on a firm set of recommendations for a happy path. Going on a whim: * Use nixos-unstable. It's defacto stable, and gets much more attention than nixos-stable. * Use flakes. * Don't use multiple versions of nixpkgs. In the rare case a package is failing to build, then raise an issue, or wait, or rollback. * On NixOS, don't use user profiles. They won't interop in the way OP hopes. * Only use nixpkgs. If you absolutely must use another flake, only use popular ones from https://github.com/nix-community https://github.com/nix-community. But until the community give opinionated suggestions, users will stray towards bad practices. (Also, no need to mix pipewire and jack. Pipewire can emulate jack.)
- indrora 2y agoI attended NixconfNA last year as part of SCaLE. I spent quite a while trying to understand what Nix was actually trying to accomplish and how one would actually go about using it. Granted I was trying to do it on a Chromebook, but the idea stands: I should be able to get at least the nix environment set up and the silly gnu hello world built and running, right? Turns out nah. The ergonomics are just that of a hiltless double bladed sword. I'm glad I'm not the only one, but i also was aware of pushcx trying years ago and still failing [1] and he's a smart dude unlike me. I didn't feel so dumb. [1] https://push.cx/nixos https://push.cx/nixos
- choobacker 2y agoYes, the ergonomics are poor. I endure them for the results, but the ergonomics should be better. Guix has better ergonomics, but it's own set of downsides. I expect the underlying idea of holistic declarative systems is sound, and we're awaiting a polished alternative. Maybe it'll reuse nixpkgs under the hood , but replace the name, the tooling, and the language exposed to the user.
- indrora 2y agoI honestly wish PKGBUILD would get a shout at some point in the world of "Not the worst way to describe a package"
- dminik 2y agoYeah, same. I originally had a very positive nix experience. I had to fix some docker build issue at work. This particular dockefile needed the buildx command. Except for whatever reason I just couldn't install the needed component for buildx to work. Somewhere during a messy Ubuntu 18.04 to 22.04 upgrade something broke and now I was getting a conflict (with nothing btw, it's just empty). I used nix to install docker and the required component with no hassle and was able to get on with my work. Inspired by this experience I wanted to evaluate nix for a more long-term usage. I setup my personal PC to dualboot windows and nixos. The trouble started basically immediately. I couldn't get KDE plasma 6 to work with Wayland. It turns out that you need to also enable Wayland support in sddm. Why the official installer did not do this or why this was only documented on some random unrelated page in one of the two wikis I couldn't tell. Ok, video working I immediately spotted another problem. I set up my disk encryption, login and kde wallet passwords to match in the hopes that on boot I will only have to enter it once (this is an option you can enable). Login screen worked, but kwallet just wouldn't log in automatically. I spent literal hours on this over the past year each time walking away frustrated. Is this a nix issue, Linux issue or kwallet issue? Who knows. Eventually I just set an empty password for kwallet. This still didn't solve my git ssh keys not loading automatically. I just gave up. Most importantly, dev environments just do not want to work with VSCode. The recommended extension stopped working years ago, the other extension still works but there's no way to force a specific load order so randomly other extensions will just not see your nix env. I had to resort to installing rust globally just so I could get rust analyzer working. So much for dev environments. I don't even want to go over how much working with package managers when using nix for building sucks (particularly npm/pnpm/yarn). If I had installed nix on a work laptop they would have fired me for wasting time. Next time I'm trying one of the immutable config driven distros. Hopefully that is going to work better.
- mkhalil 2y agoMy journey with NixOS is as follows: 1) great and useful for development work. (I use NixOS inside WSL) 2) but for your general Desktop environment, I'd say it's only great and useful if you find "tooling" fun/as a hobby (i.e. the type of person who keeps their dot-files updated in a git-repo [although, you won't need dot-files anymore :)] I would say the biggest negative is that it seems the development of it is disjointed, as there are almost too many ways to do the same thing; some things are being deprecated before the documentation even keeps up with development. --- personal notes: --- Also, some things are finicky and require some understanding to get to work (e.g. getting VSCode (on Windows) working with language analyzers and code sitting inside a WSL NixOS distro) - I love Flakes but don't really love home-manager; I can understand home-manager being useful if your using Nix and not NixOS. - My NixOS rules pretty simple: 1) A per-project flake.nix + direnv file (or an env playground) 2) Configuring "etc/nixos/configuration.nix" for global tools like "wget, git, etc." (don't get me started with programs.<program_name>.enabled, see above for "too many ways to do the same thing")
- hamandcheese 2y ago> don't get me started with programs.<program_name>.enabled, see above for "too many ways to do the same thing" programs.<program_name>.enabled implies that there is some system configuration needed in order for the program to function (or in home manager, the analog would be user configuration in your home directory). Whereas environment.systemPackages simply puts bins on your path.
- megaloblasto 2y agoI love nix. I use nixos with flakes, syncthing and direnv. My directories are development environments. My projects are reproducible and portable to different architectures. I don't use the language specific package managers, I have one that can bind them all. Nothing is lost in a tangled mess of imperative configuration choices. My file system is clean and organized. Everything is how I told it to be. I am happy.
- ParticlesRWaves 2y agoI recently tried NixOS 24.11 but quickly decided it’s not for me or something I’d recommend. While the system initially seemed promising, it was frustrating in practice. My first hurdle was configuring the network in configuration.nix. The installed template implies network settings go there, but that’s misleading. Worse, "nixos-rebuild switch" requires a working network, so a broken config leaves the system unable to fix itself – a catch-22. Next, I tried "nix search wget", as suggested in the manual, but hit errors about missing experimental features. I had to enable both nix-command and flakes manually to get this to work: nix --extra-experimental-features nix-command --extra-experimental-features flakes search nixpkgs wget Even then, package search, like configuration, seems to depend on a network connection, which feels unnecessarily fragile. (edit: formatting)
- craftkiller 2y ago> "nixos-rebuild switch" requires a working network, so a broken config leaves the system unable to fix itself – a catch-22 I just ran into this on an airplane! I'm relatively new to nixos (~4 weeks in) and I had configured my laptop to use DNS over TLS and DNSSEC, which is normally not a problem. But to get through those login gateways for the wifi, you need to disable all of that so they can MitM your DNS requests. "Thats no problem, everything is already in my nix store so I should be able to comment out those lines and run a nixos-rebuild" I thought to myself, but alas I was wrong. I'm sure I could have worked through it with enough persistence but it was a short enough flight that I decided to just wait until I landed to continue my otherwise wonderful journey into the nix.
- kytazo 2y agoJust happened to notice how the author contradicts himself by stating "I love to distro hop" but later in the article "I don't just like to distro hop". A good article nonetheless.
- nullbyte808 2y agoId argure on the desktop its actually easier in some ways. Once you know how to make a configuration.nix and partition a drive its a piece of cake to install a system. Changing an entire DE with one line of code is crazy. Its like going from Windows XP to Windows 11 with a one line change and rebooting.
- 3836293648 2y agoEven crazier, changing a line of code and logging out and back in
- mrbluecoat 2y agoAgree with OP. Here are some of my personal observations: https://mrbluecoat.blogspot.com/2024/11/growing-pains-with-nix.html https://mrbluecoat.blogspot.com/2024/11/growing-pains-with-n...
- ameixaseca 2y agoI've used too many Linux distributions to list here, last one before NixOS being Arch. No disto ever came close to giving me what NixOS gives: - I can try to rebuild my system as many times as I want and it doesn't matter if it fails, as long as I get one to succeed I can switch to it; - Once I get the system the way I want, I can reproduce the same setup with a single command across a number of different machines; - I can reuse different parts of the config with different machines and update things incrementally, revision, etc, and every time I improve my shared config on one machine, the improvements are automatically transferred to the other machines upon gir-pull and rebuild. I've now transfered most of my previous configuration to Nix, and not only that but I have tons of services I never bothered configuring on all machines enabled since it was all this trouble of moving configs back and forth. I've got my share of issues with Nix, from trying to use submodules with Flakes (nixos-install does not work with it) to tons of headaches when trying to play with specializations - most of the time issues were caused by not understanding how the evaluation works or how to properly abstracting modules - but I cannot imagine myself going back to a regular Linux distribution ever again.
- gunian 2y agofor the nix experts wouldn't a microVM like firecracker be a better alternative? that way there is a clear boundary between language and system dependencies i tried looking into nix but felt very weird having python and flask as the same thing am i just heing irrational?
- perryizgr8 2y agoI've read a few articles about nix and I'm still unsure what it is and why would anyone use it. From their homepage: > Declarative builds and deployments. > Nix is a tool that takes a unique approach to package management and system configuration. Learn how to make reproducible, declarative and reliable systems. So is it some kind of CI/CD system? A package manager? But people seem to be running it as an OS? Why would I want to declaratively build my OS? Why not just use one of the hundreds of distros already available with lots of packages to pick and choose? The install nix link on the home page seems to indicate I can install it inside linux. Does that mean nix is not a distro itself? Oh but further below there is a disk image too. Huh... Its all very confusing to me. And that triangular image every single nix related articles uses is no help.