From 8c888b693a67e9fef9364924694f68d92e0d8509 Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Mon, 1 Jul 2024 13:20:21 -0700 Subject: [PATCH] plymouth --- hosts/snowhawk/configuration.nix | 1 + modules/default.nix | 1 + modules/plymouth.nix | 52 ++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 modules/plymouth.nix diff --git a/hosts/snowhawk/configuration.nix b/hosts/snowhawk/configuration.nix index 7a5b039..6f6d0c8 100644 --- a/hosts/snowhawk/configuration.nix +++ b/hosts/snowhawk/configuration.nix @@ -20,6 +20,7 @@ snowhawk = { dwm.enable = true; syncthing.enable = true; + plymouth.enable = true; }; # Configure keymap in X11 diff --git a/modules/default.nix b/modules/default.nix index 7dc44af..9b1db46 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -7,6 +7,7 @@ ./audio.nix ./env.nix ./syncthing.nix + ./plymouth.nix ]; snowhawk.i18n.enable = lib.mkDefault true; diff --git a/modules/plymouth.nix b/modules/plymouth.nix new file mode 100644 index 0000000..540e2bd --- /dev/null +++ b/modules/plymouth.nix @@ -0,0 +1,52 @@ +# Yoinky Sploinky https://git.nullcube.net/nullcube/nixos/src/commit/d732b27507e70ed6f37e51ea2e5f8b7d7b3582dc/nixosModules/plymouth.nix +{ config, pkgs, lib, ... }: + +with lib; +let + cfg = config.snowhawk.plymouth; +in +{ + options.snowhawk.plymouth = { + enable = mkEnableOption "plymouth module"; + theme = mkOption { + default = "spinner_alt"; + example = "circle"; + description = '' + The plymouth theme to download and activate + ''; + }; + loaderTimeout = mkOption { + default = 5; + example = 0; + description = '' + The timeout for the bootloader select screen + ''; + }; + }; + + config = mkIf cfg.enable { + boot = { + plymouth = { + enable = true; + theme = cfg.theme; + themePackages = mkDefault [ + (pkgs.adi1090x-plymouth-themes.override { + selected_themes = [ cfg.theme ]; + }) + ]; + }; + consoleLogLevel = 0; + initrd.verbose = false; + kernelParams = [ + "quiet" + "splash" + "boot.shell_on_fail" + "loglevel=3" + "rd.systemd.show_status=false" + "rd.udev.log_level=3" + "udev.log_priority=3" + ]; + loader.timeout = cfg.loaderTimeout; + }; + }; +}