Commit e06af2ca authored by Valentin Reis's avatar Valentin Reis

fix the env var passing.

parent 36ffa032
Pipeline #5840 passed with stage
in 24 seconds
......@@ -339,23 +339,26 @@ setupSystem target sa = do
varXDG_CACHE_HOME <- rpVerbose "mktemp"
["-d", "/tmp/deletable-nix-cache-XXXX"]
[]
varTMPDIR <- createAndSetTMPDIR "nixtmpdir"
varNIX_PATH <- toS <$> SE.getEnv "NIX_PATH"
varPATH <- toS <$> SE.getEnv "PATH"
varNIX_SSL_CERT_FILE <- toS <$> SE.getEnv "NIX_SSL_CERT_FILE"
varTMPDIR <- createAndSetTMPDIR "nixtmpdir"
passVars <- getVars ["PATH", "NIX_PATH", "NIX_SSL_CERT_FILE"]
let envVars =
[ ("XDG_CACHE_HOME" , varXDG_CACHE_HOME)
, ("TMPDIR" , varTMPDIR)
, ("NIX_PATH" , varNIX_PATH)
, ("PATH" , varPATH)
, ("NIX_SSL_CERT_FILE", varNIX_SSL_CERT_FILE)
]
[("XDG_CACHE_HOME", varXDG_CACHE_HOME), ("TMPDIR", varTMPDIR)]
++ passVars
when (isTarget target) $ setupNodeOs envVars
return envVars
where
getVars :: [Text] -> IO [(Text, Text)]
getVars vars = catMaybes <$> mapM maybeGet vars
maybeGet :: Text -> IO (Maybe (Text, Text))
maybeGet var = SE.lookupEnv (toS var) >>= \case
Nothing -> return Nothing
Just val -> return $ Just (var, toS val)
setupNodeOs :: [(Text, Text)] -> IO ()
setupNodeOs env = do
cleanSockets $ verbosity sa
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment