awawa
This commit is contained in:
parent
08c769f2ec
commit
3abaa47c76
4 changed files with 54 additions and 8 deletions
8
flake.lock
generated
8
flake.lock
generated
|
@ -633,11 +633,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1744430215,
|
||||
"narHash": "sha256-TJ+qDke9oB6PvMboWYdLM2zHAsqSFHXNN8tnqmQUJQs=",
|
||||
"lastModified": 1744433833,
|
||||
"narHash": "sha256-lj1Hc/Z8fZhtchkPANZU2eN5lKOJ0MrlQ0lVVN0lN98=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "0599972821936ef4bfd5b1fd876de5dd4fb0c852",
|
||||
"revCount": 100,
|
||||
"rev": "1136fbf3d3afff7377c5516d0b92d2c5dbd2c1e1",
|
||||
"revCount": 101,
|
||||
"type": "git",
|
||||
"url": "https://git.sapphic.engineer/noe/noe.sh"
|
||||
},
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
let
|
||||
nvidia = config.hardware.nvidia.package;
|
||||
vrr-off = pkgs.writeScriptBin "vrr-off" ''
|
||||
#!/bin/sh
|
||||
nvidia-settings -a AllowVRR=0
|
||||
#!${pkgs.stdenv.shell}
|
||||
${nvidia}/bin/nvidia-settings -a AllowVRR=0
|
||||
'';
|
||||
in {
|
||||
config = {
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
../../features/tailscale.nix
|
||||
../../features/telemetry
|
||||
../../features/wine.nix
|
||||
|
||||
./scarlett-air.nix
|
||||
];
|
||||
|
||||
home-manager.users.noe = import ../../../home-manager/noe/hosts/aerial.nix;
|
||||
|
@ -45,8 +47,8 @@
|
|||
networking.firewall.allowedUDPPorts = [ 42069 ];
|
||||
|
||||
networking.nameservers = lib.mkForce [
|
||||
# "100.80.255.88"
|
||||
"10.100.69.69"
|
||||
# "10.0.0.1"
|
||||
"10.0.0.1"
|
||||
];
|
||||
|
||||
}
|
||||
|
|
44
nixos/hosts/aerial/scarlett-air.nix
Normal file
44
nixos/hosts/aerial/scarlett-air.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue