From 18e089be7feb381d5fb7defb1648706d64c5c7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Sat, 18 May 2024 18:53:34 -0400 Subject: [PATCH 1/2] nixos/navidrome: fix settings type --- nixos/modules/services/audio/navidrome.nix | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/audio/navidrome.nix b/nixos/modules/services/audio/navidrome.nix index ca1cd6ca43af..a592d3be1022 100644 --- a/nixos/modules/services/audio/navidrome.nix +++ b/nixos/modules/services/audio/navidrome.nix @@ -7,7 +7,12 @@ let inherit (lib) mkEnableOption mkPackageOption mkOption maintainers; - inherit (lib.types) bool str; + inherit (lib.types) + bool + port + str + submodule + ; cfg = config.services.navidrome; settingsFormat = pkgs.formats.json { }; in @@ -20,10 +25,22 @@ in package = mkPackageOption pkgs "navidrome" { }; settings = mkOption { - type = settingsFormat.type; - default = { - Address = "127.0.0.1"; - Port = 4533; + type = submodule { + freeformType = settingsFormat.type; + + options = { + Address = mkOption { + default = "127.0.0.1"; + description = "Address to run Navidrome on."; + type = str; + }; + + Port = mkOption { + default = 4533; + description = "Port to run Navidrome on."; + type = port; + }; + }; }; example = { MusicFolder = "/mnt/music"; From a74fd69291a5c3b82a363ff5a1625ba6b0ff9935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Sat, 18 May 2024 19:21:33 -0400 Subject: [PATCH 2/2] nixos/navidrome: run nixfmt-rfc-style --- nixos/modules/services/audio/navidrome.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/audio/navidrome.nix b/nixos/modules/services/audio/navidrome.nix index a592d3be1022..c986692076ad 100644 --- a/nixos/modules/services/audio/navidrome.nix +++ b/nixos/modules/services/audio/navidrome.nix @@ -6,7 +6,12 @@ }: let - inherit (lib) mkEnableOption mkPackageOption mkOption maintainers; + inherit (lib) + mkEnableOption + mkPackageOption + mkOption + maintainers + ; inherit (lib.types) bool port @@ -151,5 +156,5 @@ in networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.settings.Port ]; }; - meta.maintainers = with maintainers; [ nu-nu-ko ]; + meta.maintainers = with maintainers; [ nu-nu-ko ]; }