mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
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.
54 lines
1.5 KiB
Nix
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
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|