|
3 | 3 |
|
4 | 4 | inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; |
5 | 5 |
|
6 | | - outputs = { self, nixpkgs }: |
| 6 | + outputs = |
| 7 | + { self, nixpkgs }: |
7 | 8 | let |
8 | | - overlays = [ |
9 | | - (final: prev: rec { |
10 | | - nodejs = prev.nodejs-18_x; |
11 | | - pnpm = prev.nodePackages.pnpm; |
12 | | - }) |
| 9 | + supportedSystems = [ |
| 10 | + "x86_64-linux" |
| 11 | + "aarch64-linux" |
| 12 | + "x86_64-darwin" |
| 13 | + "aarch64-darwin" |
13 | 14 | ]; |
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 | | - }; |
22 | | - }); |
23 | | - pythonVersion = builtins.replaceStrings |
24 | | - [ "py" ] |
25 | | - [ "python" ] |
26 | | - (nixpkgs.lib.importTOML ./pyproject.toml).tool.ruff.target-version; |
| 15 | + forEachSupportedSystem = |
| 16 | + f: nixpkgs.lib.genAttrs supportedSystems (system: f { pkgs = import nixpkgs { inherit system; }; }); |
| 17 | + pythonVersion = builtins.replaceStrings [ "py" ] [ |
| 18 | + "python" |
| 19 | + ] (nixpkgs.lib.importTOML ./pyproject.toml).tool.ruff.target-version; |
27 | 20 | in |
28 | 21 | { |
29 | | - devShells = forEachSupportedSystem ({ pkgs }: { |
30 | | - default = pkgs.mkShell { |
31 | | - packages = with pkgs; [ |
32 | | - nodejs |
33 | | - pnpm |
34 | | - pkgs.${pythonVersion} |
35 | | - vsce |
36 | | - pre-commit |
37 | | - ]; |
38 | | - # To prevent weird broken non-interactive bash terminal |
39 | | - buildInputs = [ pkgs.bashInteractive ]; |
40 | | - shellHook = '' |
41 | | - if [ ! -f .git/hooks/pre-commit ]; then |
42 | | - pre-commit install |
43 | | - fi |
44 | | - ''; |
45 | | - }; |
46 | | - }); |
| 22 | + devShells = forEachSupportedSystem ( |
| 23 | + { pkgs }: |
| 24 | + { |
| 25 | + default = pkgs.mkShell { |
| 26 | + packages = with pkgs; [ |
| 27 | + corepack |
| 28 | + pkgs.${pythonVersion} |
| 29 | + vsce |
| 30 | + pre-commit |
| 31 | + ]; |
| 32 | + # To prevent weird broken non-interactive bash terminal |
| 33 | + buildInputs = [ pkgs.bashInteractive ]; |
| 34 | + shellHook = '' |
| 35 | + if [ ! -f .git/hooks/pre-commit ]; then |
| 36 | + pre-commit install |
| 37 | + fi |
| 38 | + ''; |
| 39 | + }; |
| 40 | + } |
| 41 | + ); |
47 | 42 | }; |
48 | 43 | } |
0 commit comments