1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-11 09:04:01 +03:00

boot/recovery-menu: Use mkLVGUIApp

This commit is contained in:
Samuel Dionne-Riel 2021-06-13 17:59:58 -04:00
parent 4e2cd380a0
commit 0a397decfe
3 changed files with 10 additions and 56 deletions

View File

@ -1,36 +1,12 @@
{ runCommandNoCC
, lib
, mruby
}:
{ lib, runCommandNoCC, mobile-nixos }:
let
inherit (lib) concatMapStringsSep;
# Select libs we need from the libs folder.
libs = concatMapStringsSep " " (name: "${../lib}/${name}") [
"hal/reboot_modes.rb"
"init/configuration.rb"
"lvgui/args.rb"
"lvgui/fiddlier.rb"
"lvgui/lvgl/*.rb"
"lvgui/lvgui/*.rb"
"lvgui/mobile_nixos/*.rb"
"lvgui/vtconsole.rb"
];
in
# mkDerivation will append something like -aarch64-unknown-linux-gnu to the
# derivation name with cross, which will break the mruby code loading.
# Since we don't need anything from mkDerivation, really, let's use runCommandNoCC.
runCommandNoCC "boot-recovery-menu.mrb" {
mobile-nixos.mkLVGUIApp {
name = "boot-recovery-menu.mrb";
executablePath = "libexec/boot-recovery-menu.mrb";
src = lib.cleanSource ./.;
nativeBuildInputs = [
mruby
rubyFiles = [
"${../lib}/hal/reboot_modes.rb"
"${../lib}/init/configuration.rb"
"main.rb"
];
} ''
mrbc \
-o $out \
${libs} \
$src/main.rb
''
}

View File

@ -1,22 +0,0 @@
{ stdenv
, lib
, callPackage
, mrbgems
, mruby
, mobile-nixos
}:
let
script-loader = mobile-nixos.stage-1.script-loader.override({
withSimulator = true;
});
applet = callPackage ./. {};
in
(script-loader.wrap {
name = "simulator";
inherit applet;
}).overrideAttrs(old: rec {
pname = "boot-recovery-menu-simulator";
version = "0.0.1";
name = "${pname}-${version}";
})

View File

@ -134,7 +134,7 @@ in
autoport = callPackage ./mobile-nixos/autoport {};
boot-recovery-menu-simulator = callPackage ../boot/recovery-menu/simulator.nix {};
boot-recovery-menu-simulator = self.mobile-nixos.stage-1.boot-recovery-menu.simulator;
boot-splash-simulator = self.mobile-nixos.stage-1.boot-splash.simulator;
fdt-forward = callPackage ./mobile-nixos/fdt-forward {};