mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-15 19:23:01 +03:00
24 lines
501 B
Plaintext
24 lines
501 B
Plaintext
|
#!/usr/bin/env nix-shell
|
||
|
#!nix-shell -p ruby -i ruby
|
||
|
|
||
|
# Given a device name, instantiates `nix-build` to build
|
||
|
# everything needed to boot on that device.
|
||
|
|
||
|
ROOT = File.join(__dir__, "..")
|
||
|
# Which file builds the basic building block for a whole device build.
|
||
|
ENTRY_POINT = File.join(ROOT, "bootimg.nix")
|
||
|
|
||
|
unless ARGV.count == 1 then
|
||
|
echo "Usage: bin/build <device-name>"
|
||
|
exit 1
|
||
|
end
|
||
|
|
||
|
DEVICE = ARGV.shift
|
||
|
|
||
|
system(
|
||
|
"nix-build", ENTRY_POINT,
|
||
|
"--arg", "device_name", "\"#{DEVICE}\"",
|
||
|
)
|
||
|
|
||
|
# vim: ft=ruby
|