[Nix-dev] Literal “magic” strings in nixpkgs

Profpatsch mail at profpatsch.de
Fri Aug 21 14:07:00 CEST 2015


I noticed there is a trend to use magic strings in some places
of nixpkgs, e.g. in
https://nixos.org/nixos/manual/ch-options.html#opt-security.pki.certificateFiles
where the example is:

[ "${pkgs.cacert}/etc/ca-bundle.crt" ]

I find that alarming, because in exactly that case it silently broke when pkgs.cacert
moved its files to /etc/ssl/certs/ca-bundle.crt.

It got fixed in the meantime, but I’m pretty sure only after someone noticed it
suddenly stopped working.

There should be a variable exported by these packages that always points to the
correct file. And before inserting a magic string a variable should be created
and used in my opinion.

-- 
Proudly written in Mutt with Vim on NixOS.
Q: Why is this email five sentences or less?
A: http://five.sentenc.es
May take up to five days to read your message. If it’s urgent, call me.


More information about the nix-dev mailing list