TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

We want to make Nix better

223 pointsby biggestlouover 2 years ago

20 comments

Jeayeover 2 years ago
Writing the packaging expressions should not be harder than writing the program, for the average developer. The average developer doesn&#x27;t know FP, at this point. Nix needs:<p>1. Approachability for those not indoctrinated in lazy, declarative, functional programming (i.e. Haskell); nope, Nix Pills are not sufficient for the average dev<p>2. Editor tooling to help guide the writing of expressions (just as anyone learning C# or Rust can use LSP); a better type system for Nix would help here<p>3. Better documentation for practical things like &quot;Using Nix to manage the dependencies and package a C++ program using Meson&quot;, rather than having people piece this together from a bunch of disparate docs<p>4. A much better CLI UX than `nix-env -qa` and the like (this is ongoing and experimental, but even that broke recently, causing lots of confusion; now it requires `nix --extra-experimental-features nix-command --extra-experimental-features flakes search nixpkgs`)<p>5. To seriously answer the question: is the Nix language required for the Nix packaging system to exist? Laziness is required, to some degree, but can the next iteration provide an on-ramp which doesn&#x27;t involve learning a new lang and paradigm? Guix folks sure think so.<p>I feel like Nix folks have been focused so long on solving the tough problems of declarative, deterministic packaging that they haven&#x27;t been able to focus on the UX. I also feel like folks for whom Haskell is comfortable may not realize just how absurd it feels to everyone else. Perhaps like the early days of Git.<p>I do really hope Nix succeeds in this, though; I&#x27;ve been using it, or it&#x27;s been using me, for several years. [1] and [2] for more info.<p>[1]: <a href="https:&#x2F;&#x2F;blog.jeaye.com&#x2F;2015&#x2F;11&#x2F;24&#x2F;nixos&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.jeaye.com&#x2F;2015&#x2F;11&#x2F;24&#x2F;nixos&#x2F;</a><p>[2]: <a href="https:&#x2F;&#x2F;blog.jeaye.com&#x2F;2017&#x2F;07&#x2F;30&#x2F;nixos-revisited&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.jeaye.com&#x2F;2017&#x2F;07&#x2F;30&#x2F;nixos-revisited&#x2F;</a>
评论 #32695004 未加载
评论 #32694377 未加载
评论 #32697284 未加载
评论 #32694111 未加载
评论 #32695091 未加载
评论 #32693991 未加载
评论 #32696593 未加载
评论 #32695371 未加载
评论 #32699710 未加载
评论 #32700097 未加载
评论 #32697728 未加载
评论 #32697716 未加载
评论 #32695624 未加载
grhmcover 2 years ago
With Eelco as a cofounder of DetSys, I feel really excited about where we&#x27;re going here. I think the world is in <i>many</i> ways primed and ready for Nix, as long as we can help Nix &quot;meet them in the middle.&quot;<p>We&#x27;re working on making Nix more accessible and producing good and usable, production-ready workflows so teams can just pick it up and go. I&#x27;d love to hear what y&#x27;all think, to help make sure we&#x27;re going in the right direction.
评论 #32694998 未加载
评论 #32695726 未加载
评论 #32693939 未加载
评论 #32694189 未加载
评论 #32694071 未加载
ridiculous_fishover 2 years ago
I installed nix on my Mac but quickly backed out due to the complexity. I assumed the nix store would just be an ordinary directory with a tool for managing it, similar to brew. I discovered it creates a new Unix group, adds a separate APFS volume, installs a daemon. This was too invasive for a tool I was unsure if I even wanted to use, so I uninstalled it.<p>What is the reason for all this machinery? I went with the recommended multi-user install, should I have just used the single user mode instead?
评论 #32694009 未加载
评论 #32694008 未加载
评论 #32693818 未加载
评论 #32693796 未加载
评论 #32693887 未加载
评论 #32697272 未加载
评论 #32693812 未加载
评论 #32693805 未加载
评论 #32693875 未加载
dd_over 2 years ago
As someone who has been using NixOS for a couple of years now, I really want to say how appreciative I am of everybody for making noticeable improvements to the system on a somewhat regular basis. The nix command keeps on adding great new features like flake templates and bundling as well as just being more user friendly (error messages, actionable hints, etc.) Additionally, tools like nix-ld [1] make nix more usable than ever with software from external sources. Things just keep on getting better for NixOS users!<p>Despite the reputation, I feel that NixOS or some derivative of it has the power to become the best distribution for non-technical users in the long run. What NixOS has done is effectively built an interface to every component of a modern Linux system, all that needs to be built is a user application to take advantage of it. Of course, there still needs be some improvements in Nix itself for it to blossom into its final form, but I really see a path to greatness here.<p>I have often thought about creating a simple unified Win2K-esq or BeOS-like X11 WM&#x2F;DE specifically for NixOS but unfortunately I lack the time&#x2F;motivation.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;Mic92&#x2F;nix-ld" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Mic92&#x2F;nix-ld</a>
评论 #32699219 未加载
oxffover 2 years ago
Make the documentation up to the modern standards. If I have to open a single random blog or Github repository to find out what to do and piece it together like a puzzle - it is impossible to adapt at organizational scale.<p>It is also complex enough to require a modern Language Server.
评论 #32697409 未加载
lykahbover 2 years ago
The name Nix is used for the language, package system, and sometimes the whole ecosystem. There is a recent post that tells the difference <a href="https:&#x2F;&#x2F;www.haskellforall.com&#x2F;2022&#x2F;08&#x2F;stop-calling-everything-nix.html" rel="nofollow">https:&#x2F;&#x2F;www.haskellforall.com&#x2F;2022&#x2F;08&#x2F;stop-calling-everythin...</a><p>Knowing functional programming helps but Nix still is a hard language to learn. I have a lot of Haskell experience but the Nix language was very confusing for me. At first I couldn&#x27;t even tell a variable name from a keyword (it is a convention to call variables &quot;self&quot; and &quot;super&quot; in some contexts). The Nix language has been created for research in build systems and has evolved over a long time, so it has accumulated quite a lot of idiosyncrasies and cruft.<p>I hope that a simpler typed language like <a href="https:&#x2F;&#x2F;github.com&#x2F;tweag&#x2F;nickel" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tweag&#x2F;nickel</a> replaces it.
评论 #32700106 未加载
Arcuruover 2 years ago
Since Eelco (often treated as Nix&#x27;s BDFL) and Graham (also very prominent in the Nix community) are involved hopefully this group will actually be able to make traction on some of these issues. This is not even close to the first of these posts saying &quot;we&#x27;re going to help make Nix more user friendly!&quot;, but maybe this group has a chance of making changes to the Nix ecosystem since they can just approve it themselves.<p>I&#x27;ve had concerns about Nix&#x27;s governance in the past but it sounds like they may be going in the right direction, so I&#x27;m excited to see what they&#x27;re planning.
zuzuleinenover 2 years ago
&quot;But there’s a catch: to make that happen you need to write some Nix, use Nix tools, and probably consult several documentation sources.&quot;<p>You can use bob[1] if you want a build tool which uses Nix to install dependencies in an easy manner: just list the package names for a task and then they will be installed.<p>I&#x27;m looking forward for all the changes in Nix ecosystem and it&#x27;s a good sign the fact that they also started working on an initiative to improve Nix documentation which was spread all over the places.<p>[1] <a href="https:&#x2F;&#x2F;bob.build&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bob.build&#x2F;</a>
评论 #32694064 未加载
评论 #32699257 未加载
评论 #32694187 未加载
mixedCaseover 2 years ago
Hot take as a NixOS user that uses Nix for work: &quot;all&quot; we need is a much better, sound, statically typed language to build better abstractions with.<p>The only hard requirements I can think of are algebraic data types with exhaustive pattern matching to go with, row polymorphism, purity and good inline documentation support.<p>I don&#x27;t know if a good enough hostable language exists or if it should be a new version of Nixlang, but almost every single annoying problem that makes me go &quot;Nix is getting in my way&quot; can be traced back to the lack of a good, powerful type system leading to a house of cards situation whether it comes from nixpkgs or entirely of my own making.
评论 #32695031 未加载
评论 #32694435 未加载
评论 #32698363 未加载
setheronover 2 years ago
Funny enough I introduced Nix to our company which was acquired by Google -- so Google has software leveraging Nix. (I got Google to in fact sponsor Nix which was nice too. A small amount but it was meaningful to me).
ianaiover 2 years ago
I hope this goes the way of RedHat&#x2F;SUSE. i.e. The corporate side of a FOSS project so that contracts can be signed for appropriate purposes, etc.
ontouchstartover 2 years ago
I have more than 20 years of Unix experience and was getting into DevOps and CI&#x2F;CD in the recent years with GitHub Actions, Azure DevOps, AWS etc. I literally discovered Nix yesterday via Andrew Kelley’s Zig demo on YouTube. I had the similar feeling as I first learned Unix tool chains two decades ago.<p>I believe live demo and CI&#x2F;CD pipeline might be some of the best use cases to get people interested in Determinate Systems. Don’t get distracted by language features and syntactic sugars. If it works, people will learn.
评论 #32695690 未加载
anderspitmanover 2 years ago
For the first time in about 8 years an Arch update rendered my OS unbootable last week. I&#x27;d had graphics issues once or twice but this time it just hung in systemd somewhere. Still don&#x27;t know what happened. Rolled all packages back about a month and that worked, but I&#x27;ll need to update eventually.<p>I&#x27;m considering Nix but don&#x27;t like the custom language. I wish Guix were. more popular and less extreme on the freedom side. Chances are I&#x27;ll just do a fresh Arch install or maybe try Debian rolling.<p>These days I like to install almost all software and libraries by hand in my home directory. All I really want is a solid system that basically boots fresh then loads my home directory. Maybe I should do a net boot of some sort?<p>Any other suggestions?
评论 #32705013 未加载
评论 #32695181 未加载
评论 #32751488 未加载
评论 #32695189 未加载
评论 #32699382 未加载
rgoulterover 2 years ago
I agree with the preamble and the &quot;our mission&quot; stuff. I wish them success at bringing the benefits of nix to more users, but without it being limited to enthusiasts, and people who can afford to deal with rough edges.<p>The &quot;external dependencies&quot; thing shows how Nix can be a tough sell to those who don&#x27;t click with it.<p>I&#x27;d say that the other solutions are:<p>- a README which has a bunch of &quot;apt-get install&quot; commands you can copy-paste from,<p>- a &quot;setup.sh&quot; script that installs things,<p>- a container or VM image with the toolchain setup,<p>- or a tool like asdf.<p>IMO, Nix is a much nicer solution than these other options, and has the benefits, avoids the downsides of these (but an entirely different set of downsides).
评论 #32694683 未加载
shiryelover 2 years ago
I love nix, I&#x27;ve been using it for the last 2 years, I have a very stable setup from these 2 years of effort [0], and I just can&#x27;t recommend Nix for Linux beginners, why?<p>It&#x27;s not because of the nix language, It&#x27;s not because of the CLI, it&#x27;s because everything is scattered, you have to consult many places to find out how to do things with Nix, here is an example:<p>Usually, when I need a new complex program, like Steam, I first check the system-wide configuration [1], the wiki [2] and the package list [3], if I just want it on my user, I need to check if Home Manager has an option [4], if it doesn&#x27;t, I can try using the &quot;home.packages&quot; option. Now, if I need to override something on the package, I need to remember how to do it with [5] [6] (while checking the source code for the package in parallel to find the options).<p>And then sometimes, on very rare occasions, I need to fine tune something with the nix language, so I need to check the builtins&#x2F;lib docs [7], but some builtins are not there, so I need to either use nix-doc [8] or find the docs inside the code-bases [9] [10] (they are split between both repos)<p>For me, this is one of the main pain points of using Nix &#x2F; NixOS that needs to be solved.<p>[0] - <a href="https:&#x2F;&#x2F;github.com&#x2F;shiryel&#x2F;nixos-dotfiles" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;shiryel&#x2F;nixos-dotfiles</a><p>[1] - <a href="https:&#x2F;&#x2F;search.nixos.org&#x2F;options" rel="nofollow">https:&#x2F;&#x2F;search.nixos.org&#x2F;options</a><p>[2] - <a href="https:&#x2F;&#x2F;nixos.wiki&#x2F;wiki&#x2F;Steam" rel="nofollow">https:&#x2F;&#x2F;nixos.wiki&#x2F;wiki&#x2F;Steam</a><p>[3] - <a href="https:&#x2F;&#x2F;search.nixos.org&#x2F;packages" rel="nofollow">https:&#x2F;&#x2F;search.nixos.org&#x2F;packages</a><p>[4] - <a href="https:&#x2F;&#x2F;mipmip.github.io&#x2F;home-manager-option-search&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mipmip.github.io&#x2F;home-manager-option-search&#x2F;</a><p>[5] - <a href="https:&#x2F;&#x2F;nixos.org&#x2F;manual&#x2F;nixos&#x2F;stable&#x2F;#sec-customising-packa" rel="nofollow">https:&#x2F;&#x2F;nixos.org&#x2F;manual&#x2F;nixos&#x2F;stable&#x2F;#sec-customising-packa</a>...<p>[6] - <a href="https:&#x2F;&#x2F;nixos.org&#x2F;guides&#x2F;nix-pills&#x2F;nixpkgs-overriding-packag" rel="nofollow">https:&#x2F;&#x2F;nixos.org&#x2F;guides&#x2F;nix-pills&#x2F;nixpkgs-overriding-packag</a>...<p>[7] - <a href="https:&#x2F;&#x2F;teu5us.github.io&#x2F;nix-lib.html" rel="nofollow">https:&#x2F;&#x2F;teu5us.github.io&#x2F;nix-lib.html</a><p>[8] - <a href="https:&#x2F;&#x2F;github.com&#x2F;lf-&#x2F;nix-doc" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lf-&#x2F;nix-doc</a><p>[9] - <a href="https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nix" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nix</a><p>[10] - <a href="https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nixpkgs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nixpkgs</a>
skybrianover 2 years ago
The external dependency problem is somewhat solved in npm (at least, as far as many users are concerned) by writing a module that downloads the appropriate binary.<p>For example, esbuild is written in Go, which is compiled to a different binary for each system. The NPM for esbuild has 21 optional dependencies, one for each binary that it makes available. A post-install script [1] chooses which dependency to install.<p>It seems like a lot of work for the maintainer? But most users don&#x27;t need to care.<p>It probably helps that the Go SDK builds static binaries.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;evanw&#x2F;esbuild&#x2F;blob&#x2F;master&#x2F;lib&#x2F;npm&#x2F;node-install.ts" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;evanw&#x2F;esbuild&#x2F;blob&#x2F;master&#x2F;lib&#x2F;npm&#x2F;node-in...</a>
评论 #32694627 未加载
rrgokover 2 years ago
Beside being invasive on MacOS, as said by @ridiculous_fish, it took me more than 3 hours (and it didn&#x27;t yet finish, I just quit all) to use QMK. I just cloned the Github repository of QMK and did `nix-shell` as they provide shell.nix file.<p>1. Does every nix-shell require building the whole world from ground-up? Seems impractical to me. 2. What is the right approach?<p>This is not to bash Nixpkgs, because I installed NixOS and it took me 10min to install a whole OS with Sway, Neovim and some other tools. I guess I&#x27;m doing something wrong. But, on MacOS, nixpkgs was not a pleasant experience at all.
评论 #32694040 未加载
评论 #32694145 未加载
评论 #32694945 未加载
AprilArcusover 2 years ago
Just let me a pin a single package to a version number, for the love of God.
评论 #32700185 未加载
评论 #32700213 未加载
beermonsterover 2 years ago
Is it Nix or NixOS?
评论 #32695395 未加载
评论 #32700150 未加载
ghowardover 2 years ago
Disclaimer: I&#x27;m working on a build system that will eventually do what Nix does but make it much easier to use.<p>If they do manage to create a system where Nix is hidden, and end users never have to directly touch it, I think this could work and make my work never see the light of day.<p>But I have my doubts that they will be able to do that, and it boils down to one simple reason: declarative is not powerful enough.<p>Don&#x27;t get me wrong, for 90%, possibly more, of use cases, it&#x27;s enough. And it is preferable to keep things declarative as long as possible, so much so that my build system will have a way of restricting itself to purely declarative code when possible (and will error otherwise).<p>However, when more power is necessary, it is <i>required</i>; it is not possible, by the definition of Turing-completeness and declarative, to do the same thing with a declarative language that can be done with a Turing-complete language. So when that power is missing, the only option is to work around it.<p>This is why Nix is really just a front for bash. For all of its faults, at least bash is Turing-complete.<p>But this fact means that there will be things that Nix will fail to do on its own. I suspect this means that the abstraction around Nix will always be leaky. Maybe it won&#x27;t be unacceptably leaky, but I&#x27;m not very hopeful.<p>I think Nix would be better served by doing the following:<p>1. Rewriting the language. This would require an auto-transformer to the new language in order to not throw away the entirety of nixpkgs, but transforming a declarative language to a Turing-complete one is easy.<p>2. Spend gobs of time on user experience. Make the usual commands short, easy to remember, and easy to use with few options. Make usual things easy and powerful things safe. For example, to make a powerful thing safe, make sure that screwing it up will not screw up their system.<p>3. But not only should they <i>be</i> safe, they should <i>feel</i> safe, giving users every opportunity to back out without consequences. This is where git goes wrong: it does not feel safe, so users are scared of it. [0] I believe Nix is the same way, even though it is safer than git.<p>4. Spend gobs of time on documentation. Use Fred Rogers&#x27; list of rules for talking with children [1] in each piece of documentation. This will make it easier to avoid the trap of not explaining something the user needs because the writer forgot that they didn&#x27;t know it. In essence, the documentation should treat new users as Fred Rogers treated children: ignorant, but capable.<p>5. The documentation also needs to have a different focus. Instead of focusing on how great Nix is, it should focus on helping users get stuff done. Nix enthusiasts should be able to say, &quot;Oh, you want to set up a development environment for your project? Great, go to such-and-such tutorial. It will tell you exactly how to do that even if you don&#x27;t have Nix installed.&quot; This should be done for as many use cases as people have, including less common ones. Some examples: using Nix as a build system, using Nix to install multiple versions of glibc and how to switch between them, using Nix to set up systemd, using Nix to replace a Docker container in production, using Nix to distribute builds, etc.<p>[0]: <a href="https:&#x2F;&#x2F;xkcd.com&#x2F;1597&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;1597&#x2F;</a><p>[1]: <a href="https:&#x2F;&#x2F;www.mentalfloss.com&#x2F;article&#x2F;547536&#x2F;mr-rogers-rules-for-talking-to-kids" rel="nofollow">https:&#x2F;&#x2F;www.mentalfloss.com&#x2F;article&#x2F;547536&#x2F;mr-rogers-rules-f...</a>
评论 #32694512 未加载
评论 #32695488 未加载
评论 #32695314 未加载