Skip to content

Commit ad6fefb

Browse files
authored
Merge pull request #35 from dakota-marshall/nixos-support
Add NixOS Dev Environment Support
2 parents 4a55af6 + 4184848 commit ad6fefb

File tree

4 files changed

+103
-2
lines changed

4 files changed

+103
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ With the virtual environment loaded, run the python file at "tagstudio/tagstudio
103103

104104
Run the "TagStudio.sh" script, and the program should launch! (Make sure that the script is marked as executable). Note that launching from the script from outside of a terminal will not launch a terminal window with any debug or crash information. If you wish to see this information, just launch the shell script directly from your terminal with `sh TagStudio.sh`.
105105

106+
##### NixOS
107+
108+
Use the provided `flake.nix` file to create and enter a working environment by running `nix develop`. Then, run the above `TagStudio.sh` script.
109+
106110
## Usage
107111

108112
### Creating/Opening a Library

TagStudio.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#! /bin/bash
1+
#! /usr/bin/env bash
22
python3 -m venv .venv
33
source .venv/bin/activate
44
pip install -r requirements.txt
5-
python tagstudio/tagstudio.py
5+
python tagstudio/tagstudio.py

flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
3+
4+
outputs = { self, nixpkgs, }:
5+
let
6+
pkgs = nixpkgs.legacyPackages.x86_64-linux;
7+
in {
8+
devShells.x86_64-linux.default = pkgs.mkShell {
9+
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
10+
pkgs.gcc-unwrapped
11+
pkgs.zlib
12+
pkgs.libglvnd
13+
pkgs.glib
14+
pkgs.stdenv.cc.cc
15+
pkgs.fontconfig
16+
pkgs.libxkbcommon
17+
pkgs.xorg.libxcb
18+
pkgs.freetype
19+
pkgs.dbus
20+
pkgs.qt6.qtwayland
21+
pkgs.qt6.full
22+
pkgs.qt6.qtbase
23+
pkgs.zstd
24+
];
25+
buildInputs = with pkgs; [
26+
cmake
27+
gdb
28+
zstd
29+
qt6.qtbase
30+
qt6.full
31+
qt6.qtwayland
32+
qtcreator
33+
python312Packages.pip
34+
python312Full
35+
python312Packages.virtualenv # run virtualenv .
36+
python312Packages.pyusb # fixes the pyusb 'No backend available' when installed directly via pip
37+
38+
libgcc
39+
makeWrapper
40+
bashInteractive
41+
glib
42+
libxkbcommon
43+
freetype
44+
binutils
45+
dbus
46+
coreutils
47+
libGL
48+
libGLU
49+
fontconfig
50+
xorg.libxcb
51+
52+
53+
# this is for the shellhook portion
54+
qt6.wrapQtAppsHook
55+
makeWrapper
56+
bashInteractive
57+
];
58+
# set the environment variables that Qt apps expect
59+
shellHook = ''
60+
export QT_QPA_PLATFORM=wayland
61+
export LIBRARY_PATH=/usr/lib:/usr/lib64:$LIBRARY_PATH
62+
# export LD_LIBRARY_PATH=${pkgs.stdenv.cc.cc.lib}/lib/:/run/opengl-driver/lib/
63+
export QT_PLUGIN_PATH=${pkgs.qt6.qtbase}/${pkgs.qt6.qtbase.qtPluginPrefix}
64+
bashdir=$(mktemp -d)
65+
makeWrapper "$(type -p bash)" "$bashdir/bash" "''${qtWrapperArgs[@]}"
66+
exec "$bashdir/bash"
67+
'';
68+
};
69+
};
70+
}

0 commit comments

Comments
 (0)