1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-16 08:09:45 +01:00
home-manager/modules/programs/gallery-dl.nix

44 lines
936 B
Nix
Raw Normal View History

{ 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";
2024-03-06 18:43:55 +01:00
package = mkPackageOption pkgs "gallery-dl" { };
settings = mkOption {
type = jsonFormat.type;
default = { };
example = literalExpression ''
{
extractor.base-directory = "~/Downloads";
}
'';
description = ''
Configuration written to
{file}`$XDG_CONFIG_HOME/gallery-dl/config.json`. See
<https://github.com/mikf/gallery-dl#configuration>
for supported values.
'';
};
};
config = mkIf cfg.enable {
2024-03-06 18:43:55 +01:00
home.packages = [ cfg.package ];
xdg.configFile."gallery-dl/config.json" = mkIf (cfg.settings != { }) {
source = jsonFormat.generate "gallery-dl-settings" cfg.settings;
};
};
}