> I'm curious what emacs users are doing these days.
Integrating with a new language ecosystem is a significant amount of work for me because it involves making choices about what packages to configure and how, and which external dependencies to go with (e.g., which LSP server to use). I try to make those choices carefully, and for a lot of projects I touch in only a dabbler in those languages. It takes time to figure out.
But for actually managing external dependencies (LSP servers, linters, static analyzers, etc.), I use Nix (in particular devenv.sh) and direnv so that Emacs doesn't have to download them; it just finds them on the path. I also sometimes configure those tools via Devenv as well, creating an in-repo RC file for them and pointing to it with an appropriate environment variable. Then my configuration lives in source control and the rest of my team can use the same tools regardless of editor choice.
Yes Nix is also something I've been thinking of diving into with emacs to solve this issue. What's your experience been running Nix on non-Linux targets? I mostly use MacOS and FreeBSD outside of Linux, primarily MacOS.
I've written most of the development environment declarations for my team's projects, which are mostly glue code or IaC in Terraform, Python, Bash (Nix can do some really cool things with Bash scripts[1]), and Ruby, and some Nix packages that we also use to deploy those projects. About half of my team uses Nix on macOS, and the other half uses Nix on Linux (via WSL), and our other deployment targets are all Linux on AWS (some EC2 boxes, some Lambda services, some ECS/Fargate deployments), though not all of those are Nix-based.
There are sometimes small differences, like sometimes a Python package with native dependencies will fail to build in some Linux environments but not on macOS or vice-versa, but generally you don't, even then, need to special-case things by operating system to make them work uniformly.
As for overall support, macOS is a more chaotic and quirky environment: macOS updates break applications or remove APIs more often than Linux updates do, macOS updates nuke configuration files in `/etc`, or blindly steamroll system users (low UIDs), the login shell doesn't manage environment variables or other aspects of the GUI session, etc. These are extra hurdles that Nix has to work around on macOS. But it generally works well and the only real hooks that Nix needs into your environment are some shell scripts that need to be sourced on startup. If you know how to manage your PATH and shell initialization in general, you can do it with Nix. (Additionally, one distributions of Nix itself includes some extra software for managing these hurdles that works pretty well at the cost of a more opinionated and more "invasive" install-- check out "Determinate Nix" if you're interested.) Other than that, it's basically the same as on Linux. Package selection is good, things mostly work the same way.
Nix's support for platforms other than Linux and macOS is less mature. In years past, efforts have waxed and waned, but in the past few years there've been some concerted and persistent efforts to make Nix and Nixpkgs more usable on Windows, NetBSD, and FreeBSD. Even native (e.g., not just cross-compilation from other platforms) support for Windows is actually a thing!
You can also easily set up "remote builders" to local VMs for Linux and FreeBSD so that you can transparently build packages and environments for those platforms on your Mac, if that's a frequent choice of development platform.
Overall I'd say it's pretty good, but I don't personally know much about the current status of FreeBSD. It looks like there are a few hundred FreeBSD-specific packages in Nixpkgs, and there's also a fork of NixOS based on FreeBSD called NixBSD. Most packages include "platforms = [ unix ];" in their metadata, which means they're at least intended to build for not just Linux and macOS but also FreeBSD, but I don't know if Hydra is building binaries for any FreeBSD platforms. If it's not, then many packages may be untested and have small build problems. My guess is that at worst, Nix on FreeBSD is probably slightly behind where Nix on Linux was when I got into it 7 or 8 years ago. At that time, Nix still felt amazing and very worth it, but certainly required a willingness to learn how to package things and fill in gaps yourself to get the most out of it. Consider dropping by NixOS' Matrix community; I'm sure there's a FreeBSD channel. --
1: https://github.com/abathur/resholve/