diff --git a/README.md b/README.md index 2afe1c0b..3563733f 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,10 @@ With the virtual environment loaded, run the python file at "tagstudio/tagstudio 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`. +##### NixOS + +Use the provided `flake.nix` file to create and enter a working environment by running `nix develop`. Then, run the above `TagStudio.sh` script. + ## Usage ### Creating/Opening a Library diff --git a/TagStudio.sh b/TagStudio.sh index 82036413..cff969c3 100755 --- a/TagStudio.sh +++ b/TagStudio.sh @@ -1,5 +1,5 @@ -#! /bin/bash +#! /usr/bin/env bash python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt -python tagstudio/tagstudio.py \ No newline at end of file +python tagstudio/tagstudio.py diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..5dafd370 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1712473363, + "narHash": "sha256-TIScFAVdI2yuybMxxNjC4YZ/j++c64wwuKbpnZnGiyU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e89cf1c932006531f454de7d652163a9a5c86668", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..f827ba07 --- /dev/null +++ b/flake.nix @@ -0,0 +1,70 @@ +{ + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + outputs = { self, nixpkgs, }: + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + in { + devShells.x86_64-linux.default = pkgs.mkShell { + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ + pkgs.gcc-unwrapped + pkgs.zlib + pkgs.libglvnd + pkgs.glib + pkgs.stdenv.cc.cc + pkgs.fontconfig + pkgs.libxkbcommon + pkgs.xorg.libxcb + pkgs.freetype + pkgs.dbus + pkgs.qt6.qtwayland + pkgs.qt6.full + pkgs.qt6.qtbase + pkgs.zstd + ]; + buildInputs = with pkgs; [ + cmake + gdb + zstd + qt6.qtbase + qt6.full + qt6.qtwayland + qtcreator + python312Packages.pip + python312Full + python312Packages.virtualenv # run virtualenv . + python312Packages.pyusb # fixes the pyusb 'No backend available' when installed directly via pip + + libgcc + makeWrapper + bashInteractive + glib + libxkbcommon + freetype + binutils + dbus + coreutils + libGL + libGLU + fontconfig + xorg.libxcb + + + # this is for the shellhook portion + qt6.wrapQtAppsHook + makeWrapper + bashInteractive + ]; + # set the environment variables that Qt apps expect + shellHook = '' + export QT_QPA_PLATFORM=wayland + export LIBRARY_PATH=/usr/lib:/usr/lib64:$LIBRARY_PATH + # export LD_LIBRARY_PATH=${pkgs.stdenv.cc.cc.lib}/lib/:/run/opengl-driver/lib/ + export QT_PLUGIN_PATH=${pkgs.qt6.qtbase}/${pkgs.qt6.qtbase.qtPluginPrefix} + bashdir=$(mktemp -d) + makeWrapper "$(type -p bash)" "$bashdir/bash" "''${qtWrapperArgs[@]}" + exec "$bashdir/bash" + ''; + }; + }; +}