diff --git a/nix/pkgs/posh.nix b/nix/pkgs/posh.nix index 7d7fdf1..fe6c60a 100644 --- a/nix/pkgs/posh.nix +++ b/nix/pkgs/posh.nix @@ -167,7 +167,7 @@ in source /etc/profile test -S "$SSH_AUTH_SOCK" && ssh="-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK -e SSH_AUTH_SOCK" - tty -s && tty="-t" || quiet="-q" + tty -s && tty="-t" entrypoint=--entrypoint='["/usr/bin/env","bash","-il"]' || quiet="-q" # define these as variables so we can override them at runtime POSH_IMAGE=${image} @@ -179,6 +179,8 @@ in # TODO parse the beginning of the command for POSH_* overrides fi + test "$@" && cmd=( -c "$@") + HOME_CONTAINERS_CONFIGDIR="$HOME/.config/containers" HOME_POLICY_JSON="$HOME_CONTAINERS_CONFIGDIR/policy.json" test -d $HOME_CONTAINERS_CONFIGIDR || mkdir $HOME_CONTAINERS_CONFIGIDR @@ -188,7 +190,8 @@ in ${global_args} run --rm -i $tty $ssh -v ~/:/root -w /root --network host --pull=''${POSH_PULL} \ --conmon ${pkgs.conmon}/bin/conmon --runtime ${pkgs.runc}/bin/runc \ --config ${podmanConfig} \ - ${run_args} ''${POSH_IMAGE} $@ + ${run_args} \ + ''${POSH_IMAGE} /usr/bin/env bash -l "''${cmd[@]}" '') .overrideAttrs(attrs: attrs // { passthru = {