Hi Folks,
I’m guessing that the intersection between the set of all GMT users (or even people doing geo-something type work), and the set of all nixpkgs users, is probably infinitesimally small (perhaps even null!), but throwing this out there in case it is interesting/helpful to anybody. Who knows, maybe some curious cartographic soul will decide to try out nix/nixos.
Just a heads up, that GMT v6.1.0 was recently added to nixpkgs, the official nix package repo. Right now it’s only on the master branch, but over a period of days it’ll hopefully trickle down into the other stable/unstable branches. Tested on macos and nixos (although tbh I haven’t used it on macos in a while).
What is nix/nixpkgs?
Nix is a package manager that runs on multiple platforms, including macos (so this presents an alternative to brew for mac users wanting to run GMT). Nixpkgs is the official “channel” (i.e. package repo) for the nix the package manager, while NixOS is an entire operating system based on nix. Nix is also the name of a declarative, strictly functional, configuration mini-language, that nixpkgs is based off of. In the sort of “canonical” nix workflow/setup, users write configuration files in the nix language, that define/declare the state of the system (or user) environment, which nix then consumes to determine what to install. However, it is also possible to install packages imperatively, like how one would use a more typical package manager like aptitude or brew (e.g. apt-get install
and brew install
becomes nix-env --install
).
Why use nix?
The following excerpt from the official page, is how people usually try to sell nix
Nix builds packages in isolation from each other. This ensures that they are reproducible and don’t have undeclared dependencies, so if a package works on one machine, it will also work on another .
BUT, my favorite feature of nix is actually
Nix makes it trivial to share development and build environments for your projects, regardless of what programming languages and tools you’re using.
In practice, this works analogously to Anaconda’s environment mechanism, although in my experience it’s a lot more effective (e.g. nix avoids duplicating package installs across envs, so they are much much smaller than conda envs). I’ve been working on some ocean modeling lately, so for me this means that it’s super easy to work on my models from different computers.
Anyways, I’m monologuing now. Hope this helps somebody!