diff options
Diffstat (limited to 'lass/2configs')
-rw-r--r-- | lass/2configs/baseX.nix | 64 | ||||
-rw-r--r-- | lass/2configs/fonts.nix | 14 | ||||
-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 | ||||
-rw-r--r-- | lass/2configs/xmonad.nix | 2 |
8 files changed, 117 insertions, 100 deletions
diff --git a/lass/2configs/baseX.nix b/lass/2configs/baseX.nix index 79777429a..654247728 100644 --- a/lass/2configs/baseX.nix +++ b/lass/2configs/baseX.nix @@ -14,6 +14,7 @@ in { ./tmux.nix ./xmonad.nix ./themes.nix + ./fonts.nix { users.users.mainUser.packages = [ pkgs.sshuttle @@ -26,15 +27,15 @@ in { options.lass.fonts = { regular = mkOption { type = types.str; - default = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1"; + default = "xft:Iosevka Term SS15:style=regular"; }; bold = mkOption { type = types.str; - default = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1"; + default = "xft:Iosevka Term SS15:style=bold"; }; italic = mkOption { type = types.str; - default = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1"; + default = "xft:Iosevka Term SS15:style=italic"; }; }; config.krebs.xresources.resources.X = '' @@ -100,63 +101,6 @@ in { '') ]; - fonts = { - fontDir.enable = true; - enableGhostscriptFonts = true; - - fonts = with pkgs; [ - xorg.fontschumachermisc - inconsolata - noto-fonts - (iosevka.override { - # https://typeof.net/Iosevka/customizer - privateBuildPlan = { - family = "Iosevka"; - spacing = "term"; - serifs = "slab"; - no-ligation = true; - - variants.design = { - capital-j = "serifless"; - a = "double-storey-tailed"; - b = "toothless-corner"; - d = "toothless-corner-serifless"; - f = "flat-hook-tailed"; - g = "earless-corner"; - i = "hooky"; - j = "serifless"; - l = "tailed"; - - m = "earless-corner-double-arch"; - n = "earless-corner-straight"; - p = "earless-corner"; - q = "earless-corner"; - r = "earless-corner"; - u = "toothless-rounded"; - y = "cursive-flat-hook"; - - one = "no-base-long-top-serif"; - two = "straight-neck"; - three = "flat-top"; - four = "open"; - six = "open-contour"; - seven = "straight-serifless"; - eight = "two-circles"; - nine = "open-contour"; - tilde = "low"; - asterisk = "hex-low"; - number-sign = "upright"; - at = "short"; - dollar = "open"; - percent = "dots"; - question = "corner-flat-hooked"; - }; - }; - set = "kookiefonts"; - }) - ]; - }; - services.udev.extraRules = '' SUBSYSTEM=="backlight", ACTION=="add", \ RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness", \ diff --git a/lass/2configs/fonts.nix b/lass/2configs/fonts.nix new file mode 100644 index 000000000..3d047e513 --- /dev/null +++ b/lass/2configs/fonts.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, ... }: +{ + fonts = { + fontDir.enable = true; + enableGhostscriptFonts = true; + + fonts = with pkgs; [ + xorg.fontschumachermisc + inconsolata + noto-fonts + (iosevka-bin.override { variant = "ss15"; }) + ]; + }; +} 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 = { diff --git a/lass/2configs/xmonad.nix b/lass/2configs/xmonad.nix index 1789725d1..e2d9cff5d 100644 --- a/lass/2configs/xmonad.nix +++ b/lass/2configs/xmonad.nix @@ -68,7 +68,7 @@ myTerm :: FilePath myTerm = "/run/current-system/sw/bin/alacritty" myFont :: String -myFont = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1" +myFont = "${config.lass.fonts.regular}" main :: IO () main = do |