mirror of
https://github.com/nix-community/home-manager
synced 2024-11-01 00:39:45 +01:00
f9f4c8e1e7
gallery-dl [1] is a cli to download image galleries from several image hosting sites. [1] https://github.com/mikf/gallery-dl
41 lines
937 B
Nix
41 lines
937 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.programs.gallery-dl;
|
|
|
|
jsonFormat = pkgs.formats.json { };
|
|
|
|
in {
|
|
meta.maintainers = [ maintainers.marsam ];
|
|
|
|
options.programs.gallery-dl = {
|
|
enable = mkEnableOption "gallery-dl";
|
|
|
|
settings = mkOption {
|
|
type = jsonFormat.type;
|
|
default = { };
|
|
example = literalExpression ''
|
|
{
|
|
extractor.base-directory = "~/Downloads";
|
|
}
|
|
'';
|
|
description = ''
|
|
Configuration written to
|
|
<filename>$XDG_CONFIG_HOME/gallery-dl/config.json</filename>. See
|
|
<link xlink:href="https://github.com/mikf/gallery-dl#configuration"/>
|
|
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;
|
|
};
|
|
};
|
|
}
|