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
|
|
|
|
2024-03-06 18:43:55 +01:00
|
|
|
package = mkPackageOption pkgs "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 {
|
2024-03-06 18:43:55 +01:00
|
|
|
home.packages = [ cfg.package ];
|
2022-07-09 06:20:00 +02:00
|
|
|
|
|
|
|
xdg.configFile."gallery-dl/config.json" = mkIf (cfg.settings != { }) {
|
|
|
|
source = jsonFormat.generate "gallery-dl-settings" cfg.settings;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|