From ba614307cdc027dddd9aee2fecdaac86336957eb Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 12 Mar 2021 20:10:27 +0100 Subject: ma omo.r: deploy airsonic,photoprism,metube --- makefu/1systems/omo/config.nix | 28 +++++++++++++++++++--------- makefu/1systems/omo/hw/omo.nix | 4 ++++ makefu/2configs/home/airsonic.nix | 29 +++++++++++++++++++++++++++++ makefu/2configs/home/metube.nix | 35 +++++++++++++++++++++++++++++++++++ makefu/2configs/home/photoprism.nix | 9 +++++---- 5 files changed, 92 insertions(+), 13 deletions(-) create mode 100644 makefu/2configs/home/airsonic.nix create mode 100644 makefu/2configs/home/metube.nix diff --git a/makefu/1systems/omo/config.nix b/makefu/1systems/omo/config.nix index a9e307ddf..a04593715 100644 --- a/makefu/1systems/omo/config.nix +++ b/makefu/1systems/omo/config.nix @@ -28,9 +28,11 @@ in { + + # @@ -68,7 +70,7 @@ in { # statistics - + # # Logging #influx + grafana @@ -91,13 +93,18 @@ in { - + + + + { makefu.ps3netsrv = { enable = true; servedir = "/media/cryptX/emu/ps3"; }; } + + { hardware.pulseaudio.systemWide = true; makefu.mpd.musicDirectory = "/media/cryptX/music"; @@ -107,7 +114,15 @@ in { # - + # + { + #krebs.rtorrent = { + # downloadDir = lib.mkForce "/media/cryptX/torrent"; + # extraConfig = '' + # upload_rate = 500 + # ''; + #}; + } # # @@ -118,16 +133,11 @@ in { # Temporary: # + ]; makefu.full-populate = true; nixpkgs.config.allowUnfree = true; - krebs.rtorrent = { - downloadDir = lib.mkForce "/media/cryptX/torrent"; - extraConfig = '' - upload_rate = 500 - ''; - }; users.groups.share = { gid = (import ).genid "share"; members = [ "makefu" "misa" ]; diff --git a/makefu/1systems/omo/hw/omo.nix b/makefu/1systems/omo/hw/omo.nix index 586ad98c4..ae5b778bf 100644 --- a/makefu/1systems/omo/hw/omo.nix +++ b/makefu/1systems/omo/hw/omo.nix @@ -51,6 +51,10 @@ in { enable = true; disks = map toMapper [ 0 1 3 ]; parity = toMapper 2; # find -name PARITY_PARTITION + extraConfig = '' + exclude /lib/storj/ + exclude /.bitcoin/blocks/ + ''; }; fileSystems = let cryptMount = name: 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; + } + ''; + }; +} diff --git a/makefu/2configs/home/metube.nix b/makefu/2configs/home/metube.nix new file mode 100644 index 000000000..c872bea08 --- /dev/null +++ b/makefu/2configs/home/metube.nix @@ -0,0 +1,35 @@ +{ pkgs, lib, ...}: +# docker run -d -p 8081:8081 -v /path/to/downloads:/downloads --user 1001:1001 alexta69/metube +with import ; +let + port = "2348"; + dl-dir = "/media/cryptX/youtube/music"; + uid = 20421; + internal-ip = "192.168.1.11"; +in + { + systemd.tmpfiles.rules = [ + "d ${dl-dir} metube nogroup - -" + ]; + virtualisation.oci-containers.backend = "docker"; + + services.nginx.virtualHosts."tube" = { + serverAliases = [ "tube.lan" ]; + locations."/".proxyPass = "http://localhost:${port}"; + }; + + virtualisation.oci-containers.containers.metube = { + image = "alexta69/metube:latest"; + ports = [ "${port}:8081" ]; + volumes = [ + "${dl-dir}:/downloads" + ]; + user = "metube"; + }; + users.users.metube.uid = uid; + + systemd.services.docker-metube.serviceConfig = { + StandardOutput = lib.mkForce "journal"; + StandardError = lib.mkForce "journal"; + }; +} diff --git a/makefu/2configs/home/photoprism.nix b/makefu/2configs/home/photoprism.nix index aaccd7350..ef4200576 100644 --- a/makefu/2configs/home/photoprism.nix +++ b/makefu/2configs/home/photoprism.nix @@ -16,8 +16,8 @@ let port = "2347"; photodir = "/media/cryptX/photos"; - statedir = "/var/lib/photoprism/appsrv"; - db-dir = "/var/lib/photoprism/mysql"; + statedir = "/media/cryptX/lib/photoprism/appsrv"; + db-dir = "/media/cryptX/lib/photoprism/mysql"; internal-ip = "192.168.1.11"; sec = import ; in @@ -97,6 +97,7 @@ in PHOTOPRISM_SITE_CAPTION = "FeMi Fotos"; PHOTOPRISM_SITE_DESCRIPTION = "Unsere Fotos"; PHOTOPRISM_SITE_AUTHOR = "FeMi"; + PHOTOPRISM_SPONSOR = "true"; }; }; @@ -135,11 +136,11 @@ in # }; #}; - systemd.services.photoprism.serviceConfig = { + systemd.services.docker-photoprism.serviceConfig = { StandardOutput = lib.mkForce "journal"; StandardError = lib.mkForce "journal"; }; - systemd.services.mysql-photoprism.serviceConfig = { + systemd.services.docker-mysql-photoprism.serviceConfig = { StandardOutput = lib.mkForce "journal"; StandardError = lib.mkForce "journal"; }; -- cgit v1.2.3