2022-07-09 04:20:00 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.gallery-dl;
|
|
|
|
|
|
|
|
jsonFormat = pkgs.formats.json { };
|
|
|
|
|
|
|
|
in {
|
2023-06-22 08:16:28 +00:00
|
|
|
meta.maintainers = [ ];
|
2022-07-09 04:20:00 +00:00
|
|
|
|
|
|
|
options.programs.gallery-dl = {
|
2023-07-01 23:45:18 +00:00
|
|
|
enable = mkEnableOption "gallery-dl";
|
2022-07-09 04:20:00 +00:00
|
|
|
|
|
|
|
settings = mkOption {
|
|
|
|
type = jsonFormat.type;
|
|
|
|
default = { };
|
|
|
|
example = literalExpression ''
|
|
|
|
{
|
|
|
|
extractor.base-directory = "~/Downloads";
|
|
|
|
}
|
|
|
|
'';
|
2023-07-01 23:45:18 +00:00
|
|
|
description = ''
|
2022-07-09 04:20:00 +00:00
|
|
|
Configuration written to
|
2023-06-30 23:30:13 +00:00
|
|
|
{file}`$XDG_CONFIG_HOME/gallery-dl/config.json`. See
|
|
|
|
<https://github.com/mikf/gallery-dl#configuration>
|
2022-07-09 04:20:00 +00: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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|