diff --git a/nixos/boxes/kelder/boot.nix b/nixos/boxes/kelder/boot.nix index 26c31fe..2f06273 100644 --- a/nixos/boxes/kelder/boot.nix +++ b/nixos/boxes/kelder/boot.nix @@ -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 = { diff --git a/nixos/boxes/kelder/plymouth/bridge.png b/nixos/boxes/kelder/plymouth/bridge.png new file mode 100644 index 0000000..6430076 Binary files /dev/null and b/nixos/boxes/kelder/plymouth/bridge.png differ diff --git a/nixos/boxes/kelder/plymouth/kelder.plymouth b/nixos/boxes/kelder/plymouth/kelder.plymouth new file mode 100644 index 0000000..19624bb --- /dev/null +++ b/nixos/boxes/kelder/plymouth/kelder.plymouth @@ -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 diff --git a/nixos/boxes/kelder/plymouth/kelder.png b/nixos/boxes/kelder/plymouth/kelder.png new file mode 100644 index 0000000..fe18e15 Binary files /dev/null and b/nixos/boxes/kelder/plymouth/kelder.png differ diff --git a/nixos/boxes/kelder/plymouth/kelder.script b/nixos/boxes/kelder/plymouth/kelder.script new file mode 100644 index 0000000..cbabff6 --- /dev/null +++ b/nixos/boxes/kelder/plymouth/kelder.script @@ -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);