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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Fast, Declarative, Reproduble and Composable Developer Environments Using Nix

111 点作者 domenkozar大约 1 年前

12 条评论

megaloblasto大约 1 年前
This might get down voted, but here goes. I agree that the Nix documentation can be confusing and even contradictory at times. I agree that there is a steep learning curve to getting started with Nix and NixOS. However, I do not think that Nix has ever claimed or intended to be a tool that can be used easily by everyone.<p>If the ideas seem pointless and confusing to you, that&#x27;s fine, don&#x27;t use it. There are bunch of great package managers and linux distros that will probably suit you better. But, if you see the need for declarative package management, then Nix is for you.<p>I&#x27;m a phd student in computational science. I use a bunch of different packages on my computer and I need to know exactly what I&#x27;ve installed and I do not have time to debug problems from dependency hell. Nix and NixOS have been two of the most interesting and useful tools I have every used. Not only have a gained huge productivity boost from having reproducible environments and declarative package management, but I&#x27;ve thoroughly enjoyed the process of learning these unique tools that, for me, are leagues better than any package management system I&#x27;ve used in the past.<p>If it didn&#x27;t work for you, I hope you find a tool that suits you better. But that doesn&#x27;t mean its bad. It might just mean it wasn&#x27;t intended for you.
评论 #40013989 未加载
评论 #40014313 未加载
评论 #40013625 未加载
gigatexal大约 1 年前
I want to use nix it&#x27;s the language that hurts for me. I keep trying to get into it, I have it on a mac laptop but Brew has gotten so good since I last used it almost 4 years ago that I go back to that.<p>Of course this is a whole env thing and not just a package thing but I dunno I&#x27;d almost rather build a container and work within that than write nix to get this functionality, the ergonomics of teh language are that galling for me.
评论 #40011733 未加载
评论 #40012001 未加载
评论 #40013745 未加载
评论 #40015213 未加载
评论 #40012441 未加载
评论 #40012378 未加载
评论 #40012161 未加载
评论 #40012372 未加载
dpatterbee大约 1 年前
There are a fair few nix based dev environment systems (devenv, devshell, devbox) and I&#x27;ve tried out a few, but devenv is the one I&#x27;ve stuck with. I don&#x27;t typically have complicated dev environments, I just use it for installing packages and adding convenience scripts which will automatically be activated and deactivated with direnv.
评论 #40013167 未加载
yewenjie大约 1 年前
I gave devenv multiple tries, and I am sorry to say there are multiple annoying issues that forced me to give up every time.<p>Some of these 200+ issues are unsolved for a fairly long time.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;cachix&#x2F;devenv&#x2F;issues">https:&#x2F;&#x2F;github.com&#x2F;cachix&#x2F;devenv&#x2F;issues</a>
评论 #40011528 未加载
评论 #40012842 未加载
mrd3v0大约 1 年前
I have been using this for a while, great project!<p>Though something that annoyed me with the recent v1 release is that it changed the default repository where it pulls the package definitions from Nix&#x27;s official to a fork made by the author.<p>That is dangerous and also lags behind an incredibly active and large upstream.<p>If you want to patch things, use proper Nix overrides or apply the patches using devenv code, don&#x27;t fork a +80,000-big rolling release package repository.
RcouF1uZ4gsC大约 1 年前
One of my favorite things about Rust is that it uses the file system as the basis for a fast, reproducible, and composable developer environment.<p>I can unzip a directory, cd into it and cargo build it and for the most part it just works.<p>The fact that we have added shared libraries and environmental variables and so many other magic incantations that we need massively complicated second systems is an indictment of our culture of complexity.<p>I believe Go also embraces that level of simplicity.<p>And when it comes to deployment, instead of needing a simulation of a whole operating system (containers), I can just remote copy a directory and just have it work.
评论 #40011505 未加载
评论 #40011487 未加载
评论 #40013215 未加载
评论 #40011708 未加载
评论 #40018881 未加载
评论 #40011790 未加载
woile大约 1 年前
I&#x27;ve been using devenv + flake parts and so far it&#x27;s done it&#x27;s job perfectly. I build a rust and a node application in the ci. Both local and ci build every time. It will only fail from time to time when i make an update, otherwise no errors at all
k8svet大约 1 年前
I wish just one of these would allow for multi-instantiation of services. I have projects where I need to spin up multiple independent postgres. Instead, many of these tools repeat the patterns used in nixpkgs.
评论 #40012932 未加载
emmelaich大约 1 年前
Reproduble -&gt; reproducible
angra_mainyu大约 1 年前
I&#x27;ve been a long time user of devenv.sh and can definitely recommend it as a nice wrapper around nix.<p>I often want to have some packages&#x2F;tools installed when I&#x27;m working on a project and docker isn&#x27;t always the right fit, which is where devenv comes it.<p>I basically use it as a generalized version of venv.
评论 #40013637 未加载
bPspGiJT8Y大约 1 年前
Not fast at all in my experience. Just <i>running</i> (for the first time) what would take seconds with something like `asdf` could take up to half an hour with Nix.
crabbone大约 1 年前
* Fast -- in what way? How can you even measure the speed of an environment?..<p>* Declarative -- as a developer, I don&#x27;t care... Why is this important? Also, declarative means there&#x27;s a bunch of imperative code hiding behind it. It just makes it harder to debug when things break.<p>* Composable -- in over 25 years of being a developer not even once did I want my dev. environment to compose with another...<p>And the article opens up with:<p>&gt; Simple JSON-like language<p>Why on earth?.. And things down the road that announce &quot;features&quot; like &quot;run processes&quot;... Is this some kind of April 1st joke that is meant to be funny because its two weeks too late?
评论 #40012760 未加载
评论 #40011572 未加载
评论 #40011685 未加载