mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-15 11:03:37 +03:00
27 lines
490 B
Ruby
Executable File
27 lines
490 B
Ruby
Executable File
#!/usr/bin/env nix-shell
|
|
#!nix-shell -p ruby -i ruby
|
|
|
|
require_relative "../lib/rb/all.rb"
|
|
|
|
# Given a device name, instantiates `nix-build` to build
|
|
# everything needed to boot on that device.
|
|
|
|
if ARGV.count < 1 then
|
|
puts "Usage: bin/build <device-name>"
|
|
exit 1
|
|
end
|
|
|
|
DEVICE = ARGV.shift
|
|
NIXPKGS=File.join(*__dir__.split("/")[0..-2], "nixpkgs")
|
|
|
|
run(
|
|
"env", "-i",
|
|
"nix-build", "-A", "all",
|
|
"-I", "nixpkgs=#{NIXPKGS}",
|
|
"--argstr", "device", DEVICE,
|
|
*ARGV,
|
|
exec: true
|
|
)
|
|
|
|
# vim: ft=ruby
|