This repository has been archived by the owner on Nov 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshell.nix
60 lines (57 loc) · 1.69 KB
/
shell.nix
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
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs { };
python = pkgs.python39;
projectDir = builtins.path { path = ./.; name = "geostore"; };
poetryEnv = pkgs.poetry2nix.mkPoetryEnv {
inherit python projectDir;
overrides = pkgs.poetry2nix.overrides.withDefaults (self: super: {
filelock = super.filelock.overridePythonAttrs (
# In poetry2nix >1.39.1
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.hatchling self.hatch-vcs ];
}
);
python-ulid = super.python-ulid.overridePythonAttrs (
# In poetry2nix >1.39.1
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.setuptools-scm ];
}
);
virtualenv = super.virtualenv.overridePythonAttrs (
# https://github.com/nix-community/poetry2nix/pull/985
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.hatchling self.hatch-vcs ];
}
);
});
};
in
poetryEnv.env.overrideAttrs (
oldAttrs: {
buildInputs = [
pkgs.cacert
pkgs.cargo
pkgs.docker
pkgs.gitFull
pkgs.go
pkgs.niv
pkgs.nodejs
pkgs.python39Packages.pip
pkgs.python39Packages.pip-tools
(pkgs.poetry.override {
inherit python;
})
pkgs.which
];
shellHook = ''
. ${projectDir + "/activate-dev-env.bash"}
ln --force --no-dereference --symbolic ${poetryEnv} .venv
cat <<'EOF'
Welcome to the Geostore development environment!
Please run `npm install` to install Node.js packages, if you haven't already.
You should now be able to run `cdk` and `pytest`.
EOF
'';
}
)