Fedora Account System
Red Hat Associate
Red Hat Customer
`nix repl` opens a repl to run nix expressions in. Similar to `bash` or `python` and `node`'s repl, it's expected behavior that you can scroll through your history with the up/down arrow. This is not working for me with Fedora's `nix`. This issue does not occur when using `nix run nixpkgs#nix -- repl` (ie a `nix` binary from `cache.nixos.org`). Both of them are the same version of nix: ``` ❯ rpm -q nix nix-2.34.8-1.fc44.x86_64 ❯ nix --version nix (Nix) 2.34.8 ❯ nix run nixpkgs#nix -- --version nix (Nix) 2.34.8 ``` nixpkg's `nix` successfully writes to `~/.local/share/nix/repl-history` and I can scroll through its history with the arrow keys. If I add to history using nixpkg's `nix`, fedora's `nix` allows me to scroll through that history, but anything I run from fedora's nix doesn't get added. Reproducible: Always Steps to Reproduce: 1. Delete `~/.local/share/nix/repl-history` if it exists 2. Run `nix repl` 3. Run any command, ie `1 + 1` 4. Hit the up arrow Actual Results: Nothing occurs, after exiting REPL nothing is written to `~/.local/share/nix/repl-history` Expected Results: To be able to scroll through this history with the up/down arrow, for `1 + 1` to be written to `.local/share/nix/repl-history` after exiting the REPL Additional Information: I've observed weird behavior when observing with `strace`. In this case, I deleted `~/.local/share/nix/repl-history`. ``` ❯ strace -e trace=openat,write,rename,close nix repl <omitted output where I run 1 + 1 in the repl> openat(AT_FDCWD, "/home/user/.local/share/nix/repl-history", O_WRONLY|O_CREAT|O_TRUNC, 0600) = 3 write(3, "", 0) = 0 close(3) = 0 ``` Even though I ran `1 + 1`, the binary writes "". `nixpkgs`'s nix acts as you'd expect, writing all expressions to repl history. I have not modified `/etc/nix/nix.conf` from the fedora defaults.
Thanks for the report. I can reproduce also in newer rawhide. Tbh, I don't use the repl often, so I was not aware of this. Some investigation is needed I think: I can only comment that the fedora nix package is built with the readline library. Earlier I used editline, before the package was officially included in fedora. But that could be unrelated. Though it sounds like you are saying the problem is not writing repl-history iirc?
> Though it sounds like you are saying the problem is not writing repl-history iirc? Correct, the `strace` output seems to imply it thinks there is never anything to add to repl-history. It always writes an empty string.
(I guess a quasi-workaround might be to use rlwrap to run nix repl, but not a proper solution obviously.)
I think one thing we could try is to build nix without readline and see what happens. I looked a bit at src/libcmd/repl-interacter.cc and see there differences in the code used at least. To build it locally you basically just need to remove the '-Dlibcmd:readline-flavor=readline' line from nix.spec and install editline-devel. I could provide a scratch build I suppose if needed. I tried on Rawhide and indeed it seems to fix the problem for me.
https://src.fedoraproject.org/rpms/nix/c/74c7b48688a76b54e49a3e6c0887caaf4adbd2ec?branch=rawhide is what I pushed for Rawhide.
FEDORA-2026-d34d705a38 (nix-2.35.3-1.fc45) has been submitted as an update to Fedora 45. https://bodhi.fedoraproject.org/updates/FEDORA-2026-d34d705a38
FEDORA-2026-d9fe9e0ac3 (nix-2.35.3-2.fc44) has been submitted as an update to Fedora 44. https://bodhi.fedoraproject.org/updates/FEDORA-2026-d9fe9e0ac3
FEDORA-2026-065497e462 (nix-2.31.6-1.fc43) has been submitted as an update to Fedora 43. https://bodhi.fedoraproject.org/updates/FEDORA-2026-065497e462
FEDORA-EPEL-2026-ffed74cdfb (nix-2.31.6-1.el10_4) has been submitted as an update to Fedora EPEL 10.4. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-ffed74cdfb
FEDORA-EPEL-2026-51b9011519 (nix-2.31.6-1.el10_3) has been submitted as an update to Fedora EPEL 10.3. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-51b9011519
FEDORA-2026-d34d705a38 has been pushed to the Fedora 45 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-d34d705a38` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-d34d705a38 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2026-ffed74cdfb has been pushed to the Fedora EPEL 10.4 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-ffed74cdfb See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2026-51b9011519 has been pushed to the Fedora EPEL 10.3 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-51b9011519 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2026-065497e462 has been pushed to the Fedora 43 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-065497e462` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-065497e462 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2026-d9fe9e0ac3 has been pushed to the Fedora 44 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-d9fe9e0ac3` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-d9fe9e0ac3 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2026-06f144fbdf (nix-2.31.6-1.el10_2) has been submitted as an update to Fedora EPEL 10.2. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-06f144fbdf
FEDORA-EPEL-2026-06f144fbdf has been pushed to the Fedora EPEL 10.2 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-06f144fbdf See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2026-ffed74cdfb (nix-2.31.6-1.el10_4) has been pushed to the Fedora EPEL 10.4 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-EPEL-2026-51b9011519 (nix-2.31.6-1.el10_3) has been pushed to the Fedora EPEL 10.3 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2026-d9fe9e0ac3 (nix-2.35.3-2.fc44) has been pushed to the Fedora 44 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2026-065497e462 (nix-2.31.6-1.fc43) has been pushed to the Fedora 43 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-EPEL-2026-06f144fbdf (nix-2.31.6-1.el10_2) has been pushed to the Fedora EPEL 10.2 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2026-d34d705a38 (nix-2.35.3-2.fc45) has been pushed to the Fedora 45 stable repository. If problem still persists, please make note of it in this bug report.