Skip to content

wrapFlags are being evaluated by shell during build #33

Open

Description

@iynaix

For example, the following wrapper:

inputs.wrapper-manager.lib.wrapWith pkgs {
    basePackage = pkgs.gh;
    wrapperType = "shell";
    wrapFlags = [
      "--run"
      ''export GITHUB_TOKEN=$(echo "abc")''
    ];
  };

produces:

#! /nix/store/q7sqwn7i6w2b67adw0bmix29pxg85x3w-bash-5.3p3/bin/bash -e
export GITHUB_TOKEN=abc
exec -a "$0" "/nix/store/yac2cbxia8f43mx48jfv9fip95g2m4dz-gh-2.79.0/bin/.gh-wrapped"  "$@"

Is this expected behavior? I would instead expect it to reproduce the wrapFlag verbatim, so it can be evaluated at runtime instead, i.e:

#! /nix/store/q7sqwn7i6w2b67adw0bmix29pxg85x3w-bash-5.3p3/bin/bash -e
export GITHUB_TOKEN=$(echo "abc")
exec -a "$0" "/nix/store/yac2cbxia8f43mx48jfv9fip95g2m4dz-gh-2.79.0/bin/.gh-wrapped"  "$@"

Activity

  1. viperML commented on Sep 24, 2025

    @viperML
    Owner

    At some point during the refactor, this behaviour of escaping bash code was lost. We should add it back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions