File tree Expand file tree Collapse file tree 3 files changed +77
-0
lines changed Expand file tree Collapse file tree 3 files changed +77
-0
lines changed Original file line number Diff line number Diff line change 1+ use flake
Original file line number Diff line number Diff line change 1+ {
2+ description = "A Nix-flake-based development environment for Cursorless" ;
3+
4+ inputs . nixpkgs . url = "github:NixOS/nixpkgs/nixpkgs-unstable" ;
5+
6+ outputs = { self , nixpkgs } :
7+ let
8+ overlays = [
9+ ( final : prev : rec {
10+ nodejs = prev . nodejs-18_x ;
11+ pnpm = prev . nodePackages . pnpm ;
12+ } )
13+ ] ;
14+ supportedSystems =
15+ [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ] ;
16+ forEachSupportedSystem = f :
17+ nixpkgs . lib . genAttrs supportedSystems ( system :
18+ f {
19+ pkgs = import nixpkgs {
20+ inherit overlays system ;
21+ config . allowUnfree = true ;
22+ } ;
23+ } ) ;
24+ pythonVersion = builtins . replaceStrings
25+ [ "py" ]
26+ [ "python" ]
27+ ( nixpkgs . lib . importTOML ./pyproject.toml ) . tool . ruff . target-version ;
28+ in
29+ {
30+ devShells = forEachSupportedSystem ( { pkgs } : {
31+ default = pkgs . mkShell {
32+ packages = with pkgs ; [
33+ nodejs
34+ pnpm
35+ pkgs . ${ pythonVersion }
36+ vsce
37+ pre-commit
38+ ] ;
39+ # To prevent weird broken non-interactive bash terminal
40+ buildInputs = [ pkgs . bashInteractive ] ;
41+ shellHook = ''
42+ if [ ! -f .git/hooks/pre-commit ]; then
43+ pre-commit install
44+ fi
45+ '' ;
46+ } ;
47+ } ) ;
48+ } ;
49+ }
You can’t perform that action at this time.
0 commit comments