-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
55 lines (50 loc) · 1.64 KB
/
flake.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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
};
outputs = { nixpkgs, systems, ... }:
let
forEachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
devShells = forEachSystem (system: {
default =
let
pkgs = import nixpkgs {
inherit system;
};
my-python = pkgs.python3.withPackages (ps: with ps; [
pip
]);
in
pkgs.mkShell {
buildInputs = [
# JS/TS
pkgs.nodejs
# You can set the major version of Node.js to a specific one instead of the default version
# pkgs.nodejs-19_x
# You can choose pnpm, yarn, bun, or none (npm).
# pkgs.nodePackages.pnpm
# pkgs.yarn
pkgs.bun
pkgs.typescript
pkgs.nodePackages.typescript-language-server
# Python
my-python
];
shellHook = ''
# Tells pip to put packages into $PIP_PREFIX instead of the usual locations.
# See https://pip.pypa.io/en/stable/user_guide/#environment-variables.
export PIP_PREFIX=$(${pkgs.coreutils}/bin/pwd)/_build/pip_packages
export PYTHONPATH="$PIP_PREFIX/${my-python.sitePackages}:$PYTHONPATH"
export PATH="$PIP_PREFIX/bin:$PATH"
unset SOURCE_DATE_EPOCH
pip install -r requirements.txt
# Install the npm packages
bun install
'';
};
});
};
}