Error adding standalone flake package to configuiration

Im trying to build a standalone package for my neovim configuration, have been folowing tutorials and the manual and i got it runnig when using nix run . on dir, now im trying to add it to my configuration but im not sure how to do it and the way i did, im getting an error saying the path to neovim doesnt exist, my configuration is on a git repo and my neovim flake is in another which is a submodule of the main repo. everything is checked out with main branch, what am i doing wrong?
configuration flake

{
  description = "Nixos config flake";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    neovim.url = "path:./flakes/neovim";
  };

  outputs = { self, nixpkgs, ... }@inputs: 
    let
      system = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${system};
    in
  {
    nixosConfigurations = { 
      user = nixpkgs.lib.nixosSystem {
        specialArgs = {inherit inputs;};
        modules = [
	  { environment.systemPackages = [ inputs.neovim.defaultPackage.${system} ]; }
          inputs.home-manager.nixosModules.default
          ./hosts/user/configuration.nix
        ];
      };
    };
  };
}

package flake

{
  description = "my neovim config using nvf";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    nvf.url = "github:notashelf/nvf";
  };

  outputs = { self, nixpkgs, ... }@inputs: 
    let
      system = "x86_64-linux";
    in
  {
    packages.${system}.default = 
      ( inputs.nvf.lib.neovimConfiguration {
          inherit (nixpkgs.legacyPackages.${system}) pkgs;
  	modules = [ ./nvf-configuration.nix ];
      }).neovim;
  };
}

Normally I’d say put ?submodules=1 at the end of the URL, but using a path: type URL will of course break that. You could try to use git: or git+file://, but I don’t recall if local git repos support the submodules parameter or not.
Also, subflakes don’t work particularly well either prior to nix 2.26, I’d suggest simply not using those.

1 Like

Oh i will try those thanks,
its my first time creating a flake other than my first configuration so im pretty confused how it all comes together. i read that the recommended way to create a nvim configuration would be a standalone one, am i doing this right? what would then be your recommended way to implement this?

My suggestion: don’t use submodules and don’t use subflakes.
If you want to put stuff in a separate flake, feel free to do so.

this means that i should just build my neovim config as a module?

Btw i must say that setting the path to neovim.url = "git+file://full/path/to/flake?submodules=1" worked,
there was also another fix at
{environment.systemPackages = [ inputs.neovim.packages.${system}.default ]}
for everything to build alright