1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00:00
home-manager/modules/programs/gallery-dl.nix
2023-06-22 10:16:28 +02:00

41 lines
918 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.gallery-dl;
jsonFormat = pkgs.formats.json { };
in {
meta.maintainers = [ ];
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;
};
};
}