nixos/services.ympd: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-30 00:46:39 +02:00
parent 9d80afc3c4
commit f600d6a3b1

View File

@ -1,7 +1,4 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.ympd;
in {
@ -12,26 +9,26 @@ in {
services.ympd = {
enable = mkEnableOption "ympd, the MPD Web GUI";
enable = lib.mkEnableOption "ympd, the MPD Web GUI";
webPort = mkOption {
type = types.either types.str types.port; # string for backwards compat
webPort = lib.mkOption {
type = lib.types.either lib.types.str lib.types.port; # string for backwards compat
default = "8080";
description = "The port where ympd's web interface will be available.";
example = "ssl://8080:/path/to/ssl-private-key.pem";
};
mpd = {
host = mkOption {
type = types.str;
host = lib.mkOption {
type = lib.types.str;
default = "localhost";
description = "The host where MPD is listening.";
};
port = mkOption {
type = types.port;
port = lib.mkOption {
type = lib.types.port;
default = config.services.mpd.network.port;
defaultText = literalExpression "config.services.mpd.network.port";
defaultText = lib.literalExpression "config.services.mpd.network.port";
description = "The port where MPD is listening.";
example = 6600;
};
@ -44,7 +41,7 @@ in {
###### implementation
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
systemd.services.ympd = {
description = "Standalone MPD Web GUI written in C";