From f240015a3a2e03370cb86a820909af14ec1ed35a Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Thu, 7 Mar 2024 00:43:55 +0700 Subject: [PATCH] gallery-dl: add package option --- modules/programs/gallery-dl.nix | 4 +++- tests/modules/programs/gallery-dl/gallery-dl.nix | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/programs/gallery-dl.nix b/modules/programs/gallery-dl.nix index accad55f..4f566e18 100644 --- a/modules/programs/gallery-dl.nix +++ b/modules/programs/gallery-dl.nix @@ -14,6 +14,8 @@ in { options.programs.gallery-dl = { enable = mkEnableOption "gallery-dl"; + package = mkPackageOption pkgs "gallery-dl" { }; + settings = mkOption { type = jsonFormat.type; default = { }; @@ -32,7 +34,7 @@ in { }; config = mkIf cfg.enable { - home.packages = [ pkgs.gallery-dl ]; + home.packages = [ cfg.package ]; xdg.configFile."gallery-dl/config.json" = mkIf (cfg.settings != { }) { source = jsonFormat.generate "gallery-dl-settings" cfg.settings; diff --git a/tests/modules/programs/gallery-dl/gallery-dl.nix b/tests/modules/programs/gallery-dl/gallery-dl.nix index 43d0daa9..2cc94e1e 100644 --- a/tests/modules/programs/gallery-dl/gallery-dl.nix +++ b/tests/modules/programs/gallery-dl/gallery-dl.nix @@ -1,9 +1,11 @@ -{ ... }: +{ config, ... }: { programs.gallery-dl = { enable = true; + package = config.lib.test.mkStubPackage { }; + settings = { cache.file = "~/gallery-dl/cache.sqlite3"; extractor.base-directory = "~/gallery-dl/";