nixos/nvidia: include systemd power management

This commit is contained in:
Edmund Wu
2020-05-10 11:25:50 -04:00
parent add53f7660
commit 9a269f555a
2 changed files with 62 additions and 15 deletions
+11 -2
View File
@@ -45,6 +45,17 @@ installPhase() {
cp -prd tls "$out/lib/"
fi
# Install systemd power management executables
if [ -e nvidia-sleep.sh ]; then
sed -E 's#(PATH=).*#\1"$PATH"#' nvidia-sleep.sh > nvidia-sleep.sh.fixed
install -Dm755 nvidia-sleep.sh.fixed $out/bin/nvidia-sleep.sh
fi
if [ -e nvidia ]; then
sed -E "s#/usr(/bin/nvidia-sleep.sh)#$out\\1#" nvidia > nvidia.fixed
install -Dm755 nvidia.fixed $out/lib/systemd/system-sleep/nvidia
fi
for i in $lib32 $out; do
rm -f $i/lib/lib{glx,nvidia-wfb}.so.* # handled separately
rm -f $i/lib/libnvidia-gtk* # built from source
@@ -91,7 +102,6 @@ installPhase() {
done
if [ -n "$bin" ]; then
# Install the X drivers.
mkdir -p $bin/lib/xorg/modules
@@ -167,5 +177,4 @@ installPhase() {
fi
}
genericBuild