2018-06-17 06:43:11 +03:00
|
|
|
{ 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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-06-21 03:18:44 +03:00
|
|
|
config.mobile.boot.stage-1 = lib.mkIf cfg.enable (mkMerge [
|
|
|
|
{
|
|
|
|
init = lib.mkOrder AFTER_FRAMEBUFFER_INIT ''
|
|
|
|
show_splash() {
|
2018-07-04 06:50:16 +03:00
|
|
|
ply-image /$1.png > /dev/null 2>&1
|
2018-06-21 03:18:44 +03:00
|
|
|
}
|
2018-06-17 06:43:11 +03:00
|
|
|
|
2018-06-21 03:18:44 +03:00
|
|
|
show_splash loading
|
|
|
|
'';
|
|
|
|
extraUtils = [
|
2018-07-04 06:50:16 +03:00
|
|
|
{ package = pkgs.ply-image; extraCommand = "cp -pv ${pkgs.glibc.out}/lib/libpthread.so.* $out/lib"; }
|
2018-06-21 03:18:44 +03:00
|
|
|
];
|
|
|
|
contents = [
|
|
|
|
{ object = ../loading.png; symlink = "/loading.png"; }
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
init = lib.mkOrder READY_INIT ''
|
|
|
|
show_splash splash
|
|
|
|
'';
|
|
|
|
contents = [
|
|
|
|
{ object = ../temp-splash.png; symlink = "/splash.png"; }
|
|
|
|
];
|
|
|
|
}
|
|
|
|
]);
|
2018-06-17 06:43:11 +03:00
|
|
|
}
|