{ config, lib, pkgs, ... }: let hostName = "music-bed"; outputDevice = "snd_rpi_hifiberry_dacplus"; snapserverHost = "snapcast.cloonar.com"; in { nixpkgs.crossSystem.system = "aarch64-linux"; imports = [ ]; networking.hostName = hostName; networking.wireless = { enable = true; networks = { "Cloonar-Multimedia" = { hidden = true; psk = ""; }; }; }; boot = { loader.raspberryPi.firmwareConfig = '' dtoverlay=vc4-kms-v3d,noaudio dtoverlay=hifiberry-dacplus force_eeprom_read=0 dtdebug=1 ''; # extraModprobeConfig = '' # options snd_bcm2835 enable_headphones=1 # ''; }; # hardware.raspberry-pi."4" = { # fkms-3d.enable = true; # audio.enable = true; # dwc2.enable = true; # }; sound.enable = true; systemd.services.snapclient = { description = "Snapcast client"; wantedBy = ["multi-user.target"]; wants = ["network-online.target"]; after = ["network-online.target"]; serviceConfig = { Type = "forking"; ExecStart = "${pkgs.snapcast}/bin/snapclient --daemon --hostID ${config.networking.hostName} -h ${snapserverHost} --player alsa -s ${outputDevice}"; PIDFile = "/run/snapclient/pid"; Restart = "on-failure"; RestartSec = "5s"; DynamicUser = true; SupplementaryGroups = "audio"; RuntimeDirectory = "snapclient"; }; }; services.openssh.enable = true; users = { mutableUsers = false; users.root = { hashedPassword = lib.mkForce "$6$7IKExnDde920x.YH$ggegnnKJYdmg1Wt33fxuPpM.MmIaX32LXVyjL8ed7ohT385lKotFGzRpitncQ3pd9Lci1QCFGRn2tVJGxkFAm0"; openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDN/2SAFm50kraB1fepAizox/QRXxB7WbqVbH+5OPalDT47VIJGNKOKhixQoqhABHxEoLxdf/C83wxlCVlPV9poLfDgVkA3Lyt5r3tSFQ6QjjOJAgchWamMsxxyGBedhKvhiEzcr/Lxytnoz3kjDG8fqQJwEpdqMmJoMUfyL2Rqp16u+FQ7d5aJtwO8EUqovhMaNO7rggjPpV/uMOg+tBxxmscliN7DLuP4EMTA/FwXVzcFNbOx3K9BdpMRAaSJt4SWcJO2cS2KHA5n/H+PQI7nz5KN3Yr/upJN5fROhi/SHvK39QOx12Pv7FCuWlc+oR68vLaoCKYhnkl3DnCfc7A7" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIRQuPqH5fdX3KEw7DXzWEdO3AlUn1oSmtJtHB71ICoH Generated By Termius" ]; }; }; system.stateVersion = "22.05"; sdImage = { compressImage = false; }; }