osbm-nvim/flake.nix
2024-12-14 03:21:29 +03:00

69 lines
1.5 KiB
Nix

{
description = "NixVim config heavily inspired by AstroNvim";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Nix formatting pack
# https://gerschtli.github.io/nix-formatter-pack/nix-formatter-pack-options.html
nix-formatter-pack = {
url = "github:Gerschtli/nix-formatter-pack";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ nixpkgs
, nixvim
, nix-formatter-pack
, ...
}:
let
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
in
{
formatter = forAllSystems (system:
nix-formatter-pack.lib.mkFormatter {
pkgs = nixpkgs.legacyPackages.${system};
config.tools = {
deadnix.enable = true;
nixpkgs-fmt.enable = true;
statix.enable = true;
};
}
);
packages = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
mkNixvim = specialArgs:
nixvim.legacyPackages.${system}.makeNixvimWithModule {
inherit pkgs;
module = ./.;
extraSpecialArgs = specialArgs // {
inherit pkgs;
};
};
in
{
default = mkNixvim { };
lite = mkNixvim { withLSP = false; };
}
);
};
}