Need help with using stand alone flake in systemPackages #2277
-
I am trying to migrate to flakes for the past couple of days. {
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self, nixpkgs, ... }@inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
};
in
{
nixosConfigurations = {
myNixos = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs system;
};
modules = [
./configuration.nix
{
environment.systemPackages =[
inputs.nixvim.packages.${system}.default
];
}
];
};
};
};
} I am trying to use the stand-alone Nixvim flake in my sytemPackages.
The stand-alone Nixvim flake defently contains a package called Please help :-) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Your nixvim input is pointing to our flake, however it sounds like you have your own flake you wish to use. Your error is telling you that You should be able to fix your issue by changing your nixvim input to point to your new standalone nixvim flake, instead of ours. As a sidenote: it is not required to use separate flakes in order to have a standalone nixvim build. Personally I have both a nixosConfiguration and a standalone nixvim package as two outputs on my flake, I also pass |
Beta Was this translation helpful? Give feedback.
-
For future googlers, here is the final solution: {
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim.url = "./nixvim";
};
outputs =
{ self, nixpkgs, ... }@inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
};
in
{
nixosConfigurations = {
myNixos = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs system;
};
modules = [
./configuration.nix
{
environment.systemPackages =[
inputs.nixvim.packages.${system}.default
];
}
];
};
};
};
} |
Beta Was this translation helpful? Give feedback.
Your nixvim input is pointing to our flake, however it sounds like you have your own flake you wish to use.
Your error is telling you that
inputs.nixvim.packages.${system}.default
does not exist, which is correct, becausegithub:nix-community/nixvim
does not have apackages.*.default
flake output.You should be able to fix your issue by changing your nixvim input to point to your new standalone nixvim flake, instead of ours.
As a sidenote: it is not required to use separate flakes in order to have a standalone nixvim build. Personally I have both a nixosConfiguration and a standalone nixvim package as two outputs on my flake, I also pass
self.packages.${system}.nvim
to myenvironment.syst…