summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/haskell/nix-diff
diff options
context:
space:
mode:
authornin <nineinchnade@gmail.com>2017-12-14 21:13:46 +0100
committernin <nineinchnade@gmail.com>2017-12-14 21:13:46 +0100
commit37771ad34e18e0657636c8d0eb5b7392e3b89ba6 (patch)
tree8abda683b425494d2a273fc42d7573499b97a657 /krebs/5pkgs/haskell/nix-diff
parent7ed6fd18bb99884889a76ad9f597193861f44dc9 (diff)
parent04f7ae22d6d0720d06f78c712eb9cd245cefce82 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'krebs/5pkgs/haskell/nix-diff')
-rw-r--r--krebs/5pkgs/haskell/nix-diff/default.nix25
-rw-r--r--krebs/5pkgs/haskell/nix-diff/nixos-system.patch18
2 files changed, 43 insertions, 0 deletions
diff --git a/krebs/5pkgs/haskell/nix-diff/default.nix b/krebs/5pkgs/haskell/nix-diff/default.nix
new file mode 100644
index 000000000..df0315048
--- /dev/null
+++ b/krebs/5pkgs/haskell/nix-diff/default.nix
@@ -0,0 +1,25 @@
+{ mkDerivation, attoparsec, base, containers, Diff, fetchgit, mtl
+, nix-derivation, optparse-generic, stdenv, system-filepath, text
+, unix, vector
+}:
+mkDerivation {
+ pname = "nix-diff";
+ version = "1.0.0-krebs1";
+ src = fetchgit {
+ url = "https://github.com/Gabriel439/nix-diff";
+ sha256 = "1k00nx8pannqmpzadkwfrs6bf79yk22ynhd033z5rsyw0m8fcz9k";
+ rev = "e32ffa2c7f38b47a71325a042c1d887fb46cdf7d";
+ };
+ patches = [
+ ./nixos-system.patch
+ ];
+ 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;
+}
diff --git a/krebs/5pkgs/haskell/nix-diff/nixos-system.patch b/krebs/5pkgs/haskell/nix-diff/nixos-system.patch
new file mode 100644
index 000000000..03e186aa9
--- /dev/null
+++ b/krebs/5pkgs/haskell/nix-diff/nixos-system.patch
@@ -0,0 +1,18 @@
+diff --git a/src/Main.hs b/src/Main.hs
+index 959ab8e..d3b6077 100644
+--- a/src/Main.hs
++++ b/src/Main.hs
+@@ -95,7 +95,12 @@ pathToText path =
+ underneath `/nix/store`, but this is the overwhelmingly common use case
+ -}
+ derivationName :: FilePath -> Text
+-derivationName = Data.Text.dropEnd 4 . Data.Text.drop 44 . pathToText
++derivationName p =
++ if Data.Text.isPrefixOf "nixos-system" s
++ then "nixos-system"
++ else s
++ where
++ s = Data.Text.dropEnd 4 . Data.Text.drop 44 . pathToText $ p
+
+ -- | Group input derivations by their name
+ groupByName :: Map FilePath (Set Text) -> Map Text (Map FilePath (Set Text))