I’m trying to install helix editor via home-manager on macOS using the helix flake from:
https://github.com/nix-community/home-manager/blob/c59f0eac51da91c6989fd13a68e156f63c0e60b6/modules/programs/helix.nix
and this as my home-manager flake (that works - at least until I added the path to the helix.nix
file in modules:
{
description = "Home Manager configuration of me";
inputs = {
{
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;
}
./home-manager/modules/gui/editors/helix.nix
];
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
};
};
}
but I am getting the following error:
The option
programs.helix.enable’ in /nix/store/6zxkqbrcw5r5yi6hmk3xf17y6wqiqs0h-source/modules/programs/helix.nix' is already declared in
/nix/store/7jpmwypn48hx9abv2fys0zs0mm693mk2-source/home-manager/modules/gui/editors/helix.nix’.`
Am I misunderstanding how to install programs via home-manager?
I ask, because when I look at the docs…
https://nix-community.github.io/home-manager/index.html#sec-install-standalone
I get the impression that some programs can just be enabled via a boolean (that home-manager then installs silently in the background??), whereas other programs may require enabling and their own config file (for example as a flake).