-
This may be not strictly related to nixvim project, but I've decided to ask there nevertheless. How do I enable several nixpkgs channels in my nixvim config? I've tried this config, but it returns error: {
description = "A NeoVim configuration system for NixOS";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.11";
nixvim.url =
"github:nix-community/nixvim?rev=bb64e79de67a212edf082fd330bc5a954aded0ba";
nixvim.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = { self, nixpkgs, nixpkgs-stable, nixvim, flake-parts, ... }@inputs:
let config = import ./main.nix; # nixvim config file
in flake-parts.lib.mkFlake { inherit inputs; } {
systems =
[ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
perSystem = { pkgs, pkgs-stable, system, ... }:
let
nvim = nixvim.legacyPackages.${system}.makeNixvimWithModule {
inherit pkgs pkgs-stable;
module = config;
};
in {
_module.args.pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
_module.args.pkgs-stable = import nixpkgs-stable {
inherit system;
config.allowUnfree = true;
};
packages.default = nvim; # 'nix run .' to start nixvim
};
};
}
Any help is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The nice way to do this is by using overlays, where you would override the unstable version with the one fetched from stable |
Beta Was this translation helpful? Give feedback.
-
I think in your case the issue is that flake-parts is hardcoded to do some special processing on the input |
Beta Was this translation helpful? Give feedback.
I think in your case the issue is that flake-parts is hardcoded to do some special processing on the input
nixpkgs
, butpkgs-stable
is not such an input. You would need to ask around the flake-parts community on how to deal with this idiom if you don't wan't to use overlays.