From 408c41cee1c40a78ba40621caa9e2222d8376854 Mon Sep 17 00:00:00 2001 From: Leon Schumacher Date: Tue, 5 Nov 2024 22:15:09 +0100 Subject: [PATCH] CatgirlDownloader: create config in appropriate subdir --- packages/CatgirlDownloader/configdir.patch | 14 ++++++++++++++ .../default.nix} | 1 + 2 files changed, 15 insertions(+) create mode 100644 packages/CatgirlDownloader/configdir.patch rename packages/{CatgirlDownloader.nix => CatgirlDownloader/default.nix} (96%) diff --git a/packages/CatgirlDownloader/configdir.patch b/packages/CatgirlDownloader/configdir.patch new file mode 100644 index 0000000..38c7239 --- /dev/null +++ b/packages/CatgirlDownloader/configdir.patch @@ -0,0 +1,14 @@ +diff --git a/src/preferences.py b/src/preferences.py +index 0cdaa82e6b..c89c1112db 100644 +--- a/src/preferences.py ++++ b/src/preferences.py +@@ -8,7 +8,8 @@ + "nsfw": False, + } + self.directory = GLib.get_user_config_dir() +- self.file = os.path.join(self.directory, "config.json") ++ self.file = os.path.join(self.directory, "catgirldownloader/config.json") ++ os.makedirs(os.path.dirname(self.file), exist_ok = True) + if not os.path.exists(self.file): + f = open(self.file, "w+") + f.write(json.dumps(self.preferences)) diff --git a/packages/CatgirlDownloader.nix b/packages/CatgirlDownloader/default.nix similarity index 96% rename from packages/CatgirlDownloader.nix rename to packages/CatgirlDownloader/default.nix index be5b5d4..f35d196 100644 --- a/packages/CatgirlDownloader.nix +++ b/packages/CatgirlDownloader/default.nix @@ -8,6 +8,7 @@ pkgs: pkgs.stdenv.mkDerivation rec { rev = version; hash = "sha256-u5Rea2JkeLA5AOys9JfvLi6mfKbElbfZWdWVErUl1BU="; }; + patches = [ ./configdir.patch ]; nativeBuildInputs = with pkgs; [ desktop-file-utils