I use NixOS, and I'm trying to set up a Nix Haskell environment for my Haskell project. I have this Haskell package written in Nix that I'm trying to get working via nix-shell, but the dependent Haskell package Clay won't build, as described in this bug report I just opened. How can I override this package with a different (older or newer, I guess it doesn't matter) version of this Haskell package that works?


Not completely relevant, however I needed to modify an existing package that failed to build. I ended up with:

nixpkgs.config.packageOverrides = pkgs: {
    haskellPackages = pkgs.haskellPackages.override {
      overrides = hsSelf: hsSuper: {
        greenclip  = pkgs.haskell.lib.overrideCabal hsSuper.greenclip  (oa: {
          version = "3.1.1";
          sha256 = "1axh1q7kcvcnhn4rl704i4gcix5yn5v0sb3bdgjk4vgkd7fv8chw";
          executablePkgconfigDepends = oa.executablePkgconfigDepends ++ [pkgs.xorg.libXdmcp];

        wordexp  = pkgs.haskell.lib.overrideCabal hsSuper.wordexp  (oa: {
          version = "0.2.2";
          sha256 = "1mbcrq89jz0dcibw66w0jdy4f4bfpx4zwjfs98rm3jjgdikwdzb4";

The above went in my configuration.nix

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.