mirror of
https://github.com/nix-community/home-manager
synced 2024-11-13 00:17:10 +00:00
gallery-dl: add package option
This commit is contained in:
parent
8d9fde0fba
commit
f240015a3a
2 changed files with 6 additions and 2 deletions
|
@ -14,6 +14,8 @@ in {
|
||||||
options.programs.gallery-dl = {
|
options.programs.gallery-dl = {
|
||||||
enable = mkEnableOption "gallery-dl";
|
enable = mkEnableOption "gallery-dl";
|
||||||
|
|
||||||
|
package = mkPackageOption pkgs "gallery-dl" { };
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = jsonFormat.type;
|
type = jsonFormat.type;
|
||||||
default = { };
|
default = { };
|
||||||
|
@ -32,7 +34,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ pkgs.gallery-dl ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
xdg.configFile."gallery-dl/config.json" = mkIf (cfg.settings != { }) {
|
xdg.configFile."gallery-dl/config.json" = mkIf (cfg.settings != { }) {
|
||||||
source = jsonFormat.generate "gallery-dl-settings" cfg.settings;
|
source = jsonFormat.generate "gallery-dl-settings" cfg.settings;
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{ ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.gallery-dl = {
|
programs.gallery-dl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
package = config.lib.test.mkStubPackage { };
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
cache.file = "~/gallery-dl/cache.sqlite3";
|
cache.file = "~/gallery-dl/cache.sqlite3";
|
||||||
extractor.base-directory = "~/gallery-dl/";
|
extractor.base-directory = "~/gallery-dl/";
|
||||||
|
|
Loading…
Reference in a new issue