Ergonomic overrides for Nixpkgs

35 points by Gabriella439 a day ago on lobsters | 6 comments

toastal | a day ago

The solution is that Nixpkgs needs lenses, obviously.

[OP] Gabriella439 | a day ago

This but unironically

Corbin | a day ago

Nice! See also infuse.nix.

[OP] Gabriella439 | a day ago

Yeah, I had missed infuse.nix when researching prior art, and someone asked about it in the corresponding NixOS discourse posting. I wrote up a quick comparison between the two here:

https://discourse.nixos.org/t/ergonomic-overrides-for-nixpkgs/78081/3?u=gabriella439

I also just updated the post to mention infuse.nix

janus | 15 hours ago

How does Guix do overrides? Does it also have two embedded languages?

Rovanion | 14 hours ago

I have only written a few Guix package definitions, so have that in mind. But I think the answer is no, it is all Guile Scheme. The below example is taken from its manual on defining package variants.

(use-modules (gnu packages base))    ;for 'hello'

(define hello-2.2
  (package
    (inherit hello)
    (version "2.2")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/hello/hello-" version
                                  ".tar.gz"))
              (sha256
               (base32
                "0lappv4slgb5spyqbh6yl5r013zv72yqg2pcl30mginf3wdqd8k9"))))))