1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-15 19:23:01 +03:00
mobile-nixos/bin/build

27 lines
490 B
Plaintext
Raw Normal View History

#!/usr/bin/env nix-shell
#!nix-shell -p ruby -i ruby
require_relative "../lib/rb/all.rb"
2018-06-23 23:06:53 +03:00
# Given a device name, instantiates `nix-build` to build
# everything needed to boot on that device.
if ARGV.count < 1 then
2018-06-13 05:29:26 +03:00
puts "Usage: bin/build <device-name>"
exit 1
end
DEVICE = ARGV.shift
2019-04-14 07:49:30 +03:00
NIXPKGS=File.join(*__dir__.split("/")[0..-2], "nixpkgs")
2018-06-23 23:06:53 +03:00
run(
"env", "-i",
"nix-build", "-A", "all",
2019-04-14 07:49:30 +03:00
"-I", "nixpkgs=#{NIXPKGS}",
"--argstr", "device", DEVICE,
2018-06-24 05:08:24 +03:00
*ARGV,
exec: true
2018-06-23 23:06:53 +03:00
)
# vim: ft=ruby