fix outpath evaluation

This commit is contained in:
Ryan Mulligan 2021-11-13 11:58:24 -08:00
parent 0dbf904724
commit 9465ad7f08
2 changed files with 8 additions and 5 deletions

View File

@ -140,9 +140,9 @@ main = do
updates <- T.readFile "packages-to-update.txt"
Git.setupNixpkgs token
updateAll (Options pr True ghUser token cve nixpkgsReview outpaths attrpathOpt) updates
Update UpdateOptions {pr, cve, nixpkgsReview, attrpathOpt} update -> do
Update UpdateOptions {pr, cve, nixpkgsReview, outpaths, attrpathOpt} update -> do
Git.setupNixpkgs token
updatePackage (Options pr False ghUser token cve nixpkgsReview False attrpathOpt) update
updatePackage (Options pr False ghUser token cve nixpkgsReview outpaths attrpathOpt) update
Version -> do
v <- runExceptT Nix.version
case v of

View File

@ -19,6 +19,7 @@ import qualified Data.Vector as V
import qualified System.Posix.Files as F
import qualified Git
import qualified Utils
import qualified System.Directory
import OurPrelude
import Text.Parsec (parse)
import Text.Parser.Char
@ -89,14 +90,16 @@ in
outPath :: MonadIO m => ExceptT Text m Text
outPath = do
cacheDir <- liftIO $ Utils.outpathCacheDir
liftIO $ T.writeFile (cacheDir </> "/outpaths.nix") outPathsExpr
let outpathFile = (cacheDir </> "outpaths.nix")
liftIO $ T.writeFile outpathFile outPathsExpr
liftIO $ putStrLn "Evaluating outpaths..."
currentDir <- liftIO $ System.Directory.getCurrentDirectory
ourReadProcessInterleaved_ $ proc "nix-env" [
"-f", (cacheDir </> "/outpaths.nix"),
"-f", outpathFile,
"-qaP",
"--no-name",
"--out-path",
"--arg", "path", ".",
"--arg", "path", currentDir,
"--arg", "checkMeta", "true",
"--show-trace"]