summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/haskell/nix-diff/nixos-system.patch
blob: 03e186aa948cd9e3f462f4936ea6322056102539 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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))