diff options
Diffstat (limited to 'lass/2configs')
-rw-r--r-- | lass/2configs/baseX.nix | 1 | ||||
-rw-r--r-- | lass/2configs/matrix.nix | 80 | ||||
-rw-r--r-- | lass/2configs/mpv.nix | 45 | ||||
-rw-r--r-- | lass/2configs/themes.nix | 2 | ||||
-rw-r--r-- | lass/2configs/websites/domsen.nix | 8 | ||||
-rw-r--r-- | lass/2configs/weechat.nix | 2 |
6 files changed, 98 insertions, 40 deletions
diff --git a/lass/2configs/baseX.nix b/lass/2configs/baseX.nix index bb01d3dcd..654247728 100644 --- a/lass/2configs/baseX.nix +++ b/lass/2configs/baseX.nix @@ -99,7 +99,6 @@ in { ${pkgs.flameshot}/bin/flameshot gui ${pkgs.klem}/bin/klem '') - ]; services.udev.extraRules = '' diff --git a/lass/2configs/matrix.nix b/lass/2configs/matrix.nix new file mode 100644 index 000000000..cdcbe7ab0 --- /dev/null +++ b/lass/2configs/matrix.nix @@ -0,0 +1,80 @@ +{ config, pkgs, ... }: +with import <stockholm/lib>; +{ + services.matrix-synapse = { + # synapse 1.60.0 errors during startup with: + # https://github.com/matrix-org/synapse/issues/15809 + package = pkgs.matrix-synapse.overrideAttrs (oldAttrs: rec { + version = "1.85.2"; + name = "matrix-synapse-${version}"; + src = pkgs.fetchFromGitHub { + owner = "matrix-org"; + repo = "synapse"; + rev = "v${version}"; + hash = "sha256-pFafBsisBPfpDnFYWcimUuBgfFVPZzLna3yHeqIBAAE="; + }; + cargoDeps = pkgs.rustPlatform.fetchCargoTarball { + inherit src; + name = "matrix-synapse-${version}"; + hash = "sha256-dnno+5Ma0YNYpmj3oZ5UG22uAanKwVT67BwQW+mHoFc="; + }; + doCheck = false; + }); + enable = true; + settings = { + server_name = "lassul.us"; + # registration_shared_secret = "yolo"; + database.name = "sqlite3"; + turn_uris = [ + "turn:turn.matrix.org?transport=udp" + "turn:turn.matrix.org?transport=tcp" + ]; + listeners = [ + { + port = 8008; + bind_addresses = [ "::1" ]; + type = "http"; + tls = false; + x_forwarded = true; + resources = [ + { + names = [ "client" ]; + compress = true; + } + { + names = [ "federation" ]; + compress = false; + } + ]; + } + ]; + }; + }; + services.nginx = { + virtualHosts = { + "lassul.us" = { + locations."= /.well-known/matrix/server".extraConfig = '' + add_header Content-Type application/json; + return 200 '${builtins.toJSON { + "m.server" = "matrix.lassul.us:443"; + }}'; + ''; + locations."= /.well-known/matrix/client".extraConfig = '' + add_header Content-Type application/json; + add_header Access-Control-Allow-Origin *; + return 200 '${builtins.toJSON { + "m.homeserver" = { "base_url" = "https://matrix.lassul.us"; }; + "m.identity_server" = { "base_url" = "https://vector.im"; }; + }}'; + ''; + }; + "matrix.lassul.us" = { + forceSSL = true; + enableACME = true; + locations."/_matrix" = { + proxyPass = "http://[::1]:8008"; + }; + }; + }; + }; +} diff --git a/lass/2configs/mpv.nix b/lass/2configs/mpv.nix index f88d0d91d..b11e54c2c 100644 --- a/lass/2configs/mpv.nix +++ b/lass/2configs/mpv.nix @@ -1,28 +1,10 @@ { pkgs, lib, ... }: let - - download_subs = pkgs.writers.writePython3 "download_sub" { - libraries = [ pkgs.python3Packages.subliminal ]; - } '' - from subliminal import download_best_subtitles, scan_video - from babelfish import Language - import sys - - video_filename = sys.argv[1] - - vid = scan_video(video_filename) - try: - sub = download_best_subtitles([vid], {Language('eng')})[vid][0] - - filename = '/tmp/' + vid.title + '.srt' - - with open(filename, 'wb+') as file: - file.write(sub.content) - - print(filename) - except: # noqa - print("/dev/null") + dl_subs = pkgs.writers.writeDashBin "dl_subs" '' + filename=$1 + ${pkgs.subdl}/bin/subdl --output='/tmp/{m}.{M}.sub' "$filename" 1>&2 + echo "/tmp/$(basename "$filename").sub" ''; autosub = pkgs.writeText "autosub.lua" '' @@ -39,10 +21,9 @@ let function download() log('Searching subtitles ...', 10) - table = { args = {"${download_subs}", mp.get_property('path')} } - result = utils.subprocess(table) + path = mp.get_property('path') + result = utils.subprocess({ args = {"${dl_subs}/bin/dl_subs", path} }) if result.error == nil then - -- remove trailing newline from subtitle filename filename = string.gsub(result.stdout, "\n", "") log(filename) mp.commandv('sub_add', filename) @@ -78,6 +59,8 @@ let mpvInput = pkgs.writeText "mpv.input" '' : script-binding console/enable + x add audio-delay -0.050 + X add audio-delay 0.050 ''; mpvConfig = pkgs.writeText "mpv.conf" '' @@ -89,14 +72,7 @@ let paths = [ (pkgs.writeDashBin "mpv" '' set -efu - if [ -n "''${DISPLAY+x}" ]; then - Y_RES=$(${pkgs.xorg.xrandr}/bin/xrandr | - ${pkgs.jc}/bin/jc --xrandr | - ${pkgs.jq}/bin/jq '.screens[0].current_width' - ) - else - Y_RES=1000 - fi + Y_RES=1081 # we need to disable sponsorblock local database because of # https://github.com/po5/mpv_sponsorblock/issues/31 exec ${pkgs.mpv.override { @@ -105,7 +81,6 @@ let youtube-quality ]; }}/bin/mpv \ - -vo=gpu \ --no-config \ --input-conf=${mpvInput} \ --include=${mpvConfig} \ @@ -113,6 +88,7 @@ let --ytdl-format="best[height<$Y_RES]" \ --script-opts=ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp \ --script-opts-append=sponsorblock-local_database=no \ + --audio-channels=2 \ "$@" '') pkgs.mpv @@ -122,5 +98,6 @@ let in { environment.systemPackages = [ mpv + dl_subs ]; } diff --git a/lass/2configs/themes.nix b/lass/2configs/themes.nix index e9f83deea..60e2f7aec 100644 --- a/lass/2configs/themes.nix +++ b/lass/2configs/themes.nix @@ -15,7 +15,7 @@ ${pkgs.coreutils}/bin/chown lass:users /var/theme/current_theme ${pkgs.xorg.xrdb}/bin/xrdb -merge /var/theme/config/xresources ${pkgs.procps}/bin/pkill -HUP xsettingsd - ${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme "$(cat /var/theme/config/gtk-theme)" + ${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme "$(cat /var/theme/config/gtk-theme)" || : else echo "theme $1 not found" fi diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index 90a0a5a72..c57fb5907 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -29,8 +29,10 @@ in { (servePage [ "apanowicz.de" "www.apanowicz.de" ]) (servePage [ "reich-gebaeudereinigung.de" "www.reich-gebaeudereinigung.de" ]) (servePage [ "illustra.de" "www.illustra.de" ]) - (servePage [ "nirwanabluete.de" "www.nirwanabluete.de" ]) + (servePage [ "event-extra.de" "www.event-extra.de" ]) + # (servePage [ "nirwanabluete.de" "www.nirwanabluete.de" ]) (servePage [ "familienrat-hamburg.de" "www.familienrat-hamburg.de" ]) + (servePage [ "karlaskop.de" ]) (servePage [ "freemonkey.art" "www.freemonkey.art" @@ -58,7 +60,6 @@ in { "factscloud.ubikmedia.de" "illucloud.ubikmedia.de" "joemisch.ubikmedia.de" - "karlaskop.ubikmedia.de" "nb.ubikmedia.de" "youthtube.ubikmedia.de" "weirdwednesday.ubikmedia.de" @@ -103,8 +104,9 @@ in { }; services.nextcloud = { enable = true; + enableBrokenCiphersForSSE = false; hostName = "o.xanf.org"; - package = pkgs.nextcloud24; + package = pkgs.nextcloud25; config = { adminpassFile = "/run/nextcloud.pw"; overwriteProtocol = "https"; diff --git a/lass/2configs/weechat.nix b/lass/2configs/weechat.nix index 845a7e3b8..10ca013f8 100644 --- a/lass/2configs/weechat.nix +++ b/lass/2configs/weechat.nix @@ -3,7 +3,7 @@ weechat-configured = pkgs.weechat-declarative.override { config = { scripts = [ - pkgs.weechat-matrix + pkgs.weechatScripts.weechat-matrix pkgs.weechatScripts.wee-slack ]; settings = { |