TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Nix – Death by a Thousand Cuts

348 点作者 jonotime4 个月前

53 条评论

Baeocystin4 个月前
The 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".
评论 #42704575 未加载
评论 #42703728 未加载
评论 #42704419 未加载
评论 #42705573 未加载
评论 #42705863 未加载
评论 #42708306 未加载
评论 #42705722 未加载
评论 #42704935 未加载
评论 #42704360 未加载
tombert4 个月前
I love NixOS, it&#x27;s my daily driver on my personal laptop, but it definitely has given me more than its fair share of headaches.<p>If everything you&#x27;re going to do is in Nixpkgs, great! Nix will mostly &quot;Just Work&quot; and you&#x27;ll get all the nice declarative goodness that you want. Since Nixpkgs is constantly getting updated, this isn&#x27;t that weird of a thing.<p>The thing that&#x27;s been most annoying to me is when I try and run generic Linux programs, only to be unceremoniously told &quot;You can&#x27;t run generic Linux programs in NixOS because we break dynamic linking&quot;. 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&#x27;t really <i>want</i> to know how to make my own Nix package, and I don&#x27;t really <i>want</i> to be stuck maintaining one now, but this is just part of Nix.<p>This means that it&#x27;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.<p>To be clear, there&#x27;s a lot of stuff I really like, I don&#x27;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&#x27;s a little less impressive for desktop.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nixpkgs&#x2F;pull&#x2F;366367">https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nixpkgs&#x2F;pull&#x2F;366367</a>
评论 #42704192 未加载
评论 #42704900 未加载
评论 #42708925 未加载
评论 #42706297 未加载
评论 #42704315 未加载
_huayra_4 个月前
I&#x27;ve been on the fence about Nix. I&#x27;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&#x27;ve seen pop up about the community, I still haven&#x27;t switched.<p>I&#x27;m no language expert, but I genuinely don&#x27;t understand why it wouldn&#x27;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.<p>I&#x27;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&#x27;m a bit split about what to move to next (though my &gt;5 year Tumbleweed install on most of my machines is holding up no problem).<p>[0] <a href="https:&#x2F;&#x2F;universal-blue.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;universal-blue.org&#x2F;</a>
评论 #42703381 未加载
评论 #42704811 未加载
评论 #42706433 未加载
choobacker4 个月前
I&#x27;m a NixOS user and contributor.<p>This post is fair.<p>Nix is very flexible, and it hasn&#x27;t yet stabilised on a firm set of recommendations for a happy path.<p>Going on a whim:<p>* Use nixos-unstable. It&#x27;s defacto stable, and gets much more attention than nixos-stable.<p>* Use flakes.<p>* Don&#x27;t use multiple versions of nixpkgs. In the rare case a package is failing to build, then raise an issue, or wait, or rollback.<p>* On NixOS, don&#x27;t use user profiles. They won&#x27;t interop in the way OP hopes.<p>* Only use nixpkgs. If you absolutely must use another flake, only use popular ones from <a href="https:&#x2F;&#x2F;github.com&#x2F;nix-community">https:&#x2F;&#x2F;github.com&#x2F;nix-community</a>.<p>But until the community give opinionated suggestions, users will stray towards bad practices.<p>(Also, no need to mix pipewire and jack. Pipewire can emulate jack.)
评论 #42748935 未加载
评论 #42718847 未加载
rowanG0774 个月前
Nix 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&#x27;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.<p>The biggest drawback is really that &quot;random executable from the internet&quot; 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.
评论 #42670449 未加载
评论 #42672189 未加载
评论 #42743376 未加载
emarthinsen4 个月前
I use NixOS as my daily driver. I concur. I wouldn&#x27;t recommend it for most people (even for me, when I decided to give it a try). I&#x27;d probably just go Arch if I were to do it over again.<p>The concept behind Nix&#x2F;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.<p>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&#x27;t pass the bar for being considered reproducible.<p>Don&#x27;t get me started on using an NVIDIA graphics card also. Granted, part of my difficulties is that I was running Wayland, which doesn&#x27;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.
评论 #42706288 未加载
评论 #42707286 未加载
评论 #42705941 未加载
评论 #42705259 未加载
ChocolateGod4 个月前
I use NixOS, one of the annoying things to me is the documentation and error reports.<p>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.<p>I looked at documentation recently to try and enable PGO&#x2F;LTO and Zen 3 optimizations (don&#x27;t mind compiling everything) and I think I saw at least 10 ways and none worked (gcc errors, etc).
评论 #42701889 未加载
评论 #42702516 未加载
评论 #42702268 未加载
craftkiller4 个月前
&gt; ZFS on Linux [...] The recommended way to do this is to use LUKS, not native ZFS encryption.<p>FWIW I&#x27;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&#x27;ll be able to do encrypted zfs send&#x2F;recv, you&#x27;ll have granular control over which datasets are encrypted (or encrypted with different passwords), you&#x27;d get cross-platform support for the encryption (for example, my FreeBSD home server can receive and decrypt my laptop backups), and you aren&#x27;t adding another layer of complexity.
评论 #42697469 未加载
评论 #42732962 未加载
RestartKernel4 个月前
Trying to get Eduroam working soured me on NixOS as a desktop&#x2F;laptop OS. If conventional methods fail, you&#x27;re left with a completely non-standard OS designed to prevent quick hacks.<p>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.
评论 #42743415 未加载
评论 #42702135 未加载
评论 #42704630 未加载
bfrog4 个月前
I love the ideas behind Nix. But as noted here, there&#x27;s a thousand cuts to be found.<p>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...<p>None of that Just Works, there&#x27;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.<p>If something like Nix were to be done again... I&#x27;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&#x27;s downsides, but the upsides are that... you don&#x27;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&#x27;t be that terrible to have a crates.io equivalent to publish, test, and share flakes.<p>Now I think I might&#x27;ve just created flakehub... but flakehub still relies on nix the tool and nix the language which are far from easy to work with.
评论 #42706345 未加载
Havoc4 个月前
I found getting started quite easy.<p>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
评论 #42704967 未加载
评论 #42702377 未加载
jcmfernandes4 个月前
I&#x27;m relatively new to nix, and this cut close:<p>&gt; 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.<p>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&#x27;t like that nixpkgs serves as both a lib and a package set. Be one! I don&#x27;t want &quot;special&quot; inputs in my config.
评论 #42710336 未加载
James_K4 个月前
I only wish Guix had a more robust nonfree packages I think it could really give Nix a run for its money.
评论 #42704627 未加载
评论 #42706361 未加载
lilyball4 个月前
&gt; <i>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.</i><p>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).<p>I&#x27;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).
评论 #42706071 未加载
dandanua4 个月前
Desktop NixOS is my daily driver for almost 3 years. I don&#x27;t bother diving into deep technicalities, flakes or other complicated stuff. I define programs and settings that I need in the configuration.nix. That&#x27;s all. And it works perfectly!<p>For complicated stuff I run containers such as docker or podman (you could use distrobox too), so I don&#x27;t have a headache while trying to achieve it in NixOS (but I respect everyone who does this and makes this system grow).
ris4 个月前
I think this is quite a fair commentry (although I quite like the Nix language personally) - as a nixpkgs developer even I don&#x27;t use NixOS on the desktop. For me it shines on servers and development environments.
评论 #42673855 未加载
评论 #42702126 未加载
edude034 个月前
Nix has been my daily driver for about 10 years, all 10 on servers, and about 3&#x2F;4 on a laptop.<p>The thing that hits close to home for me, is the inability to use software that doesn&#x27;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&#x27;t packaged for nix means writing a nix derivation.<p>That said, I feel like nix does more good than harm for me so the paper cuts are bearable.<p>[0]: <a href="https:&#x2F;&#x2F;community.roonlabs.com&#x2F;t&#x2F;unable-to-get-roon-to-start-on-nix-linux&#x2F;20923" rel="nofollow">https:&#x2F;&#x2F;community.roonlabs.com&#x2F;t&#x2F;unable-to-get-roon-to-start...</a>
sigmonsays4 个月前
i use nixos on VMs, my desktop (Gaming and productivity) and servers. I use flakes for everything.<p>I&#x27;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&#x27;s incredibly annoying to update a box and have it drop offline. My work around is to do a &#x27;diff&#x27; and when systemd is updated, I reboot manually and only update the boot image.
评论 #42702257 未加载
评论 #42705628 未加载
评论 #42706368 未加载
评论 #42705725 未加载
评论 #42703668 未加载
ameixaseca4 个月前
I&#x27;ve used too many Linux distributions to list here, last one before NixOS being Arch.<p>No disto ever came close to giving me what NixOS gives:<p>- I can try to rebuild my system as many times as I want and it doesn&#x27;t matter if it fails, as long as I get one to succeed I can switch to it;<p>- 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;<p>- 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.<p>I&#x27;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.<p>I&#x27;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.
yoyohello134 个月前
I courted making the switch to NixOS a couple times, but I just don&#x27;t really see the value add to me right now. Yes, if you have a lot of machines then it maybe make sense.<p>At this point I just use Nix home manager for my dotfiles&#x2F;userspace programs on a normal distro and I feel like I get 90% of the benefit without any of the headaches.
评论 #42703832 未加载
评论 #42702454 未加载
评论 #42706377 未加载
sunshine-o4 个月前
I really like Nix but recently I ended up in a very tricky situation:<p>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.<p>I also found out there is not much you can do to protect you from this.
评论 #42707118 未加载
评论 #42705409 未加载
sweetsocks214 个月前
I 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 &quot;nix build&quot;&#x2F;&quot;nix run&quot; is great. It&#x27;s a universal build system that works across different technology stacks. Pain to setup, but bliss when it&#x27;s working.<p>The bad part is the impenetrable errors and obscure configuration. Although, with the rise of LLMs I find it&#x27;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.
Cyph0n4 个月前
I generally agree.<p>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.<p>NixOS is an amazing <i>server</i> 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.<p>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.
captainepoch4 个月前
&gt; 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.<p>It did, and thanks to that rollback feature, my system was working in a few minutes.
mkhalil4 个月前
My 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&#x27;d say it&#x27;s only great and useful if you find &quot;tooling&quot; fun&#x2F;as a hobby (i.e. the type of person who keeps their dot-files updated in a git-repo [although, you won&#x27;t need dot-files anymore :)]<p>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.<p>--- 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)<p>- I love Flakes but don&#x27;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 &quot;etc&#x2F;nixos&#x2F;configuration.nix&quot; for global tools like &quot;wget, git, etc.&quot; (don&#x27;t get me started with programs.&lt;program_name&gt;.enabled, see above for &quot;too many ways to do the same thing&quot;)
评论 #42710049 未加载
megaloblasto4 个月前
I 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&#x27;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.
nunez4 个月前
I&#x27;d like more clarity on this:<p>&gt; 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.<p>as the whole purpose of the Dockerfile is to create a reproducible environment.
评论 #42704154 未加载
评论 #42674560 未加载
评论 #42702166 未加载
评论 #42674436 未加载
评论 #42675680 未加载
评论 #42704150 未加载
评论 #42702368 未加载
mrbluecoat4 个月前
Agree with OP. Here are some of my personal observations: <a href="https:&#x2F;&#x2F;mrbluecoat.blogspot.com&#x2F;2024&#x2F;11&#x2F;growing-pains-with-nix.html" rel="nofollow">https:&#x2F;&#x2F;mrbluecoat.blogspot.com&#x2F;2024&#x2F;11&#x2F;growing-pains-with-n...</a>
ParticlesRWaves4 个月前
I 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.<p>My first hurdle was configuring the network in configuration.nix. The installed template implies network settings go there, but that’s misleading. Worse, &quot;nixos-rebuild switch&quot; requires a working network, so a broken config leaves the system unable to fix itself – a catch-22.<p>Next, I tried &quot;nix search wget&quot;, 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:<p><pre><code> nix --extra-experimental-features nix-command --extra-experimental-features flakes search nixpkgs wget </code></pre> Even then, package search, like configuration, seems to depend on a network connection, which feels unnecessarily fragile.<p>(edit: formatting)
评论 #42712294 未加载
davidee4 个月前
I&#x27;ve tried Nix on a couple of occasions, most recently about two months ago, and ended up coming to the conclusion that it&#x27;s just not for me.<p>I can see the value in a completely declarative configuration for my OS.<p>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.<p>I&#x27;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&#x27;s new—so yeah, not for me.
moonlit14 个月前
(Declarative rclone <a href="https:&#x2F;&#x2F;github.com&#x2F;nix-community&#x2F;home-manager&#x2F;pull&#x2F;6101">https:&#x2F;&#x2F;github.com&#x2F;nix-community&#x2F;home-manager&#x2F;pull&#x2F;6101</a>)
评论 #42719350 未加载
zie4 个月前
So a server that&#x27;s dedicated to well-supported(by nixos) services running NixOS is awesome. it&#x27;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 <i>need</i> the latest and greatest release of something, it maybe isn&#x27;t worth the hassle.<p>Trying to hack on other people&#x27;s junk with NixOS is just asking for pain. Just use Ubuntu LTS like everyone else. That&#x27;s generally easy and painless.
评论 #42702997 未加载
评论 #42704717 未加载
评论 #42706388 未加载
grep_name4 个月前
I&#x27;ve been using nixOS on my laptop for over a year now and I still don&#x27;t have an answer for &#x27;my version of firefox&#x2F;darktable has a bug in it, but I can&#x27;t update it without upgrading the entire rest of all the software installed on my machine.&#x27; I keep thinking there has to be a way around this, but it doesn&#x27;t seem like there is one that&#x27;s clean and not hacky &#x2F; brittle. Other than that I love it, but that&#x27;s a pretty huge caveat
评论 #42705098 未加载
评论 #42705648 未加载
leonewton2534 个月前
Id 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.
评论 #42729755 未加载
ssalka4 个月前
Just want to flag that the first image likening Nix to the Holy Trinity has a spelling error in the text &quot;The Operating Systam&quot;.
评论 #42706089 未加载
perryizgr84 个月前
I&#x27;ve read a few articles about nix and I&#x27;m still unsure what it is and why would anyone use it.<p>From their homepage:<p>&gt; Declarative builds and deployments.<p>&gt; Nix is a tool that takes a unique approach to package management and system configuration. Learn how to make reproducible, declarative and reliable systems.<p>So is it some kind of CI&#x2F;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?<p>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...<p>Its all very confusing to me. And that triangular image every single nix related articles uses is no help.
Cloudef4 个月前
Nix 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&#x27;ll have high guarantee it replicates the result for you anywhere.
unstruktured4 个月前
I don&#x27;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.<p>He did find functional programming to be sort of mystic so I don&#x27;t know if I trust his take on assesing the nix language itself.<p>TLDR; just stick with ubuntu or arch unless you feel like experimenting
评论 #42671688 未加载
nunez4 个月前
My setup is a smorgasbord of dotfiles and symlinks. It&#x27;s been built up over 13 years, so it&#x27;s very well seasoned and has served me well, but I&#x27;ve long been meaning to move to Nix to make my setup cleaner. The bad in this article isn&#x27;t that bad, so now I&#x27;m amped even more to do this!
anirrudh4 个月前
I&#x27;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&#x27;ve learned so much. I&#x27;ve been very happy with it -- I run a windows VM with libvirt&#x2F;KVM&#x2F;QEMU when I want to game, and use the same to run &quot;local&quot; LLMs. While docker is a great technology, I actually prefer using nixOS containers (which are, under the hood, systemd-nspawn containers).<p>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.<p>For me, nix is a wonderful and perfect solution for building stable software.
mcpar-land4 个月前
for me there are two kinds of pain in software troubleshooting:<p>1) I Don&#x27;t Know The State: there&#x27;s some weird little bit of state hanging around somewhere I don&#x27;t know about that&#x27;s messing with my end result. Once I learn about this state, correcting it is trivial.<p>I hate this kind of problem solving, it&#x27;s not mentally stimulating, I don&#x27;t learn a lot, looking up answers online is often not helpful. And when I fix it, I don&#x27;t gain a lot beyond just the problem not happening anymore. (examples: secret config file i didn&#x27;t know about, an application edited its own config, file permissions were wrong, symlink was wrong, cache is invalid, etc.)<p>2) I Don&#x27;t Understand The Concept: the idea of what something is supposed to do or why hasn&#x27;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.<p>I _love_ this kind of problem solving. It&#x27;s mentally stimulating, it builds on itself, increases mastery, problems are easily found &#x2F; troubleshot online because people are dealing with similar issues and not their own machine&#x27;s personal state.<p>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&#x27;s easy and it&#x27;ll always be easy.<p>I think this is why Nix has been able to &quot;get away with&quot; having the abysmal, fragmented documentation that it has for so long - it&#x27;s so good at being a near-stateless, all-encompassing declarative configuration that even outdated blog posts, random people&#x27;s personal configs on github, even the nixpkgs source code can be helpful enough to solve your problem (and that&#x27;s often all you have to go on!!!)
SuperSandro20004 个月前
I&#x27;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.
aidenn04 个月前
Anybody know what author is talking about with gnome and plasma not being allowed in the same configuration? I don&#x27;t currently have both configured, but I ran this way from somewhere in the neighborhood of 20.09 to 23.05 with no difficulties.
Havoc4 个月前
Im 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.<p>The multitude of ways things can be configured spooked me a bit for desktop use though.
kytazo4 个月前
Just happened to notice how the author contradicts himself by stating &quot;I love to distro hop&quot; but later in the article &quot;I don&#x27;t just like to distro hop&quot;.<p>A good article nonetheless.
FrostKiwi4 个月前
Have my server infrastructure on NixOS. Huge boost in productivity and stability, would never go back to standard linux. But man if something breaks it&#x27;s a nuke going off. Sry for the long post, but thought I share my experience:<p>Mass storage on a big encrypted RaidZ array of spinning rust, no issues. Bootloader, &#x2F;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].<p>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&#x27;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.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;openzfs-docs&#x2F;blob&#x2F;1211e98faf1f37af1de5eb8f3ce0a1c87f71a0e6&#x2F;docs&#x2F;Getting%20Started&#x2F;NixOS&#x2F;Root%20on%20ZFS&#x2F;1-preparation.rst">https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;openzfs-docs&#x2F;blob&#x2F;1211e98faf1f37a...</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;openzfs-docs&#x2F;commit&#x2F;1211e98faf1f37af1de5eb8f3ce0a1c87f71a0e6">https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;openzfs-docs&#x2F;commit&#x2F;1211e98faf1f3...</a><p>[3] <a href="https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;openzfs-docs&#x2F;commit&#x2F;4fb5fb694f44c81639d28c1b73fce2093e7ccac4">https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;openzfs-docs&#x2F;commit&#x2F;4fb5fb694f44c...</a><p>[4] <a href="https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nixpkgs&#x2F;issues&#x2F;214871">https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nixpkgs&#x2F;issues&#x2F;214871</a><p>[5] <a href="https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;openzfs-docs&#x2F;issues&#x2F;531">https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;openzfs-docs&#x2F;issues&#x2F;531</a><p>[6] <a href="https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;openzfs-docs&#x2F;issues&#x2F;531#issuecomment-2430689864">https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;openzfs-docs&#x2F;issues&#x2F;531#issuecomm...</a><p>[7] <a href="https:&#x2F;&#x2F;discord.com&#x2F;channels&#x2F;568306982717751326&#x2F;1328541099672997888&#x2F;1328541099672997888" rel="nofollow">https:&#x2F;&#x2F;discord.com&#x2F;channels&#x2F;568306982717751326&#x2F;132854109967...</a>
评论 #42706214 未加载
jonotime4 个月前
Thoughts on a love&#x2F;hate relationship with Nix on the desktop.
gunian4 个月前
for the nix experts wouldn&#x27;t a microVM like firecracker be a better alternative? that way there is a clear boundary between language and system dependencies<p>i tried looking into nix but felt very weird having python and flask as the same thing am i just heing irrational?
0x4574 个月前
It reads like the author didn&#x27;t even try to understand NixOS.<p>&gt; 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:<p>This whole section reads like author gives ChatGPT code snippets and asks it to explain.<p>Nix snippets are not very copy-pastable because everyone creates different abstractions to reduce boilerplate. I have probably done &quot;JSON -&gt; list of packages&quot; conversion 3 different ways in my codebase.
Brian_K_White4 个月前
Instead of having an OS that might be driven by ansible, let&#x27;s just replace the OS with ansible.
kerkeslager4 个月前
Whenever I see &quot;declarative&quot; these days, I get suspicious.<p>See what people are promising when they say &quot;declarative&quot; 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.<p>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 &quot;how to get there&quot; and &quot;vocabulary&quot; has to be written in a (gasp!) general-purpose language.<p>So now, you come across a situation where you need the declarative language to do something it doesn&#x27;t know how to do. So now you&#x27;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.<p>I&#x27;ve begun to refer to this anti-pattern as &quot;Configuration-Oriented Programming&quot; (COP).<p>I&#x27;m being a little facetious here--I&#x27;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.
dminik4 个月前
Yeah, same.<p>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&#x27;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&#x27;s just empty).<p>I used nix to install docker and the required component with no hassle and was able to get on with my work.<p>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.<p>I couldn&#x27;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&#x27;t tell.<p>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&#x27;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&#x27;t solve my git ssh keys not loading automatically. I just gave up.<p>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&#x27;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&#x27;t even want to go over how much working with package managers when using nix for building sucks (particularly npm&#x2F;pnpm&#x2F;yarn).<p>If I had installed nix on a work laptop they would have fired me for wasting time. Next time I&#x27;m trying one of the immutable config driven distros. Hopefully that is going to work better.
Arnavion4 个月前
I 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.<p>System services have always been able to be configured by dropping files in &#x2F;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 ~&#x2F;.config etc.<p>Package managers vary. Alpine&#x27;s apk is the best in that `&#x2F;etc&#x2F;apk&#x2F;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&#x27;t have dropins. apt and zypper don&#x27;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&#x2F;zypper to diff against that list and install&#x2F;uninstall accordingly. (zypper in particular does maintain a list of packages, except it&#x27;s a list of packages that you *don&#x27;t* install explicitly but are just auto-installed as dependencies of the ones that you did, which is funny to me.)<p>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&#x27;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.<p>The author mentions rebuilding a laptop to do another laptop&#x27;s job by applying the other&#x27;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&#x27;ve added and removed roles occasionally to add&#x2F;remove features from individual devices.<p>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.<p>NixOS would give me a way to install multiple versions of packages, but this is something I&#x27;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).<p>The one time I tried to build someone else&#x27;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&#x27;t build for me, so I&#x27;m not sure how reproducible it really is. But that might&#x27;ve just been a problem for that one project.<p>I&#x27;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&#x27;t have to use a different OS or package manager or bespoke programming language to do that.
评论 #42702262 未加载