-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
64 lines (56 loc) · 1.74 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
56
57
58
59
60
61
62
63
{
inputs = {
# nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
};
outputs = { systems, nixpkgs, ... } @ inputs: let
eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
in {
devShells = eachSystem (pkgs: {
default = pkgs.mkShell {
buildInputs = with pkgs; [
python310Packages.python
python3Packages.pynput
];
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [
pkgs.fontconfig
pkgs.freetype
pkgs.xorg.libX11
pkgs.xorg.libxcb
pkgs.xorg.xcbutilwm
pkgs.xorg.xcbutilimage
pkgs.xorg.xcbutil
pkgs.xorg.xcbutilkeysyms
pkgs.xorg.xcbutilrenderutil
pkgs.libxkbcommon
pkgs.stdenv.cc.cc
pkgs.dbus
pkgs.libGL
pkgs.glib
pkgs.zlib
pkgs.python3
pkgs.python3Packages.pip
pkgs.xorg.xrandr
pkgs.xorg.libX11
pkgs.xorg.libXrandr
]}
export QT_PLUGIN_PATH=venv/lib/python3.10/site-packages/PyQt5/Qt5/plugins
# Create a virtual environment if not already created
if [ ! -d ".venv" ]; then
python3 -m venv .venv
fi
# Activate the virtual environment
source .venv/bin/activate
# Install non-Nix packages using pip
pip install --upgrade pip
pip install PyQt5
pip install opencv-python
pip install ultralytics
pip install pyinstaller
pip3 freeze > requirements.txt
'';
};
});
};
}