119df37858
important for /proc/sys/kernel/modprobe, i.e., modprobing by the kernel. svn path=/nixos/trunk/; revision=8164
40 lines
537 B
Nix
40 lines
537 B
Nix
{modprobe, alsaUtils}:
|
|
|
|
let
|
|
|
|
soundState = "/var/state/asound.state";
|
|
|
|
in
|
|
|
|
{
|
|
name = "alsa";
|
|
|
|
job = "
|
|
start on hardware-scan
|
|
stop on shutdown
|
|
|
|
start script
|
|
|
|
# Load some additional modules.
|
|
for mod in snd_pcm_oss; do
|
|
${modprobe}/sbin/modprobe $mod || true
|
|
done
|
|
|
|
# Restore the sound state.
|
|
${alsaUtils}/sbin/alsactl -f ${soundState} restore
|
|
|
|
end script
|
|
|
|
respawn sleep 1000000 # !!! hack
|
|
|
|
stop script
|
|
|
|
# Save the sound state.
|
|
${alsaUtils}/sbin/alsactl -f ${soundState} store
|
|
|
|
end script
|
|
|
|
";
|
|
|
|
}
|