devenv
nix-darwin
Our great sponsors
devenv | nix-darwin | |
---|---|---|
85 | 39 | |
3,101 | 2,165 | |
9.3% | - | |
9.8 | 8.9 | |
5 days ago | 7 days ago | |
Nix | Nix | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
devenv
-
Show HN: Lapdev, a new open-source remote dev environment management software
https://devenv.sh/ and nix in general are great for setting up dev environments.
-
Show HN: Flox 1.0 – Open-source dev env as code with Nix
> but worried that the development is not moving forward
There is an open v1.0 PR: https://github.com/cachix/devenv/pull/1005
-
Ask HN: How can I make local dev with containers hurt less?
It would be a smoother transition for most I imagine to use nix via https://devenv.sh/ even if only for it's excellent documentation.
Yup, I haven’t tried it but there is https://devenv.sh which is built on top of nix and makes it simple.
-
Flakes aren't real and cannot hurt you: using Nix flakes the non-flake way
Although Guix reads better than Nix (after all, it's Lisp), I found the support and resources available for learning severely lacking.
Plus, you have to jump through hoops to install non-free software, which goes against the ethos of Guix anyway.
IMHO, Nix is clearly "the winner" here and we'll see more and more adoption as it improves. Lots of folks are doing exciting work (see https://determinate.systems/, https://devenv.sh/, https://flakehub.com/). And the scale and organization around nixpkgs is damn impressive.
-
NixOS has one fatal flaw
I don't think you can ever get Nix as simple as PNPM, simply because native libraries are sometimes annoying, need to be configured at build time to a greater degree and because the problem space it attacks is so much larger than PNPM, which only deals with the JS/Node.js ecosystem.
However, I do think that there exist reasonable levels of abstraction that sacrifice some expressive power for simplicity and such systems could maybe expose a PNPM-like CLI. One example that comes to mind is devenv.nix [1]. While it doesn't yet have a CLI, its configuration file is YAML and relatively simple. I think there's more to be done in this space and I hope for tools that are easier to grasp in the future.
> Nix package files evaluate down to configuration for the Nix package manager, but I haven’t ever seen a good explanation for the basic essentials underneath all the abstraction. Every guide I’ve learned from and all the package defs I’ve read seem to cargo cult many layers of mysterious config composing config. Without easy to learn essentials it’s difficult to grok the system as a whole.
To me it sounds like the essential that you're referring to is the 'derivation' primitive, which is almost always hidden behind the mkDerivation abstraction from nixpkgs. This [2] blog post is an exploration of what exactly that means.
I'd also love for the documentation situation to be much better, in particular in terms of official, curated resources. But I'm not convinced that you actually need to know the difference between derivation and mkDerivation to make effective use of Nix, because in practice you would always use the latter. That said, mkDerivation and the whole of nixpkgs is essentially a huge DSL (I believe this is what you meant when you said 'config composing config') that you do need to know and is woefully underdocumented.
> I would love to adopt Nix for developer tooling for Notion’s engineers, but today it’s about infinity times easier to work around the limitations mentioned of Docker+Ubuntu+NPM than to work around the limitations of Nix.
One approach I have taken to is to specify the environment in Nix, but then generate Docker devcontainers from it, so most people don't come into contact with Nix if they don't want to.
[2] https://ianthehenry.com/posts/how-to-learn-nix/derivations/
-
Development Environments with Guix, similar to devenv.sh
This though, through the use of devenv.sh, which uses nix, as when I got into nix I though it was going to be easier to just make a development environment, not the case. Until I found devenv.sh, I could actually finally make good environments... It also has other features like containers and services, which also help me know that I can get the most of it if the time comes.
- Show HN: Local development with .local domains and HTTPS
-
Using Haskell with devenv.sh
Here’s getting started with Haskell using devenv.sh:
nix-darwin
-
My MacBook setup (the 2024 version)
Just a shout out to nix-darwin[1]. It is nix, so initial setup is a bit involved. But then it truly makes it easy to configure everything in one place including mac defaults, homebrew apps declaratively and mas apps etc.
There is a sample config in nix-darwin repo[2].
[1] https://github.com/LnL7/nix-darwin
[2] https://github.com/LnL7/nix-darwin/blob/master/modules/examp...
-
macOS Sonoma Broke Grep
https://github.com/LnL7/nix-darwin/tree/master/modules
-
What is the difference between NixOS and any other distro running the nix package manager?
nix-darwin does similar thing for MacOS
-
Issues with installing applications on Macos
There are many threads around where you can learn more about this (and why it's complicated...), but https://github.com/nix-community/home-manager/issues/1341 and https://github.com/LnL7/nix-darwin/issues/139 seem like two of the most comprehensive.
-
Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
Nix is pretty usable for both desktops and headless servers. Personally, I even use it on macOS without much trouble.
My system looks like any other install of Ventura, but all of my configuration, ranging from the terminal and VS Code to macOS-specific system preferences and Safari, is done declaratively in Nix [1]. The overwhelming majority of my installed software also comes from Nix packages, with some exceptions for stuff that is not packaged yet (e.g., I have Podman Desktop, the macOS ZFS port, Lulu, yubikey-manager-qt installed through Homebrew -- fortunately nix-darwin [2] also just lets me have an set of brews/casks in my config).
It was been a bit of a nightmare at first since the error messages are kind of horrific, and there can be a lack of good examples/docs on flakes. But I think the weekend worth of time I invested was worth it since I no longer need to rely on hacky shellscripts or remember to manually configure anything.
-
Beginner Question: Managing the global environment using Nix
Have a look at https://github.com/LnL7/nix-darwin and https://github.com/nix-community/home-manager
Take a look at nix-darwin, this is what I use. It allows you to configure your system similar to NixOS including globally installed programs.
-
How to install Chrome on MacOS without homebrew?
This — I still use mas and brew —-cask through the nix-darwin module, though. It’s not exactly reproducible, but it’s at least closer to reproducible and declarative.
-
Devenv.sh: Fast and reproducible developer environments using Nix
Adding to this, my understanding is that Nix does not guarantee any Nix derivation/package will seamlessly run on Linux, Mac, and Windows. So in this one aspect it is less capable than Docker, i.m.h.o.
i.e. if a Nix derivation depends on the systemd package https://search.nixos.org/packages?channel=unstable&show=syst... , Nix will not automatically find a replacement. But it may be possible to manually work around this with https://github.com/LnL7/nix-darwin
More on building Docker images with Nix: https://nix.dev/tutorials/building-and-running-docker-images
What are some alternatives?
Home Manager using Nix - Manage a user environment using Nix [maintainer=@rycee]
devbox - Instant, easy, and predictable development environments
NixOS-docker - DEPRECATED! Dockerfiles to package Nix in a minimal docker container
nix - Nix, the purely functional package manager
nixos-shell - Spawns lightweight nixos vms in a shell
NUR - Nix User Repository: User contributed nix packages [maintainer=@Mic92]
digga - A flake utility library to craft shell-, home-, and hosts- environments.
nix-direnv - A fast, persistent use_nix/use_flake implementation for direnv [maintainer=@Mic92 / @bbenne10]
direnv - unclutter your .profile
spack - A flexible package manager that supports multiple versions, configurations, platforms, and compilers.
asdf - Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more
nixpkgs - Nix Packages collection & NixOS