diff options
Diffstat (limited to 'lass/2configs')
-rw-r--r-- | lass/2configs/binary-cache/server.nix | 13 | ||||
-rw-r--r-- | lass/2configs/home-media.nix | 11 | ||||
-rw-r--r-- | lass/2configs/snapclient.nix | 12 | ||||
-rw-r--r-- | lass/2configs/snapserver.nix | 13 |
4 files changed, 48 insertions, 1 deletions
diff --git a/lass/2configs/binary-cache/server.nix b/lass/2configs/binary-cache/server.nix index 1abf51ae6..dcc4b5f1a 100644 --- a/lass/2configs/binary-cache/server.nix +++ b/lass/2configs/binary-cache/server.nix @@ -1,6 +1,17 @@ -{ config, lib, pkgs, stockholm, ...}: +{ config, lib, pkgs, ...}: +let + nix-serve-ng-src = builtins.fetchTarball { + # Replace the URL and hash with whatever you actually need + url = "https://github.com/aristanetworks/nix-serve-ng/archive/1937593598bb1285b41804f25cd6f9ddd4d5f1cb.tar.gz"; + sha256 = "1lqd207gbx1wjbhky33d2r8xi6avfbx4v0kpsvn84zaanifdgz2g"; + }; + + nix-serve-ng = import nix-serve-ng-src; + +in { + imports = [ nix-serve-ng.nixosModules.default ]; # generate private key with: # nix-store --generate-binary-cache-key my-secret-key my-public-key services.nix-serve = { diff --git a/lass/2configs/home-media.nix b/lass/2configs/home-media.nix index f250ca8d8..f3908e6be 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/snapclient.nix b/lass/2configs/snapclient.nix new file mode 100644 index 000000000..8015680e9 --- /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 000000000..3c6dbf750 --- /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"; + }; + }; + }; +} |