This commit is contained in:
41666 2025-04-14 16:38:52 -07:00
parent 08c769f2ec
commit 3abaa47c76
4 changed files with 54 additions and 8 deletions

8
flake.lock generated
View file

@ -633,11 +633,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1744430215, "lastModified": 1744433833,
"narHash": "sha256-TJ+qDke9oB6PvMboWYdLM2zHAsqSFHXNN8tnqmQUJQs=", "narHash": "sha256-lj1Hc/Z8fZhtchkPANZU2eN5lKOJ0MrlQ0lVVN0lN98=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "0599972821936ef4bfd5b1fd876de5dd4fb0c852", "rev": "1136fbf3d3afff7377c5516d0b92d2c5dbd2c1e1",
"revCount": 100, "revCount": 101,
"type": "git", "type": "git",
"url": "https://git.sapphic.engineer/noe/noe.sh" "url": "https://git.sapphic.engineer/noe/noe.sh"
}, },

View file

@ -2,8 +2,8 @@
let let
nvidia = config.hardware.nvidia.package; nvidia = config.hardware.nvidia.package;
vrr-off = pkgs.writeScriptBin "vrr-off" '' vrr-off = pkgs.writeScriptBin "vrr-off" ''
#!/bin/sh #!${pkgs.stdenv.shell}
nvidia-settings -a AllowVRR=0 ${nvidia}/bin/nvidia-settings -a AllowVRR=0
''; '';
in { in {
config = { config = {

View file

@ -16,6 +16,8 @@
../../features/tailscale.nix ../../features/tailscale.nix
../../features/telemetry ../../features/telemetry
../../features/wine.nix ../../features/wine.nix
./scarlett-air.nix
]; ];
home-manager.users.noe = import ../../../home-manager/noe/hosts/aerial.nix; home-manager.users.noe = import ../../../home-manager/noe/hosts/aerial.nix;
@ -45,8 +47,8 @@
networking.firewall.allowedUDPPorts = [ 42069 ]; networking.firewall.allowedUDPPorts = [ 42069 ];
networking.nameservers = lib.mkForce [ networking.nameservers = lib.mkForce [
# "100.80.255.88"
"10.100.69.69" "10.100.69.69"
# "10.0.0.1" "10.0.0.1"
]; ];
} }

View file

@ -0,0 +1,44 @@
{ pkgs, ... }: let
amixer = "${pkgs.alsa-utils}/bin/amixer";
script = pkgs.writeScriptBin "scarlett-air" ''
#!${pkgs.stdenv.shell}
which=0
controlName=""
find_control() {
for i in /dev/snd/controlC*; do
r=$(${amixer} controls -c $which | grep "name='Line In 2 Air Capture Enum'")
if [[ -z $r ]]; then
((which++))
continue
fi
echo "found: $r"
controlName=$r
done
}
for n in {1..30}; do
find_control
if [[ -z $controlName ]]; then
echo "control not found this loop, waiting..."
sleep 1s
continue
fi
${amixer} cset -c $which "$controlName" 2 && exit 0
done
'';
in {
systemd.user.services.scarlett-air = {
enable = true;
wantedBy = [ "graphical-session.target" ];
description = "Enables yellow Air on the DAC";
serviceConfig = {
Type = "oneshot";
ExecStart = "${script}/bin/scarlett-air";
};
};
}