mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-25 18:24:34 +00:00
Add polymouth
This commit is contained in:
parent
5514ffb24d
commit
97680bd24e
|
@ -47,6 +47,13 @@
|
|||
boot = {
|
||||
secure-boot.enable = true;
|
||||
tmpOnTmpfs = true;
|
||||
|
||||
# Boot splash screen
|
||||
plymouth = {
|
||||
enable = true;
|
||||
withThemes = true; # enable adi1090x/plymouth-themes
|
||||
selectedTheme = "colorful_loop";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
in {
|
||||
imports = [
|
||||
./secure-boot.nix
|
||||
./plymouth.nix
|
||||
];
|
||||
|
||||
options.myOptions.system.boot = {
|
||||
|
|
25
options/system/boot/plymouth.nix
Normal file
25
options/system/boot/plymouth.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ lib, ... }: with lib; let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
in
|
||||
{
|
||||
options.myOptions.system.boot.plymouth = {
|
||||
enable = mkEnableOption ''Plymouth boot splash.'';
|
||||
|
||||
withThemes = mkEnableOption ''
|
||||
Whether or not themes from https://github.com/adi1090x/plymouth-themes
|
||||
should be enabled and configured.
|
||||
'';
|
||||
|
||||
selectedTheme = mkOption {
|
||||
type = types.str;
|
||||
default = "bgrt";
|
||||
description = ''
|
||||
Choose which theme to use.
|
||||
|
||||
If you have `myOptions.system.boot.plymouth.withThemes` enabled, you can use more themes from the
|
||||
https://github.com/adi1090x/plymouth-themes project. You can find the the available theme names at
|
||||
https://github.com/NixOS/nixpkgs/blob/master/pkgs/data/themes/adi1090x-plymouth-themes/shas.nix.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -4,5 +4,6 @@ _: {
|
|||
./generic.nix
|
||||
./secure-boot.nix
|
||||
./initrd.nix
|
||||
./plymouth.nix
|
||||
];
|
||||
}
|
||||
|
|
28
system/boot/plymouth.nix
Normal file
28
system/boot/plymouth.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ config, lib, pkgs, ...}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.myOptions.system.boot.plymouth;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
boot.plymouth = {
|
||||
enable = true;
|
||||
theme = cfg.selectedTheme;
|
||||
}
|
||||
// lib.optionalAttrs cfg.withThemes {
|
||||
themePackages = [
|
||||
(pkgs.adi1090x-plymouth-themes.override {
|
||||
selected_themes = [ cfg.selectedTheme ];
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
# Make polymouth work with sleep
|
||||
powerManagement = {
|
||||
powerDownCommands = ''
|
||||
${pkgs.plymouth} --show-splash
|
||||
'';
|
||||
resumeCommands = ''
|
||||
${pkgs.plymouth} --quit
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue