diff --git a/modules/programs/gallery-dl.nix b/modules/programs/gallery-dl.nix index accad55fb..4f566e18b 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 43d0daa9f..2cc94e1e0 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/";