Skip to content

Direnv sets a terminfo variable to a string, when in zsh it's an array #405

@acid-bong

Description

@acid-bong

I've created a flake for my build of st terminal, and originally it was overriding some attributes of nixpkgs' derivation. In that case direnv (with use flake in .envrc) didn't load the environment consistently:

  • sometimes it didn't load the executables: make, pkg-config and/or gcc
  • sometimes it didn't load the libraries
  • sometimes it didn't set up some variables (such as CC=gcc)
  • Starship's nix module didn't display fully: either had only impure, no text or kept the name of different flakes I maintain (I cd in and out my flakes), and sometimes it kept the word impure when I exited the troublesome flake dir

It was also noticeable that it tried to run the preInstall command defined by nixpkgs' derivation of st, and TERMINFO variable didn't go well with Zsh (I assume Direnv loads asynchronously) -- it produced (eval):export:1: terminfo: inconsistent type for assignment (although tried setting it manually, works normally). Retried entering and exiting in Bash, no such issue appears.

I rewrote the flake from overrideAttrs and basically copypasted the build recipe from nixpkgs, now Direnv loads the environment consistently, doesn't run that export command.

This also didn't happen in other flakes, like dwm (also overrideAttrs-based) and manually patched Victor Mono (mkDerivation-based).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions