Files
nvim/flake.nix

84 lines
2.0 KiB
Nix
Raw Normal View History

{
2025-03-05 17:32:01 -03:00
description = "My Neovim configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2025-05-26 10:25:34 -03:00
blink-cmp = {
url = "github:Saghen/blink.cmp";
inputs.nixpkgs.follows = "nixpkgs";
};
go-grip = {
url = "github:guz013/go-grip";
inputs.nixpkgs.follows = "nixpkgs";
2024-12-12 18:28:23 -03:00
};
2025-05-26 10:25:34 -03:00
mdfmt = {
url = "github:moorereason/mdfmt";
flake = false;
};
};
outputs = {
self,
nixpkgs,
...
2024-12-06 20:18:37 -03:00
} @ inputs: let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
2024-12-06 20:18:37 -03:00
forAllSystems = f:
2025-08-30 13:38:53 -03:00
nixpkgs.lib.genAttrs systems (
system: let
pkgs = import nixpkgs {inherit system;};
in
f {
inherit pkgs;
2025-11-09 12:39:16 -03:00
inherit (pkgs) lib stdenv;
2025-08-30 13:38:53 -03:00
}
);
in {
formatter = forAllSystems ({pkgs, ...}: pkgs.alejandra);
2025-03-05 17:31:53 -03:00
2025-08-30 13:38:53 -03:00
packages = forAllSystems (
{
pkgs,
lib,
2025-11-09 12:39:16 -03:00
stdenv,
2025-08-30 13:38:53 -03:00
...
}: {
neovim = import ./package.nix {
inherit pkgs lib;
2025-11-09 12:39:16 -03:00
blink-cmp = inputs.blink-cmp.packages.${stdenv.hostPlatform.system}.default;
go-grip = inputs.go-grip.packages.${stdenv.hostPlatform.system}.default;
mdfmt = self.packages.${stdenv.hostPlatform.system}.mdfmt;
2025-08-30 13:38:53 -03:00
};
mdfmt = pkgs.buildGoModule {
name = "mdfmt";
src = inputs.mdfmt;
vendorHash = "sha256-JtYvDgjUoEc1Mp7Eq8lbu9jWI+RR9yBo4ujGY+J70J4=";
};
2025-11-09 12:39:16 -03:00
default = self.packages."${stdenv.hostPlatform.system}".neovim;
2025-08-30 13:38:53 -03:00
}
);
devShells = forAllSystems (
{pkgs, ...}: {
default = pkgs.mkShell {
buildInputs = with pkgs; [
stylua
];
};
}
);
2025-03-05 17:31:53 -03:00
nixosModules = {
neovim = import ./nixos.nix {inherit self;};
default = self.nixosModules.neovim;
};
2025-03-05 17:31:34 -03:00
homeManagerModules = {
neovim = import ./home.nix {inherit self;};
2025-03-05 17:31:34 -03:00
default = self.homeManagerModules.neovim;
};
};
}