gallery-dl: add module
gallery-dl [1] is a cli to download image galleries from several image hosting sites. [1] https://github.com/mikf/gallery-dl
This commit is contained in:
parent
4cfc0a1e02
commit
f9f4c8e1e7
7 changed files with 82 additions and 0 deletions
41
modules/programs/gallery-dl.nix
Normal file
41
modules/programs/gallery-dl.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{ 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue