fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . programs . gallery-dl ; 8 9jsonFormat = pkgs . formats . json { }; 10 11in { 12meta . maintainers = [ ]; 13 14options . programs . gallery-dl = { 15enable = mkEnableOption "gallery-dl" ; 16 17settings = mkOption { 18type = jsonFormat . type ; 19default = { }; 20example = literalExpression '' 21{ 22extractor.base-directory = "~/Downloads"; 23} 24'' ; 25description = '' 26Configuration written to 27{file}`$XDG_CONFIG_HOME/gallery-dl/config.json`. See 28<https://github.com/mikf/gallery-dl#configuration> 29for supported values. 30'' ; 31}; 32}; 33 34config = mkIf cfg . enable { 35home . packages = [ pkgs . gallery-dl ]; 36 37xdg . configFile . "gallery-dl/config.json" = mkIf ( cfg . settings != { }) { 38source = jsonFormat . generate "gallery-dl-settings" cfg . settings ; 39}; 40}; 41}