on master help sign in
Use 'staticWhich' in nix prefetch
commit35662c68ff934466d123f7437707c98fdb392227 authorAlexandre Esteves <alexandre.fmp.esteves@gmail.com> dateFri 22 May 2020, 06:55 (6 years ago) parent68843c5
2 files changed+5−2
haskell-overlays/obelisk.nix+1 lib/command/src/Obelisk/Command/Thunk.hs+4−2
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+4−2
@@ -7,6 +7,7 @@
77{-# LANGUAGE PatternGuards #-}
88{-# LANGUAGE QuasiQuotes #-}
99{-# LANGUAGE ScopedTypeVariables #-}
10+{-# LANGUAGE TemplateHaskell #-}
1011{-# LANGUAGE TypeApplications #-}
1112module Obelisk.Command.Thunk where
1213
@@ -57,6 +58,7 @@ import System.FilePath
5758import System.IO.Error
5859import System.IO.Temp
5960import System.Posix (getSymbolicLinkStatus, modificationTime)
61+import System.Which (staticWhich)
6062import qualified Text.URI as URI
6163
6264import Obelisk.App (MonadObelisk)
@@ -178,14 +180,14 @@ getNixSha256ForUriUnpacked
178180getNixSha256ForUriUnpacked uri =
179181 withExitFailMessage ("nix-prefetch-url: Failed to determine sha256 hash of URL " <> gitUriToText uri) $ do
180182 [hash] <- fmap T.lines $ readProcessAndLogOutput (Debug, Debug) $
181− proc "nix-prefetch-url" ["--unpack", "--type", "sha256", T.unpack $ gitUriToText uri]
183+ proc $(staticWhich "nix-prefetch-url") ["--unpack", "--type", "sha256", T.unpack $ gitUriToText uri]
182184 pure hash
183185
184186nixPrefetchGit :: MonadObelisk m => GitUri -> Text -> Bool -> m NixSha256
185187nixPrefetchGit uri rev fetchSubmodules =
186188 withExitFailMessage ("nix-prefetch-git: Failed to determine sha256 hash of Git repo " <> gitUriToText uri <> " at " <> rev) $ do
187189 out <- readProcessAndLogStderr Debug $
188− proc "nix-prefetch-git" $ filter (/="")
190+ proc $(staticWhich "nix-prefetch-git") $ filter (/="")
189191 [ "--url", T.unpack $ gitUriToText uri
190192 , "--rev", T.unpack rev
191193 , if fetchSubmodules then "--fetch-submodules" else ""