nixos/services.tandoor-recipes: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-30 00:46:50 +02:00
parent 334d6eb492
commit cc25de02a5

View File

@ -1,6 +1,4 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
with lib;
let let
cfg = config.services.tandoor-recipes; cfg = config.services.tandoor-recipes;
pkg = cfg.package; pkg = cfg.package;
@ -11,7 +9,7 @@ let
DEBUG = "0"; DEBUG = "0";
DEBUG_TOOLBAR = "0"; DEBUG_TOOLBAR = "0";
MEDIA_ROOT = "/var/lib/tandoor-recipes"; MEDIA_ROOT = "/var/lib/tandoor-recipes";
} // optionalAttrs (config.time.timeZone != null) { } // lib.optionalAttrs (config.time.timeZone != null) {
TZ = config.time.timeZone; TZ = config.time.timeZone;
} // ( } // (
lib.mapAttrs (_: toString) cfg.extraConfig lib.mapAttrs (_: toString) cfg.extraConfig
@ -27,10 +25,10 @@ let
''; '';
in in
{ {
meta.maintainers = with maintainers; [ ambroisie ]; meta.maintainers = with lib.maintainers; [ ambroisie ];
options.services.tandoor-recipes = { options.services.tandoor-recipes = {
enable = mkOption { enable = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = false; default = false;
description = '' description = ''
@ -45,20 +43,20 @@ in
''; '';
}; };
address = mkOption { address = lib.mkOption {
type = types.str; type = lib.types.str;
default = "localhost"; default = "localhost";
description = "Web interface address."; description = "Web interface address.";
}; };
port = mkOption { port = lib.mkOption {
type = types.port; type = lib.types.port;
default = 8080; default = 8080;
description = "Web interface port."; description = "Web interface port.";
}; };
extraConfig = mkOption { extraConfig = lib.mkOption {
type = types.attrs; type = lib.types.attrs;
default = { }; default = { };
description = '' description = ''
Extra tandoor recipes config options. Extra tandoor recipes config options.
@ -71,10 +69,10 @@ in
}; };
}; };
package = mkPackageOption pkgs "tandoor-recipes" { }; package = lib.mkPackageOption pkgs "tandoor-recipes" { };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
systemd.services.tandoor-recipes = { systemd.services.tandoor-recipes = {
description = "Tandoor Recipes server"; description = "Tandoor Recipes server";