1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2025-01-06 03:27:17 +03:00
mobile-nixos/bin/build

30 lines
459 B
Ruby
Executable File

#!/usr/bin/env nix-shell
#!nix-shell -p ruby -i ruby
require "shellwords"
# Given a device name, instantiates `nix-build` to build
# everything needed to boot on that device.
ROOT = File.join(__dir__, "..")
if ARGV.count < 1 then
puts "Usage: bin/build <device-name>"
exit 1
end
DEVICE = ARGV.shift
cmd = [
"nix-build", "-A", "all",
"--argstr", "device", DEVICE,
*ARGV
]
puts " $ #{cmd.shelljoin}"
system(*cmd)
exit $?.exitstatus
# vim: ft=ruby