Installing neovim 0.10 in NixOS 24.05 with home-manager #1772
-
Hi! I'm having a hard time specifying neovim 0.10. I building my own flake, and using NixOS 24.05 and home-manager 24.05. In my flake, I am able to specify unstable nixpkgs as an input. However, I am having a hard time understand how to correctly pass information from the Here's the contents of my {
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixvim.url = "github:nix-community/nixvim?rev=b64ee08d6b08b36b33fd1644b374ec2a5fd1a193";
nixvim.inputs.nixpkgs.follows = "nixpkgs-unstable";
home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, nixpkgs, nixvim, home-manager, ... }: {
nixosConfigurations = {
my-lenovo-pc = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./my-vms/my-lenovo-pc/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules = [
nixvim.homeManagerModules.nixvim
];
home-manager.users.eugene = import ./home.nix; # how do I make nixpkgs-unstable available inside home.nix?
}
];
};
};
};
} { config, pkgs, ... }: {
home.stateVersion = "24.05";
programs.nixvim = {
package = # what do I put here ???
enable = true;
enableMan = true;
defaultEditor = true;
};
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
You can use home-manager.extraSpecialArgs to pass in additional module args. In this case, your flake inputs. e.g. home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
+ home-manager.extraSpecialArgs = {inherit inputs;};
home-manager.sharedModules = [
nixvim.homeManagerModules.nixvim
];
home-manager.users.eugene = import ./home.nix; - { config, pkgs, ... }: {
+ { inputs, config, pkgs, ... }: {
home.stateVersion = "24.05";
programs.nixvim = {
- package = # what do I put here ???
+ package = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.neovim;
enable = true;
enableMan = true;
defaultEditor = true;
};
} You can make that more readable by doing something like this: { inputs, config, pkgs, ... }:
let
pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system};
in
{
home.stateVersion = "24.05";
programs.nixvim = {
package = pkgs-unnstable.neovim;
enable = true;
enableMan = true;
defaultEditor = true;
};
} Or you could pass pkgs-unstable as a module arg, instead of just - my-lenovo-pc = nixpkgs.lib.nixosSystem {
+ my-lenovo-pc = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
./my-vms/my-lenovo-pc/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
+ home-manager.extraSpecialArgs = {
+ pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system};
+ };
home-manager.sharedModules = [
nixvim.homeManagerModules.nixvim
];
home-manager.users.eugene = import ./home.nix; # how do I make nixpkgs-unstable available inside home.nix?
}
];
}; |
Beta Was this translation helpful? Give feedback.
-
@MattSturgeon thank you! That did indeed helped, I got past the flake evaluation phase, and entered the build neovim-0.10 phase. Now, and I suspect it's a totally different issue - the build for neovim 0.10 is failing. Would asking how to get past the build issue be out of scope of nixvim? If so, could direct me towards where to ask about the build issue? 🙏 I'm happy to report it to whoever might know more about this. Build log failure, just in case.
|
Beta Was this translation helpful? Give feedback.
You can use home-manager.extraSpecialArgs to pass in additional module args. In this case, your flake inputs.
e.g.
home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = {inherit inputs;}; home-manager.sharedModules = [ nixvim.homeManagerModules.nixvim ]; home-manager.users.eugene = import ./home.nix;
You can make t…