summaryrefslogtreecommitdiffstats
path: root/lass
diff options
context:
space:
mode:
Diffstat (limited to 'lass')
-rw-r--r--lass/1systems/prism/config.nix1
-rw-r--r--lass/1systems/ubik/config.nix14
-rw-r--r--lass/2configs/baseX.nix64
-rw-r--r--lass/2configs/fonts.nix14
-rw-r--r--lass/2configs/matrix.nix80
-rw-r--r--lass/2configs/mpv.nix45
-rw-r--r--lass/2configs/themes.nix2
-rw-r--r--lass/2configs/websites/domsen.nix8
-rw-r--r--lass/2configs/weechat.nix2
-rw-r--r--lass/2configs/xmonad.nix2
-rw-r--r--lass/3modules/default.nix1
-rw-r--r--lass/5pkgs/weechat-matrix/default.nix80
-rw-r--r--lass/krops.nix29
13 files changed, 155 insertions, 187 deletions
diff --git a/lass/1systems/prism/config.nix b/lass/1systems/prism/config.nix
index e1f92c51e..1faa23ec3 100644
--- a/lass/1systems/prism/config.nix
+++ b/lass/1systems/prism/config.nix
@@ -138,6 +138,7 @@ with import <stockholm/lib>;
<stockholm/lass/2configs/services/coms/jitsi.nix>
<stockholm/lass/2configs/fysiirc.nix>
<stockholm/lass/2configs/bgt-bot>
+ <stockholm/lass/2configs/matrix.nix>
<stockholm/krebs/2configs/mastodon-proxy.nix>
{
services.tor = {
diff --git a/lass/1systems/ubik/config.nix b/lass/1systems/ubik/config.nix
index 1d836d4ec..b153c0d3b 100644
--- a/lass/1systems/ubik/config.nix
+++ b/lass/1systems/ubik/config.nix
@@ -14,13 +14,25 @@ with import <stockholm/lib>;
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPBFGMjH0+Dco6DVFZbByENMci8CFTLXCL7j53yctPnM";
};
- networking.firewall.allowedTCPPorts = [ 80 ];
+ security.acme = {
+ acceptTerms = true;
+ defaults.email = "acme@lassul.us";
+ };
+ networking.firewall.allowedTCPPorts = [ 80 443 ];
+
+ # nextcloud
+ services.nginx.virtualHosts."c.apanowicz.de" = {
+ enableACME = true;
+ forceSSL = true;
+ };
services.nextcloud = {
enable = true;
+ enableBrokenCiphersForSSE = false;
hostName = "c.apanowicz.de";
package = pkgs.nextcloud25;
config.adminpassFile = "/run/nextcloud.pw";
https = true;
+ maxUploadSize = "9001M";
};
systemd.services.nextcloud-setup.serviceConfig.ExecStartPre = [
"+${pkgs.writeDash "copy-pw" ''
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
diff --git a/lass/3modules/default.nix b/lass/3modules/default.nix
index 0e1a794ca..4082c8bd2 100644
--- a/lass/3modules/default.nix
+++ b/lass/3modules/default.nix
@@ -1,6 +1,7 @@
_:
{
imports = [
+ ../../submodules/disko/module.nix
./dnsmasq.nix
./drbd.nix
./folderPerms.nix
diff --git a/lass/5pkgs/weechat-matrix/default.nix b/lass/5pkgs/weechat-matrix/default.nix
deleted file mode 100644
index 40848caaa..000000000
--- a/lass/5pkgs/weechat-matrix/default.nix
+++ /dev/null
@@ -1,80 +0,0 @@
-{ python3Packages
-, lib
-, fetchFromGitHub
-}:
-
-with python3Packages;
-
-let
- scriptPython = python.withPackages (ps: with ps; [
- aiohttp
- requests
- python_magic
- ]);
-
- version = "lassulus-fork";
-in python3Packages.buildPythonPackage {
- pname = "weechat-matrix";
- inherit version;
-
- src = fetchFromGitHub {
- owner = "poljar";
- repo = "weechat-matrix";
- rev = version;
- hash = "sha256-o4kgneszVLENG167nWnk2FxM+PsMzi+PSyMUMIktZcc=";
- };
- # src = ./weechat-matrix;
-
- propagatedBuildInputs = [
- pyopenssl
- webcolors
- future
- atomicwrites
- attrs
- Logbook
- pygments
- matrix-nio
- aiohttp
- requests
- ];
-
- passthru.scripts = [ "matrix.py" ];
-
- dontBuild = true;
- doCheck = false;
-
- format = "other";
-
- installPhase = ''
- mkdir -p $out/share $out/bin
- cp main.py $out/share/matrix.py
-
- cp contrib/matrix_upload.py $out/bin/matrix_upload
- cp contrib/matrix_decrypt.py $out/bin/matrix_decrypt
- cp contrib/matrix_sso_helper.py $out/bin/matrix_sso_helper
- substituteInPlace $out/bin/matrix_upload \
- --replace '/usr/bin/env -S python3' '${scriptPython}/bin/python'
- substituteInPlace $out/bin/matrix_sso_helper \
- --replace '/usr/bin/env -S python3' '${scriptPython}/bin/python'
- substituteInPlace $out/bin/matrix_decrypt \
- --replace '/usr/bin/env python3' '${scriptPython}/bin/python'
-
- mkdir -p $out/${python.sitePackages}
- cp -r matrix $out/${python.sitePackages}/matrix
- '';
-
- dontPatchShebangs = true;
- postFixup = ''
- addToSearchPath program_PYTHONPATH $out/${python.sitePackages}
- patchPythonScript $out/share/matrix.py
- substituteInPlace $out/${python.sitePackages}/matrix/server.py --replace \"matrix_sso_helper\" \"$out/bin/matrix_sso_helper\"
- '';
-
- meta = with lib; {
- description = "A Python plugin for Weechat that lets Weechat communicate over the Matrix protocol";
- homepage = "https://github.com/poljar/weechat-matrix";
- license = licenses.isc;
- platforms = platforms.unix;
- maintainers = with maintainers; [ tilpner emily ];
- };
-}
diff --git a/lass/krops.nix b/lass/krops.nix
index c8a5b94b7..81c679c5e 100644
--- a/lass/krops.nix
+++ b/lass/krops.nix
@@ -5,16 +5,33 @@
pkgs
;
-
source = { test }: lib.evalSource ([
(krebs-source { test = test; })
{
nixos-config.symlink = "stockholm/lass/1systems/${name}/physical.nix";
- nixpkgs-unstable.git = {
- url = "https://github.com/nixos/nixpkgs";
- ref = (lib.importJSON ../krebs/nixpkgs-unstable.json).rev;
- shallow = true;
- };
+ nixpkgs = lib.mkForce (if test then {
+ derivation = let
+ rev = (lib.importJSON ../krebs/nixpkgs-unstable.json).rev;
+ sha256 = (lib.importJSON ../krebs/nixpkgs-unstable.json).sha256;
+ in ''
+ with import (builtins.fetchTarball {
+ url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
+ sha256 = "${sha256}";
+ }) {};
+ pkgs.fetchFromGitHub {
+ owner = "nixos";
+ repo = "nixpkgs";
+ rev = "${rev}";
+ sha256 = "${sha256}";
+ }
+ '';
+ } else {
+ git = {
+ ref = (lib.importJSON ../krebs/nixpkgs.json).rev;
+ url = https://github.com/NixOS/nixpkgs;
+ shallow = true;
+ };
+ });
secrets = if test then {
file = toString ./2configs/tests/dummy-secrets;
} else {