Allow dashes in identifiers
In Nixpkgs, the attribute in all-packages.nix corresponding to a package is usually equal to the package name. However, this doesn't work if the package contains a dash, which is fairly common. The convention is to replace the dash with an underscore (e.g. "dbus-lib" becomes "dbus_glib"), but that's annoying. So now dashes are valid in variable / attribute names, allowing you to write: dbus-glib = callPackage ../development/libraries/dbus-glib { }; and buildInputs = [ dbus-glib ]; Since we don't have a negation or subtraction operation in Nix, this is unambiguous.
Showing
- doc/manual/release-notes.xml 5 additions, 0 deletionsdoc/manual/release-notes.xml
- misc/emacs/nix-mode.el 1 addition, 1 deletionmisc/emacs/nix-mode.el
- src/libexpr/lexer.l 1 addition, 1 deletionsrc/libexpr/lexer.l
- tests/lang/eval-okay-attrs5.nix 2 additions, 2 deletionstests/lang/eval-okay-attrs5.nix
Loading
Please register or sign in to comment