summaryrefslogtreecommitdiffstats
path: root/lass/2configs
diff options
context:
space:
mode:
Diffstat (limited to 'lass/2configs')
-rw-r--r--lass/2configs/binary-cache/server.nix6
-rw-r--r--lass/2configs/games.nix6
-rw-r--r--lass/2configs/home-media.nix11
-rw-r--r--lass/2configs/paste.nix42
-rw-r--r--lass/2configs/snapclient.nix12
-rw-r--r--lass/2configs/snapserver.nix13
6 files changed, 85 insertions, 5 deletions
diff --git a/lass/2configs/binary-cache/server.nix b/lass/2configs/binary-cache/server.nix
index 1abf51ae..30bef513 100644
--- a/lass/2configs/binary-cache/server.nix
+++ b/lass/2configs/binary-cache/server.nix
@@ -1,6 +1,8 @@
-{ config, lib, pkgs, stockholm, ...}:
-
+{ config, lib, pkgs, ...}:
{
+ nixpkgs.config.packageOverrides = p: {
+ nix-serve = p.haskellPackages.nix-serve-ng;
+ };
# generate private key with:
# nix-store --generate-binary-cache-key my-secret-key my-public-key
services.nix-serve = {
diff --git a/lass/2configs/games.nix b/lass/2configs/games.nix
index 26707f1f..01941bde 100644
--- a/lass/2configs/games.nix
+++ b/lass/2configs/games.nix
@@ -70,10 +70,10 @@ in {
# steam-run
# scummvm
# dolphinEmu
- # doom1
- # doom2
+ doom1
+ doom2
# protontricks
- # vdoom1
+ vdoom1
# vdoom2
# vdoomserver
retroarchBare
diff --git a/lass/2configs/home-media.nix b/lass/2configs/home-media.nix
index f250ca8d..f3908e6b 100644
--- a/lass/2configs/home-media.nix
+++ b/lass/2configs/home-media.nix
@@ -20,4 +20,15 @@ with import <stockholm/lib>;
krebs.iptables.tables.filter.INPUT.rules = [
{ predicate = "-p tcp --dport 4713"; target = "ACCEPT"; } # pulseaudio
];
+
+ environment.systemPackages = [
+ (pkgs.writers.writeDashBin "snapmpv" ''
+ /run/current-system/sw/bin/mpv \
+ --audio-display=no --audio-channels=stereo \
+ --audio-samplerate=48000 --audio-format=s16 \
+ --ao-pcm-file=/run/snapserver/snapfifo --ao=pcm \
+ --audio-delay=-1 \
+ "$@"
+ '')
+ ];
}
diff --git a/lass/2configs/paste.nix b/lass/2configs/paste.nix
index affc3530..cfd7f557 100644
--- a/lass/2configs/paste.nix
+++ b/lass/2configs/paste.nix
@@ -61,6 +61,11 @@ with import <stockholm/lib>;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:${toString config.krebs.htgen.paste.port};
'';
+ locations."/form".extraConfig = ''
+ client_max_body_size 4G;
+ proxy_set_header Host $host;
+ proxy_pass http://127.0.0.1:${toString config.krebs.htgen.paste-form.port};
+ '';
locations."/image".extraConfig = ''
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -86,6 +91,43 @@ with import <stockholm/lib>;
". ${pkgs.htgen}/examples/paste"
];
};
+
+ systemd.services.paste-gc = {
+ startAt = "daily";
+ serviceConfig = {
+ ExecStart = ''
+ ${pkgs.findutils}/bin/find /var/lib/htgen-paste/items -type f -mtime '+30' -exec rm {} \;
+ '';
+ User = "htgen-paste";
+ };
+ };
+
+ krebs.htgen.paste-form = {
+ port = 7770;
+ script = /* sh */ ''
+ export PATH=${makeBinPath [
+ pkgs.curl
+ pkgs.gnused
+ ]}:$PATH
+ (. ${pkgs.writeScript "paste-form" ''
+ case "$Method" in
+ 'POST')
+ ref=$(head -c $req_content_length | sed '0,/^\r$/d;$d' | curl -fSs --data-binary @- https://p.krebsco.de | sed '1d;s/^http:/https:/')
+
+ printf 'HTTP/1.1 200 OK\r\n'
+ printf 'Content-Type: text/plain; charset=UTF-8\r\n'
+ printf 'Server: %s\r\n' "$Server"
+ printf 'Connection: close\r\n'
+ printf 'Content-Length: %d\r\n' $(expr ''${#ref} + 1)
+ printf '\r\n'
+ printf '%s\n' "$ref"
+
+ exit
+ ;;
+ esac
+ ''})
+ '';
+ };
krebs.htgen.imgur = {
port = 7771;
script = /* sh */ ''
diff --git a/lass/2configs/snapclient.nix b/lass/2configs/snapclient.nix
new file mode 100644
index 00000000..8015680e
--- /dev/null
+++ b/lass/2configs/snapclient.nix
@@ -0,0 +1,12 @@
+{ config, lib, pkgs, ... }:
+{
+ systemd.services.snapclient = {
+ wantedBy = [ "multi-user.target" ];
+ path = [ pkgs.snapcast ];
+ script = "snapclient -h 10.42.0.1";
+ serviceConfig = {
+ DynamicUser = true;
+ Group = "pipewire";
+ };
+ };
+}
diff --git a/lass/2configs/snapserver.nix b/lass/2configs/snapserver.nix
new file mode 100644
index 00000000..3c6dbf75
--- /dev/null
+++ b/lass/2configs/snapserver.nix
@@ -0,0 +1,13 @@
+{ config, lib, pkgs, ... }:
+{
+ services.snapserver = {
+ enable = true;
+ openFirewall = true;
+ streams = {
+ pipewire = {
+ type = "pipe";
+ location = "/run/snapserver/snapfifo";
+ };
+ };
+ };
+}