Update to radiantave-cpp, enable plymouth boot image
This commit is contained in:
Vendored
BIN
Binary file not shown.
Executable
+65
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 96 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 89 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 52 KiB |
+41
-2
@@ -1,4 +1,4 @@
|
||||
{ pkgs, radiantwave, upgradeFlakeRef, ... }:
|
||||
{ pkgs, radiantwave, upgradeFlakeRef, radiantwavePlymouth, ... }:
|
||||
|
||||
let
|
||||
radiantApp = radiantwave.packages.${pkgs.system}.default;
|
||||
@@ -18,10 +18,42 @@ in
|
||||
# This populates the EFI partition and tells the NUC how to start NixOS.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
# Boot straight into the splash screen without waiting on the bootloader menu.
|
||||
boot.loader.timeout = 0;
|
||||
|
||||
# Hardware-specific: NUC 14 needs these for the NVMe and Graphics
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "i915" "drm" "drm_kms_helper" ];
|
||||
boot.kernelParams = [ "quiet" "splash" ];
|
||||
|
||||
# --- RadiantWave splash: Plymouth from boot until the app's first frame ---
|
||||
boot.plymouth.enable = true;
|
||||
boot.plymouth.theme = "radiantwave";
|
||||
boot.plymouth.themePackages = [ radiantwavePlymouth ];
|
||||
|
||||
# Silence the kernel/initrd output behind the splash. The module adds
|
||||
# "splash" itself; we keep "quiet" plus show_status=false and loglevel 0.
|
||||
boot.consoleLogLevel = 0;
|
||||
boot.initrd.verbose = false;
|
||||
boot.kernelParams = [ "quiet" "splash" "systemd.show_status=false" ];
|
||||
|
||||
# Hold the splash until the app is ready to take over the display, instead of
|
||||
# quitting at multi-user.target (which would flash a black/console screen
|
||||
# during the login shell's network wait). The kiosk login shell runs
|
||||
# `sudo -n plymouth quit --wait` immediately before exec'ing cage.
|
||||
systemd.services.plymouth-quit.wantedBy = pkgs.lib.mkForce [ ];
|
||||
systemd.services.plymouth-quit-wait.wantedBy = pkgs.lib.mkForce [ ];
|
||||
|
||||
# Allow the kiosk user to quit Plymouth (NOPASSWD, command-scoped).
|
||||
security.sudo.extraRules = [
|
||||
{
|
||||
users = [ "kiosk" ];
|
||||
commands = [
|
||||
{
|
||||
command = "/run/current-system/sw/bin/plymouth";
|
||||
options = [ "NOPASSWD" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
hardware.graphics.enable = true;
|
||||
|
||||
@@ -29,6 +61,10 @@ in
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
nix.settings.access-tokens = {
|
||||
"gitea.radiantwavetech.com" = "ff524968d31acc5c4da350d0884a87264d0e8881";
|
||||
};
|
||||
|
||||
system.autoUpgrade = {
|
||||
enable = true;
|
||||
flake = upgradeFlakeRef;
|
||||
@@ -105,6 +141,9 @@ in
|
||||
# Pin system audio to 100% and unmute before launching RadiantWave
|
||||
${pkgs.systemd}/bin/systemctl --user start radiantwave-audio-init.service || true
|
||||
|
||||
# Release the splash screen right before the compositor takes over the display
|
||||
sudo -n plymouth quit --wait || true
|
||||
|
||||
exec dbus-run-session cage -- /run/current-system/sw/bin/radiantwave -d -s > /tmp/kiosk.log 2>&1
|
||||
fi
|
||||
'';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
nixos-facter-modules.url = "github:numtide/nixos-facter-modules";
|
||||
radiantwave.url = "git+https://gitea.radiantwavetech.com/RadiantWaveTech/radiantwave.git?ref=main";
|
||||
radiantwave-dev.url = "git+https://gitea.radiantwavetech.com/RadiantWaveTech/radiantwave.git?ref=dev";
|
||||
radiantwave-dev.url = "git+https://gitea.radiantwavetech.com/RadiantWaveTech/radiantwave-cpp.git?ref=dev";
|
||||
nixos-raspberrypi.url = "github:nvmd/nixos-raspberrypi/main";
|
||||
};
|
||||
|
||||
@@ -22,6 +22,35 @@
|
||||
}@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
# Plymouth theme: renders the RadiantWave SVG to a full-HD splash.png
|
||||
# at build time (librsvg), so the theme is hermetic and resolution-
|
||||
# independent. The .plymouth file's /usr paths are rewritten to $out
|
||||
# (the NixOS module's initrd fixup rewrites store paths again).
|
||||
radiantwavePlymouth = pkgs.stdenv.mkDerivation {
|
||||
pname = "radiantwave-plymouth";
|
||||
version = "1.0.0";
|
||||
|
||||
nativeBuildInputs = [ pkgs.librsvg ];
|
||||
|
||||
src = ./assets/RWT-Circular-Color-ForOnDark.svg;
|
||||
|
||||
buildPhase = ''
|
||||
mkdir -p $out/share/plymouth/themes/radiantwave
|
||||
rsvg-convert \
|
||||
--keep-aspect-ratio \
|
||||
--background-color=#111318 \
|
||||
--width=3840 \
|
||||
--height=2160 \
|
||||
--output=$out/share/plymouth/themes/radiantwave/splash.png \
|
||||
$src
|
||||
sed 's,/usr/,'"$out"'/,g' ${./plymouth-theme/radiantwave.plymouth} \
|
||||
> $out/share/plymouth/themes/radiantwave/radiantwave.plymouth
|
||||
cp ${./plymouth-theme/radiantwave.script} \
|
||||
$out/share/plymouth/themes/radiantwave/radiantwave.script
|
||||
'';
|
||||
};
|
||||
|
||||
mkKioskSystem = { system, radiantwave, upgradeFlakeRef, extraModules ? [], diskModule, enableAutoUpgrade ? true, extraSpecialArgs ? {}}:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
@@ -30,6 +59,7 @@
|
||||
specialArgs = {
|
||||
inherit radiantwave;
|
||||
inherit upgradeFlakeRef;
|
||||
inherit radiantwavePlymouth;
|
||||
} // extraSpecialArgs;
|
||||
|
||||
modules = [
|
||||
@@ -48,6 +78,7 @@
|
||||
specialArgs = {
|
||||
inherit radiantwave upgradeFlakeRef;
|
||||
inherit nixos-raspberrypi;
|
||||
inherit radiantwavePlymouth;
|
||||
};
|
||||
|
||||
modules = [
|
||||
|
||||
@@ -1,6 +1,26 @@
|
||||
wallpaper_image = Image("splash.png");
|
||||
screen_width = Window.GetWidth();
|
||||
screen_height = Window.GetHeight();
|
||||
resized_wallpaper_image = wallpaper_image.Scale(screen_width, screen_height);
|
||||
wallpaper_sprite = Sprite(resized_wallpaper_image);
|
||||
|
||||
# Scale the wallpaper to cover the whole screen, then center-crop the overflow.
|
||||
# Works for both landscape (NUC) and portrait (rotated android) displays
|
||||
# without distorting the artwork.
|
||||
scale_x = screen_width / wallpaper_image.GetWidth();
|
||||
scale_y = screen_height / wallpaper_image.GetHeight();
|
||||
|
||||
if (scale_x > scale_y) {
|
||||
scale = scale_x;
|
||||
} else {
|
||||
scale = scale_y;
|
||||
}
|
||||
|
||||
scaled_width = wallpaper_image.GetWidth() * scale;
|
||||
scaled_height = wallpaper_image.GetHeight() * scale;
|
||||
scaled_image = wallpaper_image.Scale(scaled_width, scaled_height);
|
||||
|
||||
crop_x = (scaled_width - screen_width) / 2;
|
||||
crop_y = (scaled_height - screen_height) / 2;
|
||||
cropped_image = scaled_image.Crop(crop_x, crop_y, screen_width, screen_height);
|
||||
|
||||
wallpaper_sprite = Sprite(cropped_image);
|
||||
wallpaper_sprite.SetZ(-100);
|
||||
|
||||
@@ -30,6 +30,9 @@ in
|
||||
# Pin system audio to 100% and unmute before launching RadiantWave
|
||||
${pkgs.systemd}/bin/systemctl --user start radiantwave-audio-init.service || true
|
||||
|
||||
# Release the splash screen right before the compositor takes over the display
|
||||
sudo -n plymouth quit --wait || true
|
||||
|
||||
exec dbus-run-session cage -- ${kioskscript} > /tmp/kiosk.log 2>&1
|
||||
fi
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user