@@ -47,10 +47,10 @@ import qualified System.Info
4747import System.IO.Temp (withSystemTempDirectory)
4848
4949import Obelisk.App (MonadObelisk)
50−import Obelisk.CliApp (Severity (..) , failWith, putLog, proc, readCreateProcessWithExitCode, readProcessAndLogStderr)
51−import Obelisk.Command.Project (obeliskDirName, toObeliskDir, withProjectRoot, nixShellWithPkgs, toNixPath)
50+import Obelisk.CliApp (Severity (..) , failWith, putLog, proc, readCreateProcessWithExitCode)
51+import Obelisk.Command.Project (obeliskDirName, toObeliskDir, withProjectRoot, nixShellWithPkgs, findProjectAssets)
5252import Obelisk.Command.Thunk (attrCacheFileName)
53−import Obelisk.Command.Utils (findExePath, ghcidExePath, nixBuildExePath, nixExePath)
53+import Obelisk.Command.Utils (findExePath, ghcidExePath)
5454
5555data CabalPackageInfo = CabalPackageInfo
5656 { _cabalPackageInfo_packageFile :: FilePath
@@ -76,27 +76,7 @@ run = withProjectRoot "." $ \root -> do
7676 pkgs <- fmap toList . parsePackagesOrFail =<< getLocalPkgs root
7777 withGhciScript pkgs root $ \dotGhciPath -> do
7878 freePort <- getFreePort
79− assets <- do
80− let importableRoot = toNixPath root
81− isDerivation <- readProcessAndLogStderr Debug $
82− proc nixExePath
83− [ "eval"
84− , "-f"
85− , root
86− , "(let a = import " <> importableRoot <> " {}; in toString (a.reflex.nixpkgs.lib.isDerivation a.passthru.staticFilesImpure))"
87− , "--raw"
88− -- `--raw` is not available with old nix-instantiate. It drops quotation
89− -- marks and trailing newline, so is very convenient for shelling out.
90− ]
91− -- Check whether the impure static files are a derivation (and so must be built)
92− if isDerivation == "1"
93− then fmap T.strip $ readProcessAndLogStderr Debug $ -- Strip whitespace here because nix-build has no --raw option
94− proc nixBuildExePath
95− [ "--no-out-link"
96− , "-E", "(import " <> importableRoot <> "{}).passthru.staticFilesImpure"
97− ]
98− else readProcessAndLogStderr Debug $
99− proc nixExePath ["eval", "-f", root, "passthru.staticFilesImpure", "--raw"]
79+ assets <- findProjectAssets root
10080 putLog Debug $ "Assets impurely loaded from: " <> assets
10181 runGhcid root True dotGhciPath pkgs $ Just $ unwords
10282 [ "Obelisk.Run.run"