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

Merge pull request #568 from samueldr-wip/feature/installer-boot-closure

examples/installer: Add boot closure to installer
This commit is contained in:
Samuel Dionne-Riel 2023-01-24 22:31:57 -05:00 committed by GitHub
commit 0bc11b087a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View File

@ -1,6 +1,7 @@
{
imports = [
./adb.nix
./boot-closure.nix
./filesystems.nix
./installer-gui.nix
./installer-script.nix

View File

@ -0,0 +1,30 @@
{ config, lib, ... }:
let
inherit (lib)
mkIf
optionalString
;
inherit (config.mobile)
system
;
in
{
# Pins pre-built artifacts within the system closure that are going to be
# used by the installer.
system.extraSystemBuilderCmds = ''
echo ":: Adding pre-built boot files to closure..."
(
PS4=" $ "; set -x
mkdir -p $out/mobile-nixos-installer
cd $out/mobile-nixos-installer
ln -s ${config.mobile.boot.stage-1.kernel.package} kernel
${optionalString (system.type == "depthcharge") ''
ln -s ${config.mobile.outputs.depthcharge.kpart} kpart
''}
${optionalString (system.type == "u-boot") ''
ln -s ${config.mobile.outputs.u-boot.boot-partition} boot-partition
''}
)
'';
}