nvim/flake.nix

61 lines
1.5 KiB
Nix
Raw Normal View History

2024-02-19 16:58:17 +00:00
{
2024-02-21 02:52:23 +00:00
description = "Guanran928's Neovim configuration";
2024-02-19 16:58:17 +00:00
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
2024-03-09 05:30:37 +00:00
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
### De-dupe flake dependencies
systems.url = "github:nix-systems/default";
2024-02-19 16:58:17 +00:00
};
outputs = inputs:
2024-02-21 02:52:23 +00:00
inputs.flake-utils.lib.eachDefaultSystem (system: let
inherit (inputs.nixpkgs) lib;
pkgs = inputs.nixpkgs.legacyPackages.${system};
2024-03-09 05:30:37 +00:00
treefmtEval = inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
2024-02-21 02:52:23 +00:00
runtimeDeps = with pkgs; [
# mason / tree-sitter
gcc
cargo
2024-02-26 19:06:11 +00:00
nodejs
2024-02-21 06:54:29 +00:00
# telescope
ripgrep
fd
2024-02-21 02:52:23 +00:00
];
in {
2024-02-21 02:55:06 +00:00
### nix {run,shell,build}
2024-02-21 02:52:23 +00:00
packages.default =
pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped
(pkgs.neovimUtils.makeNeovimConfig {
customRC = ''
set runtimepath^=${./.}
source ${./.}/init.lua
'';
}
// {wrapperArgs = ["--prefix" "PATH" ":" "${lib.makeBinPath runtimeDeps}"];});
2024-02-19 16:58:17 +00:00
2024-02-21 02:55:06 +00:00
### nix fmt
2024-03-09 05:30:37 +00:00
formatter = treefmtEval.config.build.wrapper;
### nix flake check
checks = {formatting = treefmtEval.config.build.check inputs.self;};
2024-02-21 02:55:06 +00:00
### nix develop
2024-02-21 02:52:23 +00:00
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
stylua
];
};
});
2024-02-19 16:58:17 +00:00
}