-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f94e08
commit e43ea2a
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,6 @@ next-env.d.ts | |
|
||
# test subset config | ||
packages/test-harness/testSubsetGrep.properties | ||
|
||
# nix | ||
.direnv/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
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; }; }); | ||
pythonVersion = builtins.replaceStrings [ "py" ] [ | ||
"python" | ||
] (nixpkgs.lib.importTOML ./pyproject.toml).tool.ruff.target-version; | ||
in | ||
{ | ||
devShells = forEachSupportedSystem ( | ||
{ pkgs }: | ||
{ | ||
default = pkgs.mkShell { | ||
packages = | ||
let | ||
python = pkgs.${pythonVersion}; | ||
pythonPackages = pkgs."${pythonVersion}Packages"; | ||
in | ||
# neovim-wrapper = | ||
[ | ||
pkgs.corepack | ||
pkgs.vsce | ||
# https://github.com/NixOS/nixpkgs/pull/251418 | ||
(pkgs.pre-commit.overrideAttrs (previousAttrs: { | ||
makeWrapperArgs = '' | ||
--set PYTHONPATH $PYTHONPATH | ||
''; | ||
})) | ||
|
||
python | ||
]; | ||
# To prevent weird broken non-interactive bash terminal | ||
buildInputs = [ pkgs.bashInteractive ]; | ||
shellHook = '' | ||
if [ ! -f .git/hooks/pre-commit ]; then | ||
pre-commit install | ||
fi | ||
pnpm install | ||
''; | ||
}; | ||
} | ||
); | ||
}; | ||
} |