I followed the official home-manager docs and choose the standalone installation:
home-manager install
Used a direct import as recommended (nixvim-install)
let
nixvim = import (builtins.fetchGit {
url = "https://github.com/nix-community/nixvim";
# When using a different channel you can use `ref = "nixos-<version>"` to set it here
});
in
home.nix:
{ config, pkgs, lib, ... }:
let
nixvim = import (builtins.fetchGit {
url = "https://github.com/nix-community/nixvim/nixos-24.05";
# When using a different channel you can use `ref = "nixos-<version>"` to set it here
});
in
{
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "name";
home.homeDirectory = "/home/name";
# want to update the value, first check the Home Manager
# release notes.
home.stateVersion = "24.05"; # Please read the comment before changing.
];
home.file = {
};
home.sessionVariables = {
# EDITOR = "emacs";
};
programs = {
nixvim = {
enable = true;
defaultEditor = true;
};
home-manager.enable = true;
};
}
error when running home-manager switch:
error:
… while evaluating the attribute 'activationPackage'
at /nix/var/nix/profiles/per-user/root/channels/home-manager/modules/default.nix:49:7:
48|
49| activationPackage = module.config.home.activationPackage;
| ^
50|
… while evaluating a branch condition
at /nix/store/yn5s22qkqjgj2ibq5glzyh1ngch6rjd0-source/lib/lists.nix:125:9:
124| fold' = n:
125| if n == len
| ^
126| then nul
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `programs.nixvim' does not exist. Definition values:
- In `/home/name/.config/home-manager/home.nix':
{
defaultEditor = true;
enable = true;
}
How can I fix it? I read the documentation but it’s cryptic…