Readline not installing via home-manager

OS: macOS, 10.15.7 (Catalina)
Nix: 2.12.0
Home-Manager: 22.11

Helix editor installed and worked via the same programs.*.enable = true, and the lib packages in the modules I created and referenced below that have installed.

However, after home manager switch, readline is not showing via home-manager packages.

What am I doing wrong? Should I install readline as a package like those in my modules/libs instead?

My home-manager flake.nix:

  description = "Home Manager configuration of me";

  inputs = {
    # Specify the source of Home Manager and Nixpkgs.
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";

  outputs = { nixpkgs, home-manager, ... }:
      username = "me";
      system = "x86_64-darwin";
    in {
      homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
        pkgs = nixpkgs.legacyPackages.${system};
        modules = [
            home = {
              inherit username;
              homeDirectory = "/Users/${username}";
              stateVersion = "22.11";
            programs.home-manager.enable = true;
            programs.helix.enable = true;
            programs.readline.enable = true;
        # Optionally use extraSpecialArgs
        # to pass through arguments to home.nix

Seems as if there is nothing to be installed:

And readlines $out/bin does exist, but is empty and it doesn’t seem to have a dedicated bin output, so I assume it is not really an installable program anyway.

Thanks @NobbZ!

The reason I am trying to install readline via home-manager is because it was a dependency for a few apps/libs in my homebrew setup that I am trying to replace with nix/home-manager so I can soon migrate to a new mac and have a reproducible setup (as much as possible with a little extra scripting), and not be bothered with requests for ‘basics’ like readline while installing apps and other libs.

But am I going about things the wrong - ‘non-nix way’ - trying to replace the libs from my homebrew setup? Instead, should I only be focused on installing apps (eg for dev) and will nix/home-manager install lib dependencies like readline?

If I’m doing things the ‘right way’, perhaps instead I should install readline as a package under my home-manager/modules/libs (like others I have installed this way as a nix flakes) and see if home-manager switch complains that it is already enabled.

Programs the depend on readline will have it included in their closure, or at least have an overridable option to enable readline based features.

In general we do not install libs. They won’t be found anyway.

For “dev” work we usually use nix-shell with a shell.nix (or the flake equivalents) which describe the devenvironment. This can (and has to) also include the libraries you need for development.

Though I am definitely not the one to ask about nix-on-darwin specifics. I only played with it on a VM and there nix breaks regularly, such that I stopped trying to use the VM.

1 Like

Thanks again @NobbZ!

That’s clarified a large part of my missing understanding of the ‘nix philosophy/way’!!

My decision to move to nix was partly for the reasons previously mentioned and from the joy of trying nix (prior to installing home-manager) using its shell with direnv and flake to make elixir dev easier. I’m aiming to return to that as soon as I have my home-manager setup completed.

In that regard, is it worth installing asdf-vm and languages (for the older versions of languages) via nix because in my brief exploration, nix language repos appear to cut-off older versions often sooner than I’d like?

As long as you do not need to go further back than roughly march 2020 (this is roughly as far as you can go back through flake inputs “easily”), you should be fine just using older nixpkgs versions to use the older elixir versions.

Anything older than that isn’t supported by the elixir core team anymore anyway and you should hurry to upgrade the project.

Back on Arch I did package asdf-vm though through nix, installed via home manager and successfully used it that way. But it did not integrate as well as a proper nix shell and I only kept it for compatibility reasons with my older projects.

On the company mac though I simply use brew + asdfv-vm, due to company policy.

1 Like

Thanks again @NobbZ for the great advice!!