-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a flake I have been using for development on a Nix box, which I've confirmed works to run pre-commit linting, correctly installs plugins, can debug extension, etc. ## Checklist - [-] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [-] I have not broken the cheatsheet Co-authored-by: Pokey Rule <[email protected]>
- Loading branch information
1 parent
4eca035
commit 35b1af8
Showing
4 changed files
with
87 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,56 @@ | ||
{ | ||
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 | ||
[ | ||
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 | ||
''; | ||
}; | ||
} | ||
); | ||
}; | ||
} |