Closed binaryphile closed 12 months ago
@binaryphile: In this case installing a newer version of nix-diff
(1.0.3 is the latest version), will resolve this issue.
If you use the latest release of the nixpkgs-unstable
channel then it already defaults to picking nix-diff-1.0.3
. If that's not an option (i.e. you prefer to use the stable nixos-18.03
channel or an older stable channel) then that defaults to nix-diff-1.0.1
, which means that you will need to override that to select a newer version.
The next option is to open an issue against Nixpkgs asking them if they can upgrade nix-diff
to a newer version for the 18.03 branch.
If that's not an option, the second thing you can ask them is if they can add a pkgs.haskellPackages.nix-diff_1_0_3
derivation.
If that's still not an option, you can also install a newer version by saving the following Nix expression to a file:
# nix-diff.nix
let
nix-diff =
{ mkDerivation, attoparsec, base, containers, Diff, mtl
, nix-derivation, optparse-generic, stdenv, system-filepath, text
, unix, vector
}:
mkDerivation {
pname = "nix-diff";
version = "1.0.3";
sha256 = "f07cbdcbec4721c0804ed18f6228c800337a62a09fe7264ccb5f7859187e0095";
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
attoparsec base containers Diff mtl nix-derivation optparse-generic
system-filepath text unix vector
];
homepage = "https://github.com/Gabriel439/nix-diff";
description = "Explain why two Nix derivations differ";
license = stdenv.lib.licenses.bsd3;
};
config = {
packageOverrides = pkgs: {
haskellPackages = pkgs.haskellPackages.override {
overrides = haskellPackagesNew: haskellPackagesOld: {
nix-diff = haskellPackagesNew.callPackage nix-diff { };
};
};
};
};
pkgs = import <nixpkgs> { inherit config; };
in
pkgs.haskellPackages.nix-diff
... and then running (for nix-1.*
)
$ nix-env --install --file nix-diff.nix
I haven't used Nix 2.0 yet so I'm not sure what the equivalent idiomatic command would be for that but from reading the manual it looks like nix-env
is still supported
Thanks for spelling out all of the options, that's going above and beyond.
I'll update my nixpkgs and see what happens.
You're welcome! 🙂
I think this can be closed safely :smile:
When trying to install on nix-1.11.16 or nix-2.0.1 I get the following error for nix-diff:
Don't know if there's a solution but I figured I'd let you know.