nix-community.nixvim/templates/experimental-flake-parts/flake.nix
Matt Sturgeon 342161bf52
templates: add experimental-flake-parts template
This template uses the lower-level `evalNixvim` function to work
directly with nixvim configurations, instead of the prior idiom of using
`makeNixvim` to produce nixvim packages.

Additionally, the template is build on flake.parts, and demonstrates
using our recently added flakeModules.
2025-01-21 18:29:33 +00:00

54 lines
1.5 KiB
Nix

{
description = "A nixvim configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixvim.url = "github:nix-community/nixvim";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs =
{ self, flake-parts, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
imports = [
# Import nixvim's flake-parts module;
# Adds `flake.nixvimModules` and `perSystem.nixvimConfigurations`
inputs.nixvim.flakeModules.default
];
nixvim = {
# Automatically install corresponding packages for each nixvimConfiguration
# Lets you run `nix run .#<name>`, or simply `nix run` if you have a default
packages.enable = true;
# Automatically install checks for each nixvimConfiguration
# Run `nix flake check` to verify that your config is not broken
checks.enable = true;
};
# You can define your reusable Nixvim modules here
flake.nixvimModules = {
default = ./config;
};
perSystem =
{ system, ... }:
{
# You can define actual Nixvim configurations here
nixvimConfigurations = {
default = inputs.nixvim.lib.evalNixvim {
inherit system;
modules = [
self.nixvimModules.default
];
};
};
};
};
}