Hello,
Having a tough time with integrating Nixvim in to my setup. I removed all references to Neovim from configuration and home.nix. I have gone through every iteration or combination that I have found online regarding this issue, but still am not able to resolve it.
This other post is similar to what I’m experiencing but moving the import in to the home.nix did not resolve the issue for me. Cannot get nixvim to install as a module in home-manager
I’ve tried;
- Inherit nixvim in special args and extra args.
- Import module in flake, Home Manager and NixOS, both same infrec error
Here is my current testing flake.nix
;
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixvim.url = "github:nix-community/nixvim";
nixvim.inputs.nixpkgs.follows = "nixpkgs";
hyprland.url = "github:hyprwm/Hyprland";
};
outputs = inputs@{
nixpkgs,
home-manager,
nixvim,
hyprland,
...
}:
let
system = "x86_64-linux";
homeManager = {
mod = ./modules;
df = ./modules/dotfiles;
cfg = ./modules/dotfiles/config;
};
in
{
# NixOS configuration entrypoint
nixosConfigurations = {
tbnix = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit system; inherit inputs; inherit nixvim;
};
modules = [
./hosts/tbnix
# nixvim.nixosModules.nixvim
# nixvim.homeManagerModules.nixvim
home-manager.nixosModules.home-manager {
home-manager.extraSpecialArgs = { inherit homeManager; inherit nixvim; };
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.fez = {
imports = [ ./hosts/tbnix/home.nix nixvim.homeManagerModules.nixvim];
};
}
...
TB Laptop/workstation home.nix
which imports the common home.nix
. Tried importing nixvim here. Still had infrec issue.
{ inputs, config, lib, pkgs, modulesPath, homeManager, ... }:
{
imports = [
../common/home.nix
# inputs.nixvim.homeManagerModules.nixvim
];
home.file = {
".config/hypr/common.conf" = {
source = homeManager.cfg + /hypr/common.conf;
};
".config/hypr/keybind" = {
source = homeManager.cfg + /hypr/keybind;
};
".config/rofi/" = {
source = homeManager.cfg + /rofi;
};
".config/waybar/" = {
source = homeManager.cfg + /waybar;
};
".config/hypr/autostart.conf" = {
source = homeManager.cfg + /hypr/autostart.conf;
};
".config/hypr/hyprpaper.sh" = {
source = homeManager.cfg + /hypr/hyprpaper.sh;
executable = true;
};
".config/hypr/hyprlock.txt" = {
source = homeManager.cfg + /hypr/hyprlock.txt;
};
".config/hypr/hyprlock.sh" = {
source = homeManager.cfg + /hypr/hyprlock.sh;
executable = true;
};
## TODO these lines need to be changed per device
".config/hypr/hyprland.conf" = {
source = homeManager.cfg + /tbhypr/hyprland.conf;
};
# ".config/hypr/hyprpaper.conf" = {
# source = homeManager.cfg + ./tbhypr/hyprpaper.conf;
# };
".config/hypr/hypridle.conf" = {
source = homeManager.cfg + /tbhypr/hypridle.conf;
};
};
}
This is the common home.nix
. Tested a few variaties of Nix Kikstart Neovim but decided to remove any imports and I’m just running programs.nixvim.enable = true;
for now with no other options.
{ inputs, config, lib, pkgs, modulesPath, homeManager, ... }:
{
imports = [
inputs.nixvim.homeManagerModules.nixvim
(homeManager.df + "/tmux.nix")
(homeManager.df + "/lf.nix")
(homeManager.df + "/zsh.nix")
(homeManager.df + "/vscode.nix")
# (homeManager.mod + "/nixvim/nixvimkiktst.nix")
# (homeManager.mod + "/nixvim/nixvimkik.nix")
# (homeManager.mod + "/nixvim/neovim.nix")
# (homeManager.mod + "/nixvim/neovimlsp.nix")
];
# Environment variables
home.sessionVariables = {
CARGO_HOME = "~/.local/share/cargo";
};
home = {
username = "fez";
homeDirectory = "/home/fez";
};
home.file = {
".scripts" = {
source = homeManager.df + /scripts;
executable = true;
recursive = true;
};
".vimrc" = {
source = homeManager.df + /vimrc.txt;
executable = true;
};
# launch keepassxc with hyprland
# add window rules and launch binding
".config/hypr/keepassxc.conf".text = ''
exec-once = keepassxc
windowrulev2 = size 800 550, class:^(org.keepassxc.KeePassXC)$
# windowrulev2 = float, class:^(org.keepassxc.KeePassXC)$
windowrulev2 = bordercolor $cc, class:^(org.keepassxc.KeePassXC)$
bind = $mainMod, z, exec, keepassxc
'';
};
# PACKAGES
home.packages = with pkgs; [
zsh-command-time
kdePackages.kate
thunderbird
brightnessctl
pinta
freecad-wayland
];
programs.nixvim = {
enable = true;
};
# Configure Kitty
programs.kitty = {
enable = true;
...
home.stateVersion = "24.05";
}
Here is the error;
❯ nix flake check
warning: Git tree '/home/fez/gitgoml/nixos' is dirty
error:
… while checking flake output 'nixosConfigurations'
at /nix/store/n8zimmccccqh32dk7308y78f0g49cyic-source/flake.nix:84:5:
83| # NixOS configuration entrypoint
84| nixosConfigurations = {
| ^
85| tbnix = nixpkgs.lib.nixosSystem {
… while checking the NixOS configuration 'nixosConfigurations.tbnix'
at /nix/store/n8zimmccccqh32dk7308y78f0g49cyic-source/flake.nix:85:7:
84| nixosConfigurations = {
85| tbnix = nixpkgs.lib.nixosSystem {
| ^
86| specialArgs = {
… while evaluating the option `system.build.toplevel':
… while evaluating definitions from `/nix/store/22r7q7s9552gn1vpjigkbhfgcvhsrz68-source/nixos/modules/system/activation/top-level.nix':
… while evaluating the option `assertions':
… while evaluating definitions from `/nix/store/xi3dvmqv5mrj0281i9sl4hfpzkwq3cmz-source/nixos/common.nix':
… while evaluating the module argument `inputs' in "/nix/store/n8zimmccccqh32dk7308y78f0g49cyic-source/hosts/tbnix/home.nix":
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: infinite recursion encountered
at /nix/store/22r7q7s9552gn1vpjigkbhfgcvhsrz68-source/lib/modules.nix:515:28:
514| addErrorContext (context name)
515| (args.${name} or config._module.args.${name})
| ^
516| ) (functionArgs f);
Any help is much appreciated. Thank you!