

I’m a fan of putting factored expressions into their own files and importing those files as NixOS modules. For example, let’s say that we want to install vim. We might start with a vim.nix:
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.vim ];
}
Then in the main configuration, this can be imported by path:
{
imports = [ ./vim.nix ];
}
Adding the import is like enabling the feature, but without any options or config. Later on, the feature can be customized without changing the import-oriented usage pattern:
{ pkgs, ... }:
let
vim = ...;
in {
environment.systemPackages = [ vim ];
}
Since the imported file is a complete NixOS module, it can carry other configuration. Here’s a real example, adb.nix, which adds Android debugger support:
{ pkgs, ... }: {
programs.adb.enable = true;
environment.systemPackages = [ pkgs.pmount ];
users.users.corbin.extraGroups = [ "adbusers" ];
}
It’s the same controversy as it was last year and the year before that: should the military-industrial complex be allowed to benefit from the Nix commons? It’s disappointing that you don’t think that the ethics of our profession is worth more than the output of our labor, particularly when it comes to exploitation, mass surveillance, war, and genocide.
Most of us write flakes outside of
nixpkgs. I’m still listed as a maintainer and get pinged, but I don’t really care; anything I care about is already being actively developed out-of-tree. I doubt I’m the only maintainer taking that sort of quiet-quitting path.