-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathflake.nix
More file actions
65 lines (62 loc) · 1.57 KB
/
Copy pathflake.nix
File metadata and controls
65 lines (62 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
dev-python = {
url = "github:agoose77/dev-flakes/v10?dir=python";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
dev-python,
}: let
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
in {
devShells = forAllSystems (system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
# Configure the hook for enabling venvs
# I think there's a way to auto-detect this, but
# let's worry about that another time
python = pkgs.python313;
venvHook =
dev-python.packages.${system}.nix-ld-venv-hook.override
{python = python;};
packages =
[
python
venvHook
]
++ (with pkgs; [
cmake
ninja
gcc
pre-commit
# Infra packages
nodejs_22
pnpm
playwright-driver.browsers
go-jsonnet
]);
# Unset these unwanted env vars
# PYTHONPATH bleeds from Nix Python packages
unwantedEnvPreamble = ''
unset SOURCE_DATE_EPOCH PYTHONPATH
'';
in {
default = pkgs.mkShell {
inherit packages;
venvDir = ".venv";
# Drop bad env vars on activation
postShellHook = unwantedEnvPreamble;
env = {
PLAYWRIGHT_BROWSERS_PATH = "${pkgs.playwright-driver.browsers}";
PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS = "1";
};
};
});
};
}