-
-
Notifications
You must be signed in to change notification settings - Fork 128
Description
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-configand/orgcc - 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 (Icdin and out my flakes), and sometimes it kept the wordimpurewhen 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).