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