on master help sign in
Merge pull request #745 from obsidiansystems/ae@static-which-prefetch
d25bdd4Elliot Cameron
haskell-overlays/obelisk.nix+1
@@ -20,6 +20,7 @@ in
20 librarySystemDepends = [
20 librarySystemDepends = [
21 pkgs.jre
21 pkgs.jre
22 pkgs.nix
22 pkgs.nix
23+ pkgs.nix-prefetch-git
23 (haskellLib.justStaticExecutables self.ghcid)
24 (haskellLib.justStaticExecutables self.ghcid)
24 ];
25 ];
25 };
26 };
lib/command/src/Obelisk/Command/Thunk.hs+2−2
@@ -178,14 +178,14 @@ getNixSha256ForUriUnpacked
178getNixSha256ForUriUnpacked uri =
178getNixSha256ForUriUnpacked uri =
179 withExitFailMessage ("nix-prefetch-url: Failed to determine sha256 hash of URL " <> gitUriToText uri) $ do
179 withExitFailMessage ("nix-prefetch-url: Failed to determine sha256 hash of URL " <> gitUriToText uri) $ do
180 [hash] <- fmap T.lines $ readProcessAndLogOutput (Debug, Debug) $
180 [hash] <- fmap T.lines $ readProcessAndLogOutput (Debug, Debug) $
181− proc "nix-prefetch-url" ["--unpack", "--type", "sha256", T.unpack $ gitUriToText uri]
181+ proc nixPrefetchUrlPath ["--unpack", "--type", "sha256", T.unpack $ gitUriToText uri]
182 pure hash
182 pure hash
183
183
184nixPrefetchGit :: MonadObelisk m => GitUri -> Text -> Bool -> m NixSha256
184nixPrefetchGit :: MonadObelisk m => GitUri -> Text -> Bool -> m NixSha256
185nixPrefetchGit uri rev fetchSubmodules =
185nixPrefetchGit uri rev fetchSubmodules =
186 withExitFailMessage ("nix-prefetch-git: Failed to determine sha256 hash of Git repo " <> gitUriToText uri <> " at " <> rev) $ do
186 withExitFailMessage ("nix-prefetch-git: Failed to determine sha256 hash of Git repo " <> gitUriToText uri <> " at " <> rev) $ do
187 out <- readProcessAndLogStderr Debug $
187 out <- readProcessAndLogStderr Debug $
188− proc "nix-prefetch-git" $ filter (/="")
188+ proc nixPrefetchGitPath $ filter (/="")
189 [ "--url", T.unpack $ gitUriToText uri
189 [ "--url", T.unpack $ gitUriToText uri
190 , "--rev", T.unpack rev
190 , "--rev", T.unpack rev
191 , if fetchSubmodules then "--fetch-submodules" else ""
191 , if fetchSubmodules then "--fetch-submodules" else ""
lib/command/src/Obelisk/Command/Utils.hs+6
@@ -54,6 +54,12 @@ nixBuildExePath = $(staticWhich "nix-build")
54jreKeyToolPath :: FilePath
54jreKeyToolPath :: FilePath
55jreKeyToolPath = $(staticWhich "keytool")
55jreKeyToolPath = $(staticWhich "keytool")
56
56
57+nixPrefetchGitPath :: FilePath
58+nixPrefetchGitPath = $(staticWhich "nix-prefetch-git")
59+
60+nixPrefetchUrlPath :: FilePath
61+nixPrefetchUrlPath = $(staticWhich "nix-prefetch-url")
62+
57-- | Nix syntax requires relative paths to be prefixed by @./@ or
63-- | Nix syntax requires relative paths to be prefixed by @./@ or
58-- @../@. This will make a 'FilePath' that can be embedded in a Nix
64-- @../@. This will make a 'FilePath' that can be embedded in a Nix
59-- expression.
65-- expression.