on master help sign in
Merge pull request #745 from obsidiansystems/ae@static-which-prefetch

Use 'staticWhich' in nix prefetch

commitd25bdd40028d88a028bd6c201c7bbeedcd4e8ed0 authorElliot Cameron <3noch@users.noreply.github.com> dateFri 22 May 2020, 10:29 (6 years ago) parent3894795ee5eadb
3 files changed+9−2
haskell-overlays/obelisk.nix+1 lib/command/src/Obelisk/Command/Thunk.hs+2−2 lib/command/src/Obelisk/Command/Utils.hs+6
haskell-overlays/obelisk.nix+1
@@ -20,6 +20,7 @@ in
2020 librarySystemDepends = [
2121 pkgs.jre
2222 pkgs.nix
23+ pkgs.nix-prefetch-git
2324 (haskellLib.justStaticExecutables self.ghcid)
2425 ];
2526 };
lib/command/src/Obelisk/Command/Thunk.hs+2−2
@@ -178,14 +178,14 @@ getNixSha256ForUriUnpacked
178178getNixSha256ForUriUnpacked uri =
179179 withExitFailMessage ("nix-prefetch-url: Failed to determine sha256 hash of URL " <> gitUriToText uri) $ do
180180 [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]
182182 pure hash
183183
184184nixPrefetchGit :: MonadObelisk m => GitUri -> Text -> Bool -> m NixSha256
185185nixPrefetchGit uri rev fetchSubmodules =
186186 withExitFailMessage ("nix-prefetch-git: Failed to determine sha256 hash of Git repo " <> gitUriToText uri <> " at " <> rev) $ do
187187 out <- readProcessAndLogStderr Debug $
188− proc "nix-prefetch-git" $ filter (/="")
188+ proc nixPrefetchGitPath $ filter (/="")
189189 [ "--url", T.unpack $ gitUriToText uri
190190 , "--rev", T.unpack rev
191191 , if fetchSubmodules then "--fetch-submodules" else ""
lib/command/src/Obelisk/Command/Utils.hs+6
@@ -54,6 +54,12 @@ nixBuildExePath = $(staticWhich "nix-build")
5454jreKeyToolPath :: FilePath
5555jreKeyToolPath = $(staticWhich "keytool")
5656
57+nixPrefetchGitPath :: FilePath
58+nixPrefetchGitPath = $(staticWhich "nix-prefetch-git")
59+
60+nixPrefetchUrlPath :: FilePath
61+nixPrefetchUrlPath = $(staticWhich "nix-prefetch-url")
62+
5763-- | Nix syntax requires relative paths to be prefixed by @./@ or
5864-- @../@. This will make a 'FilePath' that can be embedded in a Nix
5965-- expression.