feat(orpheus): get audio working on orpheus

This commit is contained in:
Mohammad Rafiq 2025-04-06 20:36:28 +08:00
parent 020530097a
commit 50bc08c5de
No known key found for this signature in database
3 changed files with 30 additions and 2 deletions

View file

@ -55,7 +55,7 @@
++ (lib.optionals (hostname == "orpheus") [ ++ (lib.optionals (hostname == "orpheus") [
inputs.nixos-hardware.nixosModules.raspberry-pi-4 inputs.nixos-hardware.nixosModules.raspberry-pi-4
( (
{ pkgs, ... }: { pkgs, lib, ... }:
{ {
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
@ -75,6 +75,31 @@
}; };
}; };
}; };
boot = {
kernelPackages = lib.mkForce pkgs.linuxPackages_rpi4;
# Thanks to https://discourse.nixos.org/t/sound-on-raspberry-pi-4/15965/9
kernelParams = [
"snd_bcm2835.enable_hdmi=1"
"snd_bcm2835.enable_headphones=1"
];
extraModprobeConfig = ''
options snd_bcm2835 enable_headphones=1
'';
};
systemd.user.services.wireplumber.wantedBy = [ "default.target" ];
security.rtkit.enable = true;
services.pipewire = {
enable = true;
socketActivation = false;
extraConfig = { };
jack.enable = true;
pulse.enable = true;
alsa = {
enable = true;
support32Bit = true;
};
};
} }
) )
]); ]);

View file

@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
modulesPath, modulesPath,
lib,
... ...
}: }:
{ {
@ -12,7 +13,7 @@
timeout = 5; timeout = 5;
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
}; };
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
initrd.availableKernelModules = [ initrd.availableKernelModules = [
"ahci" "ahci"
"nvme" "nvme"

View file

@ -31,9 +31,11 @@
description = "rafiq"; description = "rafiq";
hashedPasswordFile = config.sops.secrets."rafiq/password".path; hashedPasswordFile = config.sops.secrets."rafiq/password".path;
uid = 1000; uid = 1000;
linger = true; # keep user services running
extraGroups = [ extraGroups = [
"networkmanager" "networkmanager"
"wheel" "wheel"
"audio" # Pipewire
]; ];
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILdsZyY3gu8IGB8MzMnLdh+ClDxQQ2RYG9rkeetIKq8n" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILdsZyY3gu8IGB8MzMnLdh+ClDxQQ2RYG9rkeetIKq8n"