Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

export DIRENV_WARN_TIMEOUT=20s

eval "$(devenv direnvrc)"

use devenv

if [[ -d .devenv/state/venv/bin ]]; then
PATH_add .devenv/state/venv/bin
fi
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,5 @@ fabric.properties
env-*/
venv/
raytracing/_version.py
.devenv/
.direnv/
65 changes: 65 additions & 0 deletions devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1774957469,
"narHash": "sha256-YkzJi44ntRLRNTmkQoABnQU0oxQjKaOHRm0bp0uxUuI=",
"owner": "cachix",
"repo": "devenv",
"rev": "7ea7c651664ea1526387a68d66a9f4e7f17dc146",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"nixpkgs": {
"inputs": {
"nixpkgs-src": "nixpkgs-src"
},
"locked": {
"lastModified": 1774287239,
"narHash": "sha256-W3krsWcDwYuA3gPWsFA24YAXxOFUL6iIlT6IknAoNSE=",
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "fa7125ea7f1ae5430010a6e071f68375a39bd24c",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs-src": {
"flake": false,
"locked": {
"lastModified": 1773840656,
"narHash": "sha256-9tpvMGFteZnd3gRQZFlRCohVpqooygFuy9yjuyRL2C0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9cf7092bdd603554bd8b63c216e8943cf9b12512",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
57 changes: 57 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{ pkgs, lib, ... }:

let
python = pkgs.python312;
pythonPackages = python.pkgs;
in
{
packages = [
python
pythonPackages.tkinter
pkgs.tk
pkgs.tcl
pkgs.stdenv.cc.cc.lib
pkgs.zlib
pkgs.libGL
pkgs.xorg.libX11
pkgs.xorg.libXext
pkgs.xorg.libXrender
pkgs.xorg.libSM
pkgs.xorg.libICE
];

env = {
VENV_DIR = ".devenv/state/venv";
PIP_DISABLE_PIP_VERSION_CHECK = "1";
PYTHONNOUSERSITE = "1";
TCL_LIBRARY = "${pkgs.tcl}/lib/tcl${pkgs.tcl.version}";
TK_LIBRARY = "${pkgs.tk}/lib/tk${pkgs.tk.version}";
LD_LIBRARY_PATH = lib.makeLibraryPath [
pkgs.stdenv.cc.cc.lib
pkgs.zlib
pkgs.libGL
pkgs.xorg.libX11
pkgs.xorg.libXext
pkgs.xorg.libXrender
pkgs.xorg.libSM
pkgs.xorg.libICE
];
};

enterShell = ''
echo "RayTracing devenv"
echo "Python $(${python}/bin/python --version | cut -d' ' -f2)"

if [ ! -x "$VENV_DIR/bin/python" ]; then
${python}/bin/python -m venv --system-site-packages "$VENV_DIR"
fi

. "$VENV_DIR/bin/activate"

python -m ensurepip --upgrade >/dev/null 2>&1 || true
python -m pip install --upgrade pip setuptools wheel build >/dev/null
python -m pip install --upgrade -e ".[gui]" pillow basedpyright ruff >/dev/null

export PATH="$PWD/$VENV_DIR/bin:$PATH"
'';
}
Loading