How to get only one program from nixpkgs/master

I use flakes and follow nixpkgs/22.05.

A few hours ago neovim was updated to version 0.8 on nixpkgs/master.

How can I get still get all my programs from nixpkgs/22.05 but only neovim from nixpkgs/master?

I am pretty new to nix, so any help is appreciated! I am unable figure this out myself :frowning:
Just pointing me into the right direction would be great. Or maybe you know a github repo where something like this has been done.

Add nixpkgs/master to the inputs section of your flake, and use its neovim instead of the one on 22.05, e.g.

{
  inputs = {
    nixpkgs-22_05.url = "github:NixOS/nixpkgs/nixos-22.05";
    nixpkgs-master.url = "github:NixOS/nixpkgs/master";
  };

  outputs = { self, nixpkgs-22_05, nixpkgs-master }: {
    nixosConfigurations = {
      my-config = let
        system = "x86_64-linux";
      in
        nixpkgs-22_05.lib.nixosSystem {
          inherit system;
          modules = [
            {
              config.environment.systemPackages = [
                nixpkgs-master.legacyPackages.${system}.neovim
              ];
            }
          ];
        };
    };
  };
}

Please do not use this! This uses the 22.05 tag which is from may and will not change.

Instead always use the branch nixos-*.

1 Like

Oh you are right, thanks! Will update the post.

1 Like

Oh I was so close! Thank you very much @olmokramer! :smiley:

A cheap version to manage it in userland would be nix profile install nixpkgs#neovim, but it won’t update itself as the version is pinned to the current nixpkgs version when you ran the command.