-
-
Notifications
You must be signed in to change notification settings - Fork 227
nixvim: can't extend package #1379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
How are you creating the nixvim package? If you're using the "old" way documented in nixvim's docs ( However, if you're creating a nixvim configuration and reading its It is assumed that if you're using a nixvim configuration, you can use the configuration's |
Actually i use nixvim as standalone, you can check on my flake right here: https://gitlab.com/felipepinto-flakes/nixvim-wrapped |
You're using the new/experimental standalone template, not the old/documented standalone function. As above, that's why you don't have an Instead you should extend your nixvim configuration and use its package. |
Oh i see, im a bit confused how to proceed, is it the right way to add stylix as input to my nixvim flake? how should i add the makeNixivm? |
In your NixOS or Home Manager configuration, you want to extend your Nixvim configuration. This is just an example, I haven't checked the attrpaths are correct: { inputs, config, pkgs, ... }:
let
system = pkgs.stdenv.hostPlatform.system;
nixvimConfiguration = inputs.nixvim-config.nixvimConfigurations.${system}.default;
extendedNixvim nixvimConfiguration.extendModules {
modules = [
config.lib.stylix.nixvim.config
];
};
nixvimPackage = extendedNixvim.config.build.package;
in
{
home.packages = [
nixvimPackage
];
} Alternatively, you may find it simpler to use nixvim's home-manager module, and import your nixvimModule into it to reuse your config: { inputs, config, ... }:
{
imports = [
inputs.nixvim-config.inputs.nixvim.homeModules.default
];
programs.nixvim = {
enable = true;
imports = [
config.lib.stylix.nixvim.config
inputs.nixvim-config.nixvimModules.default
];
};
} These examples are probably full of typos as I just knocked them up quickly on my phone. |
I tried the following but got that the {
lib,
config,
pkgs,
inputs,
...
}:
let
cfg = config.modules.nvim;
inherit (pkgs.stdenv.hostPlatform) system;
nixvim = inputs.nixvim-wrapped.packages.${system}.default;
nvf = inputs.nixvim-wrapped.packages.${system}.default;
nixvim-extended =
(nixvim.extendModules { modules = [ config.lib.stylix.nixvim.config ]; }).config.build.package;
nvf-extended =
(nvf.extendModules { modules = [ config.lib.stylix.nvf.config ]; }).config.build.package;
inherit (config.modules) stylix;
in
{
options.modules.nvim = {
enable = lib.mkEnableOption "enable nvim configuration";
pkg = lib.mkOption {
type = lib.types.enum [
"nixvim"
"nvf"
];
default = "nixvim";
description = ''
chose which neovim configuration to use:
"nixvim" default and more reliable and more complete
"nvf" very new and very incomplete
'';
};
};
config = lib.mkIf cfg.enable {
environment = {
variables.EDITOR = "nvim";
systemPackages = [
(
if cfg.pkg == "nixvim" then
(if stylix.enable then nixvim-extended else nixvim)
else
(if stylix.enable then nvf-extended else nvf)
)
];
};
};
} |
I also tryied the hm but got another error:
this is the config: {
lib,
config,
pkgs,
inputs,
...
}:
let
cfg = config.modules.nvim;
inherit (pkgs.stdenv.hostPlatform) system;
# nixvim = inputs.nixvim-wrapped.packages.${system}.default;
# nvf = inputs.nixvim-wrapped.packages.${system}.default;
# nixvim-extended =
# (nixvim.extendModules { modules = [ config.lib.stylix.nixvim.config ]; }).config.build.package;
# nvf-extended =
# (nvf.extendModules { modules = [ config.lib.stylix.nvf.config ]; }).config.build.package;
inherit (config.modules) stylix;
in
{
imports = [
inputs.nixvim-wrapped.inputs.nixvim.homeModules.default
inputs.nvf-wrapped.inputs.nvf.homeModules.default
];
options.modules.nvim = {
enable = lib.mkEnableOption "enable nvim configuration";
pkg = lib.mkOption {
type = lib.types.enum [
"nixvim"
"nvf"
];
default = "nixvim";
description = ''
chose which neovim configuration to use:
"nixvim" default and more reliable and more complete
"nvf" very new and very incomplete
'';
};
};
config = lib.mkIf cfg.enable {
home.sessionVariables = {
EDITOR = "nvim";
};
programs = lib.mergeAttrs [
(lib.mkIf (cfg.pkg == "nixvim") {
nixvim = {
enable = true;
imports = [
inputs.nixvim-wrapped.nixvimModules.default
] ++ (lib.mkOptional stylix.enable config.lib.stylix.nixvim.config);
};
})
(lib.mkIf (cfg.pkg == "nvf") {
nvf = {
enable = true;
imports = [
inputs.nvf-wrapped.nvfModules.default
] ++ (lib.mkOptional stylix.enable config.lib.stylix.nvf.config);
};
})
];
};
} |
A configuration and a package are two different things. Here you're trying to use Your configurations are defined in your
This flake output was recently renamed in nixvim. If you have an up-to-date nixvim lock you should be able to use |
Oooh ok, well from this im confused how to reach the nixvim config from my computer configuration. im imported the wrapped nixvim as a flake input, how should i extend then? |
I assert that this issue is relevant for Stylix
Description
Followint the instructions on the manual i get the following error:
This is the config file in question:
flake.lock
Field can not be longer than 65536 characters
Installation Method
NixOS
System Information
"x86_64-linux"
Linux 6.12.28, NixOS, 25.11 (Xantusia), 25.11.20250518.292fa7d
yes
yes
nix-env (Nix) 2.28.3
"nixos"
/nix/store/wkjmkjrfr9ik1blw8zmv9g5xjl412py8-source
Notify maintainers
@trueNAHO
The text was updated successfully, but these errors were encountered: