diff options
author | makefu <github@syntax-fehler.de> | 2021-03-12 20:10:27 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2021-03-12 20:10:39 +0100 |
commit | ba614307cdc027dddd9aee2fecdaac86336957eb (patch) | |
tree | bda38bc2a0e4099511d63a05ed855807193f12b5 /makefu/2configs/home/airsonic.nix | |
parent | 27e182f7f878721c665b92b287e0d5f8da5bd06a (diff) |
ma omo.r: deploy airsonic,photoprism,metube
Diffstat (limited to 'makefu/2configs/home/airsonic.nix')
-rw-r--r-- | makefu/2configs/home/airsonic.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/makefu/2configs/home/airsonic.nix b/makefu/2configs/home/airsonic.nix new file mode 100644 index 000000000..15e77438d --- /dev/null +++ b/makefu/2configs/home/airsonic.nix @@ -0,0 +1,29 @@ +{ config, ... }: +let + internal-ip = "192.168.1.11"; + port = 4040; +in +{ + # networking.firewall.allowedTCPPorts = [ 4040 ]; + services.airsonic = { + enable = true; + listenAddress = "0.0.0.0"; + inherit port; + }; + state = [ config.services.airsonic.home ]; + services.nginx.virtualHosts."airsonic" = { + serverAliases = [ + "airsonic.lan" + "music" "music.lan" + "musik" "musik.lan" + ]; + + locations."/".proxyPass = "http://localhost:${toString port}"; + locations."/".proxyWebsockets = true; + extraConfig = '' + if ( $server_addr != "${internal-ip}" ) { + return 403; + } + ''; + }; +} |