Compare commits

...

2 Commits

Author SHA1 Message Date
930417968f hosts/eldrid/cb-audio-fix: update
Signed-off-by: unexplrd <unexplrd@linerds.us>
2025-07-12 15:15:12 +03:00
7d0e089e3f use hostId for luks disks
Signed-off-by: unexplrd <unexplrd@linerds.us>
2025-07-12 15:15:12 +03:00
11 changed files with 121 additions and 40 deletions

View File

@ -1,4 +1,9 @@
{inputs, ...}: let
{
config,
inputs,
...
}: let
inherit (config.networking) hostId;
disk = "/dev/disk/by-id/nvme-eui.000000000000000100a075244b5d6185";
in {
imports = with inputs; [
@ -10,5 +15,5 @@ in {
mountOptions = ["rw" "nosuid" "nodev"];
};
};
disko.devices.disk.main = import ./disk-main.nix {inherit disk;};
disko.devices.disk.main = import ./disk-main.nix {inherit disk hostId;};
}

View File

@ -1,4 +1,7 @@
{disk, ...}: {
{
disk,
hostId,
}: {
type = "disk";
device = disk;
content = {
@ -25,7 +28,7 @@
size = "100%";
content = {
type = "luks";
name = "luks-main";
name = "luks-" + hostId;
initrdUnlock = true;
settings.allowDiscards = true;
content = let

View File

@ -1,4 +1,9 @@
{inputs, ...}: let
{
config,
inputs,
...
}: let
inherit (config.networking) hostId;
disk = "/dev/disk/by-id/nvme-eui.e8238fa6bf530001001b444a44022ad0";
in {
imports = with inputs; [
@ -10,5 +15,5 @@ in {
mountOptions = ["rw" "nosuid" "nodev"];
};
};
disko.devices.disk.main = import ./disk-main.nix {inherit disk;};
disko.devices.disk.main = import ./disk-main.nix {inherit config disk hostId;};
}

View File

@ -1,4 +1,7 @@
{disk, ...}: {
{
disk,
hostId,
}: {
type = "disk";
device = disk;
content = {
@ -25,7 +28,7 @@
size = "100%";
content = {
type = "luks";
name = "luks-main";
name = "luks-" + hostId;
initrdUnlock = true;
settings.allowDiscards = true;
content = {

View File

@ -1,20 +1,47 @@
{pkgs, ...}: let
cb-ucm-conf = pkgs.alsa-ucm-conf.overrideAttrs {
wttsrc = pkgs.fetchFromGitHub {
owner = "WeirdTreeThing";
repo = "chromebook-ucm-conf";
rev = "b6ce2a7";
hash = "sha256-QRUKHd3RQmg1tnZU8KCW0AmDtfw/daOJ/H3XU5qWTCc=";
cb-ucm-conf = with pkgs;
alsa-ucm-conf.overrideAttrs {
wttsrc = fetchFromGitHub {
owner = "WeirdTreeThing";
repo = "alsa-ucm-conf-cros";
rev = "a4f0ed6cf59163fb571c33a81a6b40b6f53ed57d";
hash = "sha256-H0BsRzHSEJ6XCZB/Rvb3w+uGCzr+kAvAwcHWqYEtp6w=";
};
unpackPhase = ''
runHook preUnpack
tar xf "$src"
runHook postUnpack
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/alsa
cp -r alsa-ucm*/ucm2 $out/share/alsa
runHook postInstall
'';
};
postInstall = ''
cp -R $wttsrc/common/* $out/share/alsa/ucm2/common
cp -R $wttsrc/codecs/* $out/share/alsa/ucm2/codecs
cp -R $wttsrc/platforms/* $out/share/alsa/ucm2/platforms
cp -R $wttsrc/sof-rt5682 $out/share/alsa/ucm2/conf.d
cp -R $wttsrc/sof-cs42l42 $out/share/alsa/ucm2/conf.d
'';
};
in {
environment = {
systemPackages = [pkgs.sof-firmware];
sessionVariables.ALSA_CONFIG_UCM2 = "${cb-ucm-conf}/share/alsa/ucm2";
etc = {
"wireplumber/main.lua.d/51-increase-headroom.lua".text = ''
rule = {
matches = {
{
{ "node.name", "matches", "alsa_output.*" },
},
},
apply_properties = {
["api.alsa.headroom"] = 4096,
},
}
table.insert(alsa_monitor.rules,rule)
'';
};
};
system.replaceDependencies.replacements = [
{
original = pkgs.alsa-ucm-conf;
@ -22,6 +49,10 @@ in {
}
];
boot.extraModprobeConfig = ''
options snd-intel-dspcfg dsp_driver=3
'';
services.pipewire.wireplumber.configPackages = [
(pkgs.writeTextDir "share/wireplumber/main.lua.d/51-increase-headroom.lua" ''
rule = {
@ -37,10 +68,19 @@ in {
table.insert(alsa_monitor.rules,rule)
'')
(pkgs.writeTextDir "share/wireplumber/main.lua.d/51-avs-dmic.lua" ''
rule = {
matches = {
{
{ "node.nick", "equals", "Internal Microphone" },
},
},
apply_properties = {
["audio.format"] = "S16LE",
},
}
table.insert(alsa_monitor.rules, rule)
'')
];
boot = {
extraModprobeConfig = ''
options snd-intel-dspcfg dsp_driver=3
'';
};
}

View File

@ -1,4 +1,9 @@
{inputs, ...}: let
{
config,
inputs,
...
}: let
inherit (config.networking) hostId;
disk-main = "/dev/disk/by-id/nvme-INTEL_SSDPEKKF256G8L_BTHH81460QC2256B";
disk-second = "/dev/disk/by-id/nvme-WDC_PC_SN730_SDBPNTY-1T00-1101_21114D802446";
in {
@ -11,6 +16,6 @@ in {
mountOptions = ["rw" "nosuid" "nodev"];
};
};
disko.devices.disk.main = import ./disk-main.nix {inherit disk-main;};
disko.devices.disk.second = import ./disk-second.nix {inherit disk-second;};
disko.devices.disk.main = import ./disk-main.nix {inherit disk-main hostId;};
disko.devices.disk.second = import ./disk-second.nix {inherit disk-second hostId;};
}

View File

@ -1,4 +1,7 @@
{disk-main}: {
{
disk-main,
hostId,
}: {
type = "disk";
device = disk-main;
content = {
@ -25,7 +28,7 @@
size = "100%";
content = {
type = "luks";
name = "luks-main";
name = "luks-" + hostId;
initrdUnlock = true;
settings.allowDiscards = true;
content = {

View File

@ -1,4 +1,7 @@
{disk-second}: {
{
disk-second,
hostId,
}: {
type = "disk";
device = disk-second;
content = {
@ -8,7 +11,7 @@
size = "100%";
content = {
type = "luks";
name = "luks-second";
name = "luks-${hostId}-second";
initrdUnlock = true;
settings.allowDiscards = true;
content = {

View File

@ -1,4 +1,9 @@
{inputs, ...}: let
{
config,
inputs,
...
}: let
inherit (config.networking) hostId;
disk = "/dev/nvme0n1";
in {
imports = with inputs; [
@ -10,5 +15,5 @@ in {
mountOptions = ["rw" "nosuid" "nodev"];
};
};
disko.devices.disk.main = import ./disk-main.nix {inherit disk;};
disko.devices.disk.main = import ./disk-main.nix {inherit disk hostId;};
}

View File

@ -1,4 +1,8 @@
{disk, ...}: {
{
disk,
hostId,
...
}: {
type = "disk";
device = disk;
content = {
@ -25,7 +29,7 @@
size = "100%";
content = {
type = "luks";
name = "luks-main";
name = "luks-" + hostId;
initrdUnlock = true;
settings.allowDiscards = true;
content = {

View File

@ -1,4 +1,9 @@
{inputs, ...}: let
{
config,
inputs,
...
}: let
inherit (config.networking) hostId;
disk = "/dev/disk/by-id/nvme-eui.0025385911b36714";
in {
imports = with inputs; [
@ -11,5 +16,5 @@ in {
};
};
# same partitioning setup
disko.devices.disk.main = import ../../dunamis/disko/disk-main.nix {inherit disk;};
disko.devices.disk.main = import ../../dunamis/disko/disk-main.nix {inherit disk hostId;};
}