nixos/plymouth: add package option

This commit is contained in:
Acid Bong
2025-10-22 13:09:00 +03:00
parent 115adc466a
commit e6aa2e34a1
2 changed files with 31 additions and 20 deletions

View File

@@ -331,6 +331,8 @@
- `services.dnscrypt-proxy` gains a `package` option to specify dnscrypt-proxy package to use. - `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.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. - `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.

View File

@@ -21,10 +21,6 @@ let
escapeShellArg escapeShellArg
; ;
plymouth = pkgs.plymouth.override {
systemd = config.boot.initrd.systemd.package;
};
cfg = config.boot.plymouth; cfg = config.boot.plymouth;
opt = options.boot.plymouth; opt = options.boot.plymouth;
@@ -64,7 +60,7 @@ let
themesEnv = pkgs.buildEnv { themesEnv = pkgs.buildEnv {
name = "plymouth-themes"; name = "plymouth-themes";
paths = [ paths = [
plymouth cfg.package
plymouthLogos plymouthLogos
] ]
++ cfg.themePackages; ++ cfg.themePackages;
@@ -96,7 +92,7 @@ let
preStartQuitFixup = { preStartQuitFixup = {
serviceConfig.ExecStartPre = [ serviceConfig.ExecStartPre = [
"" ""
"${plymouth}/bin/plymouth quit --wait" "${cfg.package}/bin/plymouth quit --wait"
]; ];
}; };
@@ -110,6 +106,19 @@ in
enable = mkEnableOption "Plymouth boot splash screen"; 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 { font = mkOption {
default = "${pkgs.dejavu_fonts.minimal}/share/fonts/truetype/DejaVuSans.ttf"; default = "${pkgs.dejavu_fonts.minimal}/share/fonts/truetype/DejaVuSans.ttf";
defaultText = literalExpression ''"''${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" ]; boot.kernelParams = [ "splash" ];
# To be discoverable by systemd. # To be discoverable by systemd.
environment.systemPackages = [ plymouth ]; environment.systemPackages = [ cfg.package ];
environment.etc."plymouth/plymouthd.conf".source = configFile; environment.etc."plymouth/plymouthd.conf".source = configFile;
environment.etc."plymouth/plymouthd.defaults".source = 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/logo.png".source = cfg.logo;
environment.etc."plymouth/themes".source = "${themesEnv}/share/plymouth/themes"; environment.etc."plymouth/themes".source = "${themesEnv}/share/plymouth/themes";
# XXX: Needed because we supply a different set of plugins in initrd. # 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 = [ systemd.tmpfiles.rules = [
"d /run/plymouth 0755 root root 0 -" "d /run/plymouth 0755 root root 0 -"
@@ -192,7 +201,7 @@ in
"L+ /run/plymouth/plugins - - - - /etc/plymouth/plugins" "L+ /run/plymouth/plugins - - - - /etc/plymouth/plugins"
]; ];
systemd.packages = [ plymouth ]; systemd.packages = [ cfg.package ];
systemd.services.plymouth-kexec.wantedBy = [ "kexec.target" ]; systemd.services.plymouth-kexec.wantedBy = [ "kexec.target" ];
systemd.services.plymouth-halt.wantedBy = [ "halt.target" ]; systemd.services.plymouth-halt.wantedBy = [ "halt.target" ];
@@ -211,13 +220,13 @@ in
systemd.services.emergency = preStartQuitFixup; systemd.services.emergency = preStartQuitFixup;
boot.initrd.systemd = { boot.initrd.systemd = {
extraBin.plymouth = "${plymouth}/bin/plymouth"; # for the recovery shell extraBin.plymouth = "${cfg.package}/bin/plymouth"; # for the recovery shell
storePaths = [ storePaths = [
"${getBin config.boot.initrd.systemd.package}/bin/systemd-tty-ask-password-agent" "${getBin config.boot.initrd.systemd.package}/bin/systemd-tty-ask-password-agent"
"${plymouth}/bin/plymouthd" "${cfg.package}/bin/plymouthd"
"${plymouth}/sbin/plymouthd" "${cfg.package}/sbin/plymouthd"
]; ];
packages = [ plymouth ]; # systemd units packages = [ cfg.package ]; # systemd units
services.rescue = preStartQuitFixup; services.rescue = preStartQuitFixup;
services.emergency = preStartQuitFixup; services.emergency = preStartQuitFixup;
@@ -226,7 +235,7 @@ in
# Files # Files
"/etc/plymouth/plymouthd.conf".source = configFile; "/etc/plymouth/plymouthd.conf".source = configFile;
"/etc/plymouth/logo.png".source = cfg.logo; "/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 # Directories
"/etc/plymouth/plugins".source = pkgs.runCommand "plymouth-initrd-plugins" { } ( "/etc/plymouth/plugins".source = pkgs.runCommand "plymouth-initrd-plugins" { } (
checkIfThemeExists checkIfThemeExists
@@ -236,7 +245,7 @@ in
mkdir -p $out/renderers mkdir -p $out/renderers
# module might come from a theme # module might come from a theme
cp ${themesEnv}/lib/plymouth/*.so $out 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 # useless in the initrd, and adds several megabytes to the closure
rm $out/renderers/x11.so rm $out/renderers/x11.so
'' ''
@@ -319,8 +328,8 @@ in
boot.initrd.extraUtilsCommands = mkIf (!config.boot.initrd.systemd.enable) ( boot.initrd.extraUtilsCommands = mkIf (!config.boot.initrd.systemd.enable) (
'' ''
copy_bin_and_libs ${plymouth}/bin/plymouth copy_bin_and_libs ${cfg.package}/bin/plymouth
copy_bin_and_libs ${plymouth}/bin/plymouthd copy_bin_and_libs ${cfg.package}/bin/plymouthd
'' ''
+ checkIfThemeExists + checkIfThemeExists
@@ -331,12 +340,12 @@ in
mkdir -p $out/lib/plymouth/renderers mkdir -p $out/lib/plymouth/renderers
# module might come from a theme # module might come from a theme
cp ${themesEnv}/lib/plymouth/*.so $out/lib/plymouth 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 # useless in the initrd, and adds several megabytes to the closure
rm $out/lib/plymouth/renderers/x11.so rm $out/lib/plymouth/renderers/x11.so
mkdir -p $out/share/plymouth/themes 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 # Copy themes into working directory for patching
mkdir themes mkdir themes