diff options
Diffstat (limited to 'lass/2configs')
-rw-r--r-- | lass/2configs/mail.nix | 12 | ||||
-rw-r--r-- | lass/2configs/paste.nix | 11 | ||||
-rw-r--r-- | lass/2configs/pipewire.nix | 19 | ||||
-rw-r--r-- | lass/2configs/services/radio/default.nix | 2 | ||||
-rw-r--r-- | lass/2configs/services/radio/news.nix | 29 | ||||
-rw-r--r-- | lass/2configs/weron/client.nix | 20 | ||||
-rw-r--r-- | lass/2configs/weron/signaler.nix | 13 |
7 files changed, 74 insertions, 32 deletions
diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix index 0adef8f8c..bf8904b89 100644 --- a/lass/2configs/mail.nix +++ b/lass/2configs/mail.nix @@ -124,15 +124,6 @@ let ''; muttrc = pkgs.writeText "muttrc" '' - # gpg - source ${pkgs.neomutt}/share/doc/neomutt/samples/gpg.rc - set pgp_use_gpg_agent = yes - set pgp_sign_as = 0xDC2A43EF4F11E854B44D599A89E82952976A7E4D - set crypt_autosign = no - set crypt_replyencrypt = yes - set crypt_verify_sig = yes - set pgp_verify_command = "gpg --no-verbose --batch --output - --verify %s %f" - # read html mails auto_view text/html @@ -187,8 +178,7 @@ let until ${pkgs.muchsync}/bin/muchsync -F lass@green.r; do sleep 1 done - ''}<enter> \ - 'run muchsync to green.r' + ''}<enter> #killed bind index d noop diff --git a/lass/2configs/paste.nix b/lass/2configs/paste.nix index cfd7f5576..87768a452 100644 --- a/lass/2configs/paste.nix +++ b/lass/2configs/paste.nix @@ -82,14 +82,9 @@ with import <stockholm/lib>; krebs.htgen.paste = { port = 9081; - script = toString [ - "PATH=${makeBinPath [ - pkgs.nix - pkgs.file - ]}:$PATH" - "STATEDIR=$HOME" - ". ${pkgs.htgen}/examples/paste" - ]; + script = /* sh */ '' + (. ${pkgs.htgen-paste}/bin/htgen-paste) + ''; }; systemd.services.paste-gc = { diff --git a/lass/2configs/pipewire.nix b/lass/2configs/pipewire.nix index ec5a67b6e..da9408669 100644 --- a/lass/2configs/pipewire.nix +++ b/lass/2configs/pipewire.nix @@ -22,15 +22,14 @@ pulse.enable = true; jack.enable = true; }; - - systemd.services.wireplumber = { - environment = { - HOME = "/var/lib/wireplumber"; - DISPLAY = ":0"; - }; - path = [ - pkgs.dbus - ]; - serviceConfig.StateDirectory = "wireplumber"; + environment.etc = { + "wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = '' + bluez_monitor.properties = { + ["bluez5.enable-sbc-xq"] = true, + ["bluez5.enable-msbc"] = true, + ["bluez5.enable-hw-volume"] = true, + ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]" + } + ''; }; } diff --git a/lass/2configs/services/radio/default.nix b/lass/2configs/services/radio/default.nix index a511196fd..16ef31b6f 100644 --- a/lass/2configs/services/radio/default.nix +++ b/lass/2configs/services/radio/default.nix @@ -82,7 +82,7 @@ in { users.users = { "${name}" = rec { inherit name; - createHome = lib.mkForce false; + createHome = true; group = name; uid = pkgs.stockholm.lib.genid_uint31 name; description = "radio manager"; diff --git a/lass/2configs/services/radio/news.nix b/lass/2configs/services/radio/news.nix index 0dc711e6c..62f7f548c 100644 --- a/lass/2configs/services/radio/news.nix +++ b/lass/2configs/services/radio/news.nix @@ -1,6 +1,31 @@ { config, lib, pkgs, ... }: let + tts = pkgs.writers.writeBashBin "tts" '' + set -efu + + offset=0 + OUTPUT=$(mktemp -d) + trap 'rm -rf "$OUTPUT"' EXIT + SPEAKER=$[ $RANDOM % 900 ] + while read line; do + echo "$line" | + ${pkgs.larynx}/bin/larynx \ + --model ${pkgs.fetchzip { + url = "https://github.com/rhasspy/piper/releases/download/v0.0.2/voice-en-us-libritts-high.tar.gz"; + hash = "sha256-jCoK4p0O7BuF0nr6Sfj40tpivCvU5M3GHKQRg1tfIO8="; + stripRoot = false; + }}/en-us-libritts-high.onnx \ + -s "$SPEAKER" \ + -f "$OUTPUT"/"$offset".wav + + ((offset+=1)) + done + + ${pkgs.sox}/bin/sox "$OUTPUT"/*.wav "$OUTPUT"/all.wav + cat "$OUTPUT"/all.wav + ''; + send_to_radio = pkgs.writers.writeDashBin "send_to_radio" '' ${pkgs.vorbis-tools}/bin/oggenc - | ${pkgs.cyberlocker-tools}/bin/cput news.ogg @@ -41,16 +66,16 @@ in systemd.services.newsshow = { path = [ newsshow + tts send_to_radio gc_news get_current_news - pkgs.curl pkgs.retry ]; script = '' set -efu retry -t 5 -d 10 -- newsshow | - retry -t 5 -d 10 -- curl -fSsG http://tts.r/api/tts --data-urlencode 'text@-' | + retry -t 5 -d 10 -- tts | retry -t 5 -d 10 -- send_to_radio ''; startAt = "*:00:00"; diff --git a/lass/2configs/weron/client.nix b/lass/2configs/weron/client.nix new file mode 100644 index 000000000..55bc8a0da --- /dev/null +++ b/lass/2configs/weron/client.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: +{ + systemd.services.weron = { + wantedBy = [ "multi-user.target" ]; + environment = { + WERON_RADDR = "ws://lassul.us:23420/"; + }; + serviceConfig = { + ExecStart = pkgs.writers.writeDash "weron" '' + ${pkgs.weron}/bin/weron vpn ip \ + --community krebs \ + --password aidsballs \ + --key aidsballs \ + --ips 10.249.1.0/24 \ + --verbose 7 \ + --dev weron + ''; + }; + }; +} diff --git a/lass/2configs/weron/signaler.nix b/lass/2configs/weron/signaler.nix new file mode 100644 index 000000000..9e817583b --- /dev/null +++ b/lass/2configs/weron/signaler.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, ... }: +{ + systemd.services.weron-signaler = { + wantedBy = [ "multi-user.target" ]; + environment = { + }; + serviceConfig = { + ExecStart = ''${pkgs.weron}/bin/weron signaler --verbose=7 --laddr ":23420"''; + }; + }; + + networking.firewall.allowedTCPPorts = [ 23420 ]; +} |