|
|
|
@ -1,7 +1,9 @@ |
|
|
|
|
{pkgs, config, ...}: |
|
|
|
|
{ config, pkgs, ... }: |
|
|
|
|
|
|
|
|
|
with pkgs.lib; |
|
|
|
|
|
|
|
|
|
let |
|
|
|
|
inherit (pkgs.lib) mkOption mkIf singleton; |
|
|
|
|
|
|
|
|
|
inherit (pkgs) stdenv; |
|
|
|
|
|
|
|
|
|
kernelPackages = config.boot.kernelPackages; |
|
|
|
@ -19,7 +21,7 @@ let |
|
|
|
|
# syslog tty, except those for which a specific theme is |
|
|
|
|
# specified. |
|
|
|
|
defaultTTYs = |
|
|
|
|
pkgs.lib.filter (x: !(pkgs.lib.elem x overridenTTYs)) requiredTTYs; |
|
|
|
|
filter (x: !(elem x overridenTTYs)) requiredTTYs; |
|
|
|
|
|
|
|
|
|
in |
|
|
|
|
(map (tty: { |
|
|
|
@ -100,42 +102,42 @@ in |
|
|
|
|
target = "splash"; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
jobs = singleton { |
|
|
|
|
name = "tty-backgrounds"; |
|
|
|
|
|
|
|
|
|
startOn = "udev"; |
|
|
|
|
|
|
|
|
|
preStart = |
|
|
|
|
'' |
|
|
|
|
# Critical: tell the kernel where to find splash_helper. It calls |
|
|
|
|
# this program every time we switch between consoles. |
|
|
|
|
helperProcFile=${splashutils.helperProcFile} |
|
|
|
|
if test -e /proc/sys/fbcondecor; then helperProcFile=/proc/sys/fbcondecor; fi |
|
|
|
|
echo ${splashutils}/${splashutils.helperName} > $helperProcFile |
|
|
|
|
|
|
|
|
|
# For each console... |
|
|
|
|
for tty in ${toString (map (x: x.tty) backgrounds)}; do |
|
|
|
|
# Make sure that the console exists. |
|
|
|
|
echo -n "" > /dev/$tty |
|
|
|
|
|
|
|
|
|
# Set the theme as determined by tty-backgrounds-combine.sh |
|
|
|
|
# above. Note that splashutils needs a TTY number |
|
|
|
|
# instead of a device name, hence the ''${tty:3}. |
|
|
|
|
theme=$(readlink ${themesUnpacked}/$tty) |
|
|
|
|
${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c setcfg -t $theme || true |
|
|
|
|
${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c setpic -t $theme || true |
|
|
|
|
${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c on || true |
|
|
|
|
done |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
postStop = |
|
|
|
|
'' |
|
|
|
|
# Disable the theme on each console. |
|
|
|
|
for tty in ${toString (map (x: x.tty) backgrounds)}; do |
|
|
|
|
${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c off || true |
|
|
|
|
done |
|
|
|
|
''; |
|
|
|
|
}; |
|
|
|
|
jobAttrs.ttyBackgrounds = |
|
|
|
|
{ name = "tty-backgrounds"; |
|
|
|
|
|
|
|
|
|
startOn = "udev"; |
|
|
|
|
|
|
|
|
|
preStart = |
|
|
|
|
'' |
|
|
|
|
# Critical: tell the kernel where to find splash_helper. It calls |
|
|
|
|
# this program every time we switch between consoles. |
|
|
|
|
helperProcFile=${splashutils.helperProcFile} |
|
|
|
|
if test -e /proc/sys/fbcondecor; then helperProcFile=/proc/sys/fbcondecor; fi |
|
|
|
|
echo ${splashutils}/${splashutils.helperName} > $helperProcFile |
|
|
|
|
|
|
|
|
|
# For each console... |
|
|
|
|
for tty in ${toString (map (x: x.tty) backgrounds)}; do |
|
|
|
|
# Make sure that the console exists. |
|
|
|
|
echo -n "" > /dev/$tty |
|
|
|
|
|
|
|
|
|
# Set the theme as determined by tty-backgrounds-combine.sh |
|
|
|
|
# above. Note that splashutils needs a TTY number |
|
|
|
|
# instead of a device name, hence the ''${tty:3}. |
|
|
|
|
theme=$(readlink ${themesUnpacked}/$tty) |
|
|
|
|
${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c setcfg -t $theme || true |
|
|
|
|
${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c setpic -t $theme || true |
|
|
|
|
${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c on || true |
|
|
|
|
done |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
postStop = |
|
|
|
|
'' |
|
|
|
|
# Disable the theme on each console. |
|
|
|
|
for tty in ${toString (map (x: x.tty) backgrounds)}; do |
|
|
|
|
${splashutils}/${splashutils.controlName} --tty ''${tty:3} -c off || true |
|
|
|
|
done |
|
|
|
|
''; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|