Commit d088bfbf authored by Valentin Reis's avatar Valentin Reis
Browse files

Manifest var change

parent c26a4ba7
Pipeline #5179 passed with stage
in 21 seconds
......@@ -40,7 +40,7 @@ in rec
preCommit = pkgs.mkShell {
name = "shake";
MANIFESTS = "/tmp";
ARGONIX_SHARE = "/tmp";
buildInputs = [
(pkgs.haskellPackages.ghcWithPackages (p: with p; [
argonix
......
{-# language RecordWildCards #-}
{-# language ApplicativeDo #-}
{-# language LambdaCase #-}
{-# language OverloadedStrings #-}
module Main where
......@@ -110,14 +111,26 @@ main :: IO ()
main = sh $ do
a@StackArgs {..} <- liftIO $ execParser opts
let arguments = argumentsBuilder a
sudo <- which "sudo" >>= \case
(Just sudo) -> printf ("Found sudo at " % fp % "\n") sudo >> return sudo
Nothing -> die "sudo not in $PATH."
export "SUDO" $ pack $ encodeString sudo
case targetMachine of
Nothing -> liftIO $ executeFile
"SUDO=$(which sudo) nix-shell --keep SUDO --pure --allow-new-privileges --option build-extra-sandbox-paths $(which sudo | xargs dirname)"
"nix-shell"
True
( ["-E", unpack nixExpression]
++ [ "--keep"
, "SUDO"
, "--pure"
, "--allow-new-privileges"
, "--option"
, "build-extra-sandbox-paths"
, encodeString (dirname sudo)
]
++ arguments
++ (case run of
Just cmd -> ["--run", unpack ("\"" <> cmd <> "\"")]
Just cmd -> ["--run", unpack ("\"exec " <> cmd <> "\"")]
Nothing -> []
)
)
......@@ -156,7 +169,7 @@ main = sh $ do
"ssh"
[ "-t"
, host
, "source .profile; source .bash_profile; SUDO=$(which sudo) nix-shell --keep SUDO --pure --allow-new-privileges --option build-extra-sandbox-paths $(which sudo | xargs dirname) "
, "source .profile; source .bash_profile; SUDO=$(which sudo) exec nix-shell --keep SUDO --pure --allow-new-privileges --option build-extra-sandbox-paths $(which sudo | xargs dirname) "
<> lineToText drv
<> " --run "
<> "\""
......@@ -176,7 +189,7 @@ main = sh $ do
[ "-t"
, unpack host
, unpack
("source .profile; source .bash_profile; SUDO=$(which sudo) nix-shell --keep SUDO --pure --allow-new-privileges --option build-extra-sandbox-paths $(which sudo | xargs dirname) "
("source .profile; source .bash_profile; SUDO=$(which sudo) exec nix-shell --keep SUDO --pure --allow-new-privileges --option build-extra-sandbox-paths $(which sudo | xargs dirname) "
<> lineToText drv
)
]
......
......@@ -56,7 +56,7 @@ nixExpression =
source $${argotk}/share/argotk.sh
echo "Installed bash completion."
'';
MANIFESTS = "$${argopkgs.argonix}/share/manifests";
ARGONIX_SHARE = "$${argopkgs.argonix}/share";
};
expe = test.overrideAttrs (old:{
......
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