haskellPackages.nix-diff: 1.0.0 -> 1.0.0-krebs1

This commit is contained in:
tv 2017-12-13 15:19:19 +01:00
parent 2f3f0bbb31
commit f3f61c85fd
2 changed files with 22 additions and 1 deletions

View File

@ -4,12 +4,15 @@
}:
mkDerivation {
pname = "nix-diff";
version = "1.0.0";
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 = [

View File

@ -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))