From 70f8ca8da527b835f407ac0976786124f6ea0719 Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Sun, 24 May 2020 14:49:33 +0000 Subject: [PATCH] nixos/plymouth: Include label module and fonts To show text, Plymouth needs the label plugin. We also copy in both Cantarell and DejaVu Sans, as these are used by the default Plymouth themes. --- nixos/modules/system/boot/plymouth.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/nixos/modules/system/boot/plymouth.nix b/nixos/modules/system/boot/plymouth.nix index 74eb2668653fa..d748cab1c463b 100644 --- a/nixos/modules/system/boot/plymouth.nix +++ b/nixos/modules/system/boot/plymouth.nix @@ -111,7 +111,7 @@ in mkdir -p $out/lib/plymouth/renderers # module might come from a theme - cp ${themesEnv}/lib/plymouth/{text,details,$moduleName}.so $out/lib/plymouth + cp ${themesEnv}/lib/plymouth/{text,details,label,$moduleName}.so $out/lib/plymouth cp ${plymouth}/lib/plymouth/renderers/{drm,frame-buffer}.so $out/lib/plymouth/renderers mkdir -p $out/share/plymouth/themes @@ -120,7 +120,7 @@ in # copy themes into working directory for patching mkdir themes # use -L to copy the directories proper, not the symlinks to them - cp -r -L ${themesEnv}/share/plymouth/themes/{text,details,${cfg.theme}} themes + cp -r -L ${themesEnv}/share/plymouth/themes/{text,details,spinner,${cfg.theme}} themes # patch out any attempted references to the theme or plymouth's themes directory chmod -R +w themes @@ -131,6 +131,15 @@ in cp -r themes/* $out/share/plymouth/themes cp ${cfg.logo} $out/share/plymouth/logo.png + + mkdir -p $out/usr/share/fonts/truetype + mkdir -p $out/etc/fonts/2.11/conf.d + cp -r ${pkgs.cantarell-fonts}/share/fonts/cantarell/Cantarell-{Thin,Regular}.otf $out/usr/share/fonts/truetype + cp -r ${pkgs.dejavu_fonts.minimal}/share/fonts/truetype/DejaVuSans.ttf $out/usr/share/fonts/truetype + + cp ${pkgs.fontconfig.out}/share/fontconfig/conf.avail/60-latin.conf $out/etc/fonts/2.11/conf.d + cp ${pkgs.fontconfig.out}/etc/fonts/fonts.conf $out/etc/fonts/2.11 + sed -i 's@${pkgs.dejavu_fonts.minimal}@/usr/share/fonts@g' $out/etc/fonts/2.11/fonts.conf ''; boot.initrd.extraUtilsCommandsTest = '' @@ -144,12 +153,14 @@ in ''; boot.initrd.preLogCommands = '' - mkdir -p /etc/plymouth + mkdir -p /etc/plymouth /usr/share ln -s ${configFile} /etc/plymouth/plymouthd.conf ln -s $extraUtils/share/plymouth/plymouthd.defaults /etc/plymouth/plymouthd.defaults ln -s $extraUtils/share/plymouth/logo.png /etc/plymouth/logo.png ln -s $extraUtils/share/plymouth/themes /etc/plymouth/themes ln -s $extraUtils/lib/plymouth /etc/plymouth/plugins + ln -s $extraUtils/etc/fonts /etc/fonts + ln -s $extraUtils/usr/share/fonts /usr/share/fonts plymouthd --mode=boot --pid-file=/run/plymouth/pid --attach-to-session plymouth show-splash