Skip to content

Commit 10b1ca1

Browse files
author
nix
committed
update cache dir for read onyl nix store
1 parent 0b6b02c commit 10b1ca1

File tree

2 files changed

+27
-30
lines changed

2 files changed

+27
-30
lines changed

flake.nix

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@
1717
qt5.wrapQtAppsHook
1818
libsForQt5.breeze-qt5
1919
libsForQt5.qt5ct
20-
customPythonPackages.pkgs.opencv4
21-
customPythonPackages.pkgs.simplification
2220
(python39.withPackages (p: with p; [
23-
coloredlogs
24-
cryptography
25-
matplotlib
26-
mpv
27-
pillow
28-
pip
29-
playsound
30-
pynput
31-
pyqt5
32-
pyqtgraph
33-
pyyaml
34-
scipy
35-
screeninfo
36-
GitPython
21+
customPythonPackages.pkgs.opencv4
22+
customPythonPackages.pkgs.simplification
23+
customPythonPackages.pkgs.coloredlogs
24+
customPythonPackages.pkgs.cryptography
25+
customPythonPackages.pkgs.matplotlib
26+
customPythonPackages.pkgs.mpv
27+
customPythonPackages.pkgs.pillow
28+
customPythonPackages.pkgs.pip
29+
customPythonPackages.pkgs.playsound
30+
customPythonPackages.pkgs.pynput
31+
customPythonPackages.pkgs.pyqt5
32+
customPythonPackages.pkgs.pyqtgraph
33+
customPythonPackages.pkgs.pyyaml
34+
customPythonPackages.pkgs.scipy
35+
customPythonPackages.pkgs.screeninfo
36+
customPythonPackages.pkgs.GitPython
3737
]))
3838
];
3939
libPath = pkgs.lib.makeLibraryPath mtfgDependencies;
@@ -65,28 +65,22 @@
6565
pkgs.python39.override { inherit packageOverrides; self = customPythonPackages; };
6666
in
6767
{
68-
packages.${system}.mtfg = pkgs.stdenv.mkDerivation {
69-
pname = "MTFG";
68+
packages.${system}.mtfg = pkgs.python39Packages.buildPythonPackage {
69+
pname = "funscript-editor";
7070
version = "0.5.3";
7171
src = pkgs.fetchgit {
7272
url = "https://github.com/michael-mueller-git/Python-Funscript-Editor.git";
73-
rev = "5b049018f20f8d3e90413d663e47c7120dec99a7";
74-
sha256 = "sha256-q2ew4rmZV7G5HgoQq4ZAuEf+GRMVuq+K+yc/WBEWsPM=";
73+
rev = "0b6b02c1c57ceb970197a7215d910115a18d4056";
74+
sha256 = "sha256-bdaPoDQEykKC8Y5bJ/SfiVj4JJhaXVvBMMqHzSix7ZQ=";
7575
};
76-
buildInputs = mtfgDependencies;
76+
propagatedBuildInputs = mtfgDependencies;
77+
QT_QPA_PLATFORM = "xcb";
7778
nativeBuildInputs = with pkgs; [
7879
makeWrapper
79-
python39Packages.wrapPython
8080
];
81-
QT_QPA_PLATFORM = "xcb";
8281
postInstall = ''
83-
mkdir -p "$out/bin"
84-
cp -rfv "$src/." "$out"
85-
cp -rfv "$out/main.py" "$out/bin/MTFG"
86-
chmod +x "$out/bin/MTFG"
87-
wrapPythonPrograms $out
82+
wrapProgram "$out/bin/funscript-editor" --prefix LD_LIBRARY_PATH : "${libPath}" --prefix PATH : "${binPath}"
8883
'';
89-
9084
};
9185
defaultPackage.${system} = self.packages.x86_64-linux.mtfg;
9286
formatter.${system} = pkgs.nixpkgs-fmt;

funscript_editor/definitions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
###############
1313

1414
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
15-
CACHE_DIR = os.path.join(ROOT_DIR, 'cache')
15+
if os.path.abspath(__file__).starts_with("/nix"):
16+
CACHE_DIR = '/tmp/cache'
17+
else:
18+
CACHE_DIR = os.path.join(ROOT_DIR, 'cache')
1619
CONFIG_DIR = os.path.join(ROOT_DIR, 'config')
1720
UI_DIR = os.path.join(ROOT_DIR, 'ui')
1821
ICON_PATH = os.path.join(CONFIG_DIR, 'icon.png')

0 commit comments

Comments
 (0)