2023-01-10 09:35:00 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.gallery-dl;
|
|
|
|
|
|
|
|
jsonFormat = pkgs.formats.json { };
|
|
|
|
|
|
|
|
in {
|
2023-08-08 10:19:01 +00:00
|
|
|
meta.maintainers = [ ];
|
2023-01-10 09:35:00 +00:00
|
|
|
|
|
|
|
options.programs.gallery-dl = {
|
|
|
|
enable = mkEnableOption "gallery-dl";
|
|
|
|
|
2024-06-04 18:23:39 +00:00
|
|
|
package = mkPackageOption pkgs "gallery-dl" { };
|
|
|
|
|
2023-01-10 09:35:00 +00:00
|
|
|
settings = mkOption {
|
|
|
|
type = jsonFormat.type;
|
|
|
|
default = { };
|
|
|
|
example = literalExpression ''
|
|
|
|
{
|
|
|
|
extractor.base-directory = "~/Downloads";
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
description = ''
|
|
|
|
Configuration written to
|
2023-08-08 10:19:01 +00:00
|
|
|
{file}`$XDG_CONFIG_HOME/gallery-dl/config.json`. See
|
|
|
|
<https://github.com/mikf/gallery-dl#configuration>
|
2023-01-10 09:35:00 +00:00
|
|
|
for supported values.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2024-06-04 18:23:39 +00:00
|
|
|
home.packages = [ cfg.package ];
|
2023-01-10 09:35:00 +00:00
|
|
|
|
|
|
|
xdg.configFile."gallery-dl/config.json" = mkIf (cfg.settings != { }) {
|
|
|
|
source = jsonFormat.generate "gallery-dl-settings" cfg.settings;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|