This repository was archived by the owner on Jan 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
51 lines (43 loc) · 1.35 KB
/
flake.nix
File metadata and controls
51 lines (43 loc) · 1.35 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
{
description = "Flake do bb-wrapper";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgsAllowUnfree = import nixpkgs {
system = "x86_64-linux";
config = { allowUnfree = true; };
};
config = {
projectDir = ./.;
};
in
{
devShell = pkgsAllowUnfree.mkShell {
buildInputs = with pkgsAllowUnfree; [
gnumake
poetry
python39
];
shellHook = ''
# TODO: documentar esse comportamento,
# devo abrir issue no github do nixpkgs
export TMPDIR=/tmp
# O PyCharm ativa por padrão o ambiente virtual.
# Esse comando cria o .venv caso não exista e
# ativa o .venv.
# Notar que pode haver dessincronia por conta de
# um .venv desatualizado.
test -f .venv/bin/activate || make poetry.config.venv && make poetry.install
source .venv/bin/activate
# Se não existir cria o .env com valores padrão
if ! test -f .env; then
make config.env
fi
echo "Entering the nix devShell no income back"
'';
};
});
}