diff --git a/nixos/doc/manual/release-notes/rl-2511.section.md b/nixos/doc/manual/release-notes/rl-2511.section.md index d1285109a0ce..b845345a2872 100644 --- a/nixos/doc/manual/release-notes/rl-2511.section.md +++ b/nixos/doc/manual/release-notes/rl-2511.section.md @@ -331,6 +331,8 @@ - `services.dnscrypt-proxy` gains a `package` option to specify dnscrypt-proxy package to use. +- `boot.plymouth` now has a [`package`](#opt-boot.plymouth.package) option to specify the package used in the module. + - `services.limesurvey` now supports nginx as reverse-proxy. Available through [services.limesurvey.webserver](#opt-services.limesurvey.webserver). - `services.nextcloud.configureRedis` now defaults to `true` in accordance with upstream recommendations to have caching for file locking. See the [upstream doc](https://docs.nextcloud.com/server/31/admin_manual/configuration_files/files_locking_transactional.html) for further details. diff --git a/nixos/modules/system/boot/plymouth.nix b/nixos/modules/system/boot/plymouth.nix index 1023fa8ce42d..51026e8c7a6a 100644 --- a/nixos/modules/system/boot/plymouth.nix +++ b/nixos/modules/system/boot/plymouth.nix @@ -21,10 +21,6 @@ let escapeShellArg ; - plymouth = pkgs.plymouth.override { - systemd = config.boot.initrd.systemd.package; - }; - cfg = config.boot.plymouth; opt = options.boot.plymouth; @@ -64,7 +60,7 @@ let themesEnv = pkgs.buildEnv { name = "plymouth-themes"; paths = [ - plymouth + cfg.package plymouthLogos ] ++ cfg.themePackages; @@ -96,7 +92,7 @@ let preStartQuitFixup = { serviceConfig.ExecStartPre = [ "" - "${plymouth}/bin/plymouth quit --wait" + "${cfg.package}/bin/plymouth quit --wait" ]; }; @@ -110,6 +106,19 @@ in enable = mkEnableOption "Plymouth boot splash screen"; + package = mkOption { + description = "The plymouth package to use."; + type = types.package; + default = pkgs.plymouth.override { + systemd = config.boot.initrd.systemd.package; + }; + defaultText = literalExpression '' + pkgs.plymouth.override { + systemd = config.boot.initrd.systemd.package; + } + ''; + }; + font = mkOption { default = "${pkgs.dejavu_fonts.minimal}/share/fonts/truetype/DejaVuSans.ttf"; defaultText = literalExpression ''"''${pkgs.dejavu_fonts.minimal}/share/fonts/truetype/DejaVuSans.ttf"''; @@ -175,15 +184,15 @@ in boot.kernelParams = [ "splash" ]; # To be discoverable by systemd. - environment.systemPackages = [ plymouth ]; + environment.systemPackages = [ cfg.package ]; environment.etc."plymouth/plymouthd.conf".source = configFile; environment.etc."plymouth/plymouthd.defaults".source = - "${plymouth}/share/plymouth/plymouthd.defaults"; + "${cfg.package}/share/plymouth/plymouthd.defaults"; environment.etc."plymouth/logo.png".source = cfg.logo; environment.etc."plymouth/themes".source = "${themesEnv}/share/plymouth/themes"; # XXX: Needed because we supply a different set of plugins in initrd. - environment.etc."plymouth/plugins".source = "${plymouth}/lib/plymouth"; + environment.etc."plymouth/plugins".source = "${cfg.package}/lib/plymouth"; systemd.tmpfiles.rules = [ "d /run/plymouth 0755 root root 0 -" @@ -192,7 +201,7 @@ in "L+ /run/plymouth/plugins - - - - /etc/plymouth/plugins" ]; - systemd.packages = [ plymouth ]; + systemd.packages = [ cfg.package ]; systemd.services.plymouth-kexec.wantedBy = [ "kexec.target" ]; systemd.services.plymouth-halt.wantedBy = [ "halt.target" ]; @@ -211,13 +220,13 @@ in systemd.services.emergency = preStartQuitFixup; boot.initrd.systemd = { - extraBin.plymouth = "${plymouth}/bin/plymouth"; # for the recovery shell + extraBin.plymouth = "${cfg.package}/bin/plymouth"; # for the recovery shell storePaths = [ "${getBin config.boot.initrd.systemd.package}/bin/systemd-tty-ask-password-agent" - "${plymouth}/bin/plymouthd" - "${plymouth}/sbin/plymouthd" + "${cfg.package}/bin/plymouthd" + "${cfg.package}/sbin/plymouthd" ]; - packages = [ plymouth ]; # systemd units + packages = [ cfg.package ]; # systemd units services.rescue = preStartQuitFixup; services.emergency = preStartQuitFixup; @@ -226,7 +235,7 @@ in # Files "/etc/plymouth/plymouthd.conf".source = configFile; "/etc/plymouth/logo.png".source = cfg.logo; - "/etc/plymouth/plymouthd.defaults".source = "${plymouth}/share/plymouth/plymouthd.defaults"; + "/etc/plymouth/plymouthd.defaults".source = "${cfg.package}/share/plymouth/plymouthd.defaults"; # Directories "/etc/plymouth/plugins".source = pkgs.runCommand "plymouth-initrd-plugins" { } ( checkIfThemeExists @@ -236,7 +245,7 @@ in mkdir -p $out/renderers # module might come from a theme cp ${themesEnv}/lib/plymouth/*.so $out - cp ${plymouth}/lib/plymouth/renderers/*.so $out/renderers + cp ${cfg.package}/lib/plymouth/renderers/*.so $out/renderers # useless in the initrd, and adds several megabytes to the closure rm $out/renderers/x11.so '' @@ -319,8 +328,8 @@ in boot.initrd.extraUtilsCommands = mkIf (!config.boot.initrd.systemd.enable) ( '' - copy_bin_and_libs ${plymouth}/bin/plymouth - copy_bin_and_libs ${plymouth}/bin/plymouthd + copy_bin_and_libs ${cfg.package}/bin/plymouth + copy_bin_and_libs ${cfg.package}/bin/plymouthd '' + checkIfThemeExists @@ -331,12 +340,12 @@ in mkdir -p $out/lib/plymouth/renderers # module might come from a theme cp ${themesEnv}/lib/plymouth/*.so $out/lib/plymouth - cp ${plymouth}/lib/plymouth/renderers/*.so $out/lib/plymouth/renderers + cp ${cfg.package}/lib/plymouth/renderers/*.so $out/lib/plymouth/renderers # useless in the initrd, and adds several megabytes to the closure rm $out/lib/plymouth/renderers/x11.so mkdir -p $out/share/plymouth/themes - cp ${plymouth}/share/plymouth/plymouthd.defaults $out/share/plymouth + cp ${cfg.package}/share/plymouth/plymouthd.defaults $out/share/plymouth # Copy themes into working directory for patching mkdir themes