nix-community.nixvim/templates/simple/flake.nix

45 lines
1.1 KiB
Nix
Raw Normal View History

{
description = "A nixvim configuration";
inputs = {
nixvim.url = "github:nix-community/nixvim";
flake-utils.url = "github:numtide/flake-utils";
};
2023-07-14 21:44:31 +01:00
outputs = {
self,
2023-07-14 21:44:31 +01:00
nixpkgs,
nixvim,
flake-utils,
...
} @ inputs: let
config = import ./config; # import the module directly
in
flake-utils.lib.eachDefaultSystem (system: let
nixvimLib = nixvim.lib.${system};
2023-07-14 21:44:31 +01:00
pkgs = import nixpkgs {inherit system;};
nixvim' = nixvim.legacyPackages.${system};
nvim = nixvim'.makeNixvimWithModule {
inherit pkgs;
module = config;
# You can use `extraSpecialArgs` to pass additional arguments to your module files
extraSpecialArgs = {
inherit self;
};
};
2023-07-14 21:44:31 +01:00
in {
checks = {
# Run `nix flake check .` to verify that your config is not broken
default = nixvimLib.check.mkTestDerivationFromNvim {
inherit nvim;
name = "A nixvim configuration";
};
};
packages = {
# Lets you run `nix run .` to start nixvim
default = nvim;
};
});
}