nh icon indicating copy to clipboard operation
nh copied to clipboard

No repl output except `stderr` (tested nh 4.1.1 through master)

Open dcunited001 opened this issue 4 months ago • 3 comments

I have confirmed that this is a bug related to nnh

  • [x] This is a bug, and not an user error or a support request. I understand that my issue will be closed if it is not a bug in NH.
  • [x] I have checked the issues tab and confirmed that my issue has not yet been reported. I understand that my issue will be closed if it is a duplicate.

Description

I tried building nh from master in this system. The sha 3ae7b19 links to my current system configuration. I'm still seeing the same behavior as posted in the strace from #307

I duplicated some of the text with a few deletions


here's a reverse strace attached.

nh-os-repl.hang2.strace.txt (the attachment is on #307)

I'm launching nh with:

users.users.dc.packages
fdsa=$(mktemp)

strace -e all -o $fdsa \
  nh -v os repl -E '
    with import <nixpkgs/nixos/lib/eval-config.nix>; {
      modules = [ ./hosts/myhosts/configuration.nix ];
    }'

# the strace (in reverse). the prompt never displays
# but the terminal still forwards input to the process
# and displays output. however, if i kill process, it
# gets messy and sometimes needs me to kill alacritty

I've been starting the repl like this and I'm trying to recreate the behavior.

NIXOS_HOST=$(shell hostname)
NIXOS_HOST_CONFIG=./hosts/$(NIXOS_HOST)/configuration.nix
nix repl --file '<nixpkgs/nixos>' -I nixos-config=${NIXOS_HOST_CONFIG}

Installation Method

Other

Installation Method (Other)

  • flakes are enabled on the nixos system
  • nh was installed via users.users.dc.packages
  • i haven't set anything in programs.nh
  • there are no variables like NH_FLAKE set

NH Version

v4.1.2

System Information

  • system: "x86_64-linux"
  • host os: Linux 6.15.4-zen2, NixOS, 25.05 (Warbler), 25.05.805977.88983d4b665f
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.28.4
  • nixpkgs: /nix/store/0x7w87263pc483pjl0n6vmkjbsnh85zr-nixos-25.05.805977.88983d4b665f/nixos

dcunited001 avatar Aug 11 '25 09:08 dcunited001

Sigh, I'm starting to get sick of how often upstream changes REPL behaviour. It is so annoying to deal with two competing implementations insisting that their way of doing things is the correct one.

I probably know why happens. Though I'm sad to admit that I currently don't have the mental bandwidth to find a workaround that works on all 12 trillion Nix implementations. Maybe @midischwarz12 would be interested in taking a shot, otherwise I'm putting this on my backlog for now.

NotAShelf avatar Aug 11 '25 11:08 NotAShelf

@NotAShelf Feel free to assign it to me. I'll take a look at it.

midischwarz12 avatar Aug 11 '25 13:08 midischwarz12

it's not blocking me at this point. i've just been validating my config via the repl. i somewhat went through building the package variants to learn how to override.

dcunited001 avatar Aug 11 '25 18:08 dcunited001