nixos/kelder: Add custom boot splash
This commit is contained in:
parent
3a5679a76d
commit
1f0c3c4160
@ -1,6 +1,20 @@
|
||||
{ pkgs, ... }: {
|
||||
{ lib, pkgs, ... }:
|
||||
let
|
||||
plymouth-kelder = pkgs.runCommand "plymouth-kelder" {} ''
|
||||
target="$out"/share/plymouth/themes/kelder
|
||||
mkdir -p "$target"
|
||||
|
||||
substituteAll ${./plymouth/kelder.plymouth} "$target"/kelder.plymouth
|
||||
cp ${./plymouth/kelder.script} "$target"/kelder.script
|
||||
cp ${./plymouth/kelder.png} "$target"/kelder.png
|
||||
cp ${./plymouth/bridge.png} "$target"/bridge.png
|
||||
'';
|
||||
in
|
||||
{
|
||||
boot.plymouth = {
|
||||
enable = true;
|
||||
themePackages = [ plymouth-kelder ];
|
||||
theme = "kelder";
|
||||
};
|
||||
|
||||
systemd.services = {
|
||||
|
BIN
nixos/boxes/kelder/plymouth/bridge.png
Normal file
BIN
nixos/boxes/kelder/plymouth/bridge.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
9
nixos/boxes/kelder/plymouth/kelder.plymouth
Normal file
9
nixos/boxes/kelder/plymouth/kelder.plymouth
Normal file
@ -0,0 +1,9 @@
|
||||
[Plymouth Theme]
|
||||
Name=kelder
|
||||
Description=kontent
|
||||
Comment=it's epic
|
||||
ModuleName=script
|
||||
|
||||
[script]
|
||||
ImageDir=@out@/share/plymouth/themes/kelder
|
||||
ScriptFile=@out@/share/plymouth/themes/kelder/kelder.script
|
BIN
nixos/boxes/kelder/plymouth/kelder.png
Normal file
BIN
nixos/boxes/kelder/plymouth/kelder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 310 KiB |
31
nixos/boxes/kelder/plymouth/kelder.script
Normal file
31
nixos/boxes/kelder/plymouth/kelder.script
Normal file
@ -0,0 +1,31 @@
|
||||
fps = 50;
|
||||
w = Window.GetWidth();
|
||||
h = Window.GetHeight();
|
||||
|
||||
debug_sprite = Sprite();
|
||||
fun debug(text) {
|
||||
debug_sprite.SetImage(Image.Text(text, 0, 0, 0));
|
||||
debug_sprite.SetPosition(0, 0, 1);
|
||||
}
|
||||
|
||||
kelder = Image("kelder.png").Scale(w, h);
|
||||
kelder_s = Sprite(kelder);
|
||||
|
||||
bridge = Image("bridge.png");
|
||||
bridge_s = Sprite();
|
||||
bridge_s.SetX((w / 2) - (bridge.GetWidth() / 2));
|
||||
bridge_s.SetY((h / 2) - (bridge.GetHeight() / 2));
|
||||
bridge_s.SetZ(10);
|
||||
bridge_s.SetImage(bridge);
|
||||
|
||||
frame = 0;
|
||||
fun refresh_callback() {
|
||||
time = frame / fps;
|
||||
|
||||
# loop over 1 seconds
|
||||
t = (time % 1) / 1;
|
||||
bridge_s.SetImage(bridge.Rotate(t * 1.5 * (2 * Math.Pi)));
|
||||
|
||||
frame++;
|
||||
}
|
||||
Plymouth.SetRefreshFunction(refresh_callback);
|
Loading…
Reference in New Issue
Block a user