1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-15 19:23:01 +03:00
mobile-nixos/modules/initrd-splash.nix
Samuel Dionne-Riel f9b5868c1a stage-1: Use ply-image for splash purposes.
This is upstream in-use by google for chromebooks, which means some
support for some advanced things.

This especially means animations can be handled by ply-image if so
desired.
2018-07-03 23:50:16 -04:00

46 lines
977 B
Nix

{ config, lib, pkgs, ... }:
with lib;
with import ./initrd-order.nix;
let
cfg = config.mobile.boot.stage-1.splash;
in
{
options.mobile.boot.stage-1.splash = {
enable = mkOption {
type = types.bool;
default = true;
description = ''
Enables splash screen.
'';
};
};
config.mobile.boot.stage-1 = lib.mkIf cfg.enable (mkMerge [
{
init = lib.mkOrder AFTER_FRAMEBUFFER_INIT ''
show_splash() {
ply-image /$1.png > /dev/null 2>&1
}
show_splash loading
'';
extraUtils = [
{ package = pkgs.ply-image; extraCommand = "cp -pv ${pkgs.glibc.out}/lib/libpthread.so.* $out/lib"; }
];
contents = [
{ object = ../loading.png; symlink = "/loading.png"; }
];
}
{
init = lib.mkOrder READY_INIT ''
show_splash splash
'';
contents = [
{ object = ../temp-splash.png; symlink = "/splash.png"; }
];
}
]);
}