Clean up nix-container-demo-helper.sh

[?]
Mar 23, 2023, 9:15 PM
4A2DSMIMTZQWWZU76RCPYE2HYIGDBHQNZPRSJMQ4Y6T3CTFUZTEQC

Dependencies

  • [2] W2G433QU Refactor libdemo and flakeref for nix run commands

Change contents

  • replacement in bash/nix-container-demo-helper.sh at line 12
    [2.726][2.726:1244]()
    if type nix >/dev/null; then
    # Hack around missing mainProgram attribute in pygments
    # TODO: use nixpkgs_flakeref when this fix is merged
    COLORTERM="" TERM="" nix run github:sfrijters/nixpkgs/pygments-mainprogram#python3Packages.pygments -- "$@"
    elif type pygmentize >/dev/null; then
    COLORTERM="" TERM="" pygmentize "$@"
    else
    echo "pygmentize command not found"
    return 1
    fi
    [2.726]
    [2.1244]
    # Hack around missing mainProgram attribute in pygments
    # TODO: use nixpkgs_flakeref when this fix is merged
    COLORTERM="" TERM="" nix run github:sfrijters/nixpkgs/pygments-mainprogram#python3Packages.pygments -- "$@"
  • replacement in bash/nix-container-demo-helper.sh at line 25
    [2.1420][2.1420:1828]()
    if type nix > /dev/null; then
    # Hack around missing imagemagick
    # TODO: use nixpkgs_flakeref when this fix is merged
    nix run github:sfrijters/nixpkgs/tiv-add-wrapper#tiv -- "$@"
    elif type tiv >/dev/null; then
    tiv "$@"
    else
    echo "tiv command not found"
    return 1
    fi
    [2.1420]
    [2.1828]
    # Hack around missing imagemagick
    # TODO: use nixpkgs_flakeref when this fix is merged
    nix run github:sfrijters/nixpkgs/tiv-add-wrapper#tiv -- "$@"
  • replacement in bash/nix-container-demo-helper.sh at line 34
    [2.1941][2.1941:2183]()
    if type nix > /dev/null; then
    nix run "${NIXPKGS_FLAKEREF}#file" -- "$@"
    elif type file >/dev/null; then
    file "$@"
    else
    echo "file command not found"
    return 1
    fi
    [2.1941]
    [2.2183]
    nix run "${NIXPKGS_FLAKEREF}#file" -- "$@"