Skip to content

Commit e7dc36e

Browse files
committed
add .direnv folder to .gitignore
1 parent 6eb6ed2 commit e7dc36e

File tree

2 files changed

+35
-37
lines changed

2 files changed

+35
-37
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ next-env.d.ts
4242

4343
# test subset config
4444
packages/test-harness/testSubsetGrep.properties
45+
46+
# nix
47+
.direnv/

flake.nix

+32-37
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,41 @@
33

44
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
55

6-
outputs = { self, nixpkgs }:
6+
outputs =
7+
{ self, nixpkgs }:
78
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"
1314
];
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;
2720
in
2821
{
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+
);
4742
};
4843
}

0 commit comments

Comments
 (0)