-
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathflake.nix
More file actions
80 lines (75 loc) · 2.17 KB
/
flake.nix
File metadata and controls
80 lines (75 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{
description = "A Nix-flake-based development environment for Cursorless";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs =
{ self, nixpkgs }:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forEachSupportedSystem =
f:
nixpkgs.lib.genAttrs supportedSystems (
system:
f {
pkgs = import nixpkgs {
inherit system;
overlays = [
(final: prev: {
neovim = prev.neovim.override { withNodeJs = true; };
})
];
};
}
);
pythonVersion = builtins.replaceStrings [ "py" ] [
"python"
] (nixpkgs.lib.importTOML ./pyproject.toml).tool.ruff.target-version;
in
{
packages = forEachSupportedSystem (
{ pkgs }:
{
lua-language-server = pkgs.lua-language-server;
}
);
devShells = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.mkShell {
packages =
let
python = pkgs.${pythonVersion};
pythonPackages = pkgs."${pythonVersion}Packages";
in
[
pkgs.corepack
pkgs.vsce
pkgs.nodejs_20
pkgs.pre-commit
python
pkgs.lua-language-server # language server used by pre-commit hooks
pkgs.neovim
pkgs.luajitPackages.busted # for lua testing
pkgs.luarocks # pre-commit doesn't auto-install luarocks
pkgs.ps
];
# To prevent weird broken non-interactive bash terminal
buildInputs = [ pkgs.bashInteractive ];
shellHook = ''
if [ ! -f .git/hooks/pre-commit ]; then
echo "You can run 'pre-commit install' to install git commit hooks if you want them."
fi
pnpm install
PATH=${pkgs.lib.getBin pkgs.neovim}/bin:$PATH}
'';
};
}
);
};
}