many changes
This commit is contained in:
81
raspberry/sd-card-zero.nix
Normal file
81
raspberry/sd-card-zero.nix
Normal file
@@ -0,0 +1,81 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hostName = "music-";
|
||||
outputDevice = "Headphones";
|
||||
snapserverHost = "snapcast.cloonar.com";
|
||||
in
|
||||
{
|
||||
nixpkgs.crossSystem.system = "aarch64-linux";
|
||||
imports = [
|
||||
<nixpkgs/nixos/modules/installer/sd-card/sd-image-aarch64.nix>
|
||||
];
|
||||
|
||||
networking.hostName = hostName;
|
||||
networking.wireless = {
|
||||
enable = true;
|
||||
networks = {
|
||||
"Cloonar-Multimedia" = {
|
||||
hidden = true;
|
||||
psk = "K2MC28Zhk$4zsx6Y";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
loader.raspberryPi.firmwareConfig = ''
|
||||
dtparam=audio=on
|
||||
'';
|
||||
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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user