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, ... }:
let
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;
}
./home-manager/modules/lib/graphics-video.nix
./home-manager/modules/lib/compression.nix
./home-manager/modules/lib/io.nix
./home-manager/modules/lib/build-systems.nix
./home-manager/modules/lib/networking.nix
./home-manager/modules/lib/protocols.nix
./home-manager/modules/lib/packages.nix
./home-manager/modules/lib/compilers.nix
];
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
};
};
}
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.
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.
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.