mirror of
https://github.com/kmein/niveum
synced 2026-03-18 02:51:08 +01:00
feat(toum): add tuner website
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
playlists = import <niveum/lib/mpd-playlists.nix>;
|
||||
playlistFiles = lib.mapAttrs (name: m3u: pkgs.writeText "${name}.m3u" m3u) playlists;
|
||||
playlists = import <niveum/lib/playlists.nix>;
|
||||
playlistFiles = lib.mapAttrs (name: {tracks, ...}: pkgs.writeText "${name}.m3u" (builtins.concatStringsSep "\n" (map ({url, ...}: url) tracks))) playlists;
|
||||
linkPlaylist = name: file: ''
|
||||
ln -sfn "${toString file}" "/var/lib/mpd/playlists/${name}.m3u"
|
||||
'';
|
||||
|
||||
24
configs/tuner.nix
Normal file
24
configs/tuner.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
tunerHTML = pkgs.callPackage <niveum/packages/tuner.nix> {
|
||||
playlists = import <niveum/lib/playlists.nix>;
|
||||
};
|
||||
in
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedTlsSettings = true;
|
||||
|
||||
virtualHosts.default = {
|
||||
locations."= /tuner".extraConfig = ''
|
||||
default_type text/html;
|
||||
alias ${tunerHTML};
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
}
|
||||
Reference in New Issue
Block a user