-
This may be not strictly related to flake-parts project, but I've decided to ask there nevertheless. How do I enable several nixpkgs channels in my flake? 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: 3 comments
-
As per nixvim maintainer reply on this issue:
Is there a way to accomplish this without using overlays or complicated config setup? |
Beta Was this translation helpful? Give feedback.
-
what you need is |
Beta Was this translation helpful? Give feedback.
-
Resolved with overlays: {
description = "A NeoVim configuration system for NixOS";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-master.url = "github:nixos/nixpkgs/master";
nixvim = {
url =
"github:nix-community/nixvim?rev=c0ea106b4bdf8707837bb0d80efd6affbc128bdf";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, 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, system, ... }:
let
nvim = nixvim.legacyPackages.${system}.makeNixvimWithModule {
inherit pkgs;
module = config;
};
in {
_module.args.pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
(final: _prev: {
stable = import inputs.nixpkgs-stable {
inherit (final) system;
config.allowUnfree = true;
};
})
(final: _prev: {
master = import inputs.nixpkgs-master {
inherit (final) system;
config.allowUnfree = true;
};
})
];
};
packages.default = nvim; # 'nix run .' to start nixvim
};
};
} |
Beta Was this translation helpful? Give feedback.
Resolved with overlays: