nixvim/flake.nix
Wael Nasreddine 0f42b0eebb
treewide: format all files (#57)
Run `nix fmt` at the root of the repository to format all files. I've
done this on my fork and this will help me merge your changes later
without having to deal with un-formatted files.
2024-11-26 09:47:49 +01:00

70 lines
1.6 KiB
Nix

{
description = "deCort.tech NeoVim configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
nixvim = {
url = "github:nix-community/nixvim";
};
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
};
};
outputs =
{
nixpkgs,
nixvim,
flake-parts,
pre-commit-hooks,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"aarch64-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
perSystem =
{
system,
pkgs,
self',
lib,
...
}:
let
nixvim' = nixvim.legacyPackages.${system};
nvim = nixvim'.makeNixvimWithModule {
inherit pkgs;
module = ./config;
};
in
{
checks = {
default = pkgs.nixvimLib.check.mkTestDerivationFromNvim {
inherit nvim;
name = "A nixvim configuration";
};
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
statix.enable = true;
nixfmt-rfc-style.enable = true;
};
};
};
formatter = pkgs.nixfmt-rfc-style;
packages.default = nvim;
devShells = {
default = with pkgs; mkShell { inherit (self'.checks.pre-commit-check) shellHook; };
};
};
};
}