2015-05-21 20:33:16 +00:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
2015-07-04 08:52:45 +00:00
|
|
|
# nixos-build system_name -> system_path
|
2015-05-21 20:33:16 +00:00
|
|
|
#
|
|
|
|
set -euf
|
|
|
|
|
2015-07-04 08:52:45 +00:00
|
|
|
system_name=$1
|
2015-05-21 20:33:16 +00:00
|
|
|
|
2015-07-04 08:52:45 +00:00
|
|
|
NIXOS_CONFIG=$config_root/modules/$system_name
|
2015-07-04 08:38:12 +00:00
|
|
|
export NIXOS_CONFIG
|
2015-05-21 20:33:16 +00:00
|
|
|
|
2015-07-04 08:27:42 +00:00
|
|
|
# Notice how host's NIX_PATH is used to prefetch nixpkgs.
|
2015-07-04 08:52:45 +00:00
|
|
|
prefetch nixpkgs "$nixpkgs_root/$system_name"
|
2015-07-04 08:38:12 +00:00
|
|
|
|
2015-07-04 08:52:45 +00:00
|
|
|
NIX_PATH=$nixpkgs_root/$system_name
|
|
|
|
NIX_PATH=$NIX_PATH:secrets=$secrets_root/$system_name/nix
|
2015-07-04 08:38:12 +00:00
|
|
|
NIX_PATH=$NIX_PATH:pubkeys=$config_root/pubkeys
|
|
|
|
NIX_PATH=$NIX_PATH:retiolum-hosts=$retiolum_hosts
|
|
|
|
export NIX_PATH
|
2015-05-21 21:52:06 +00:00
|
|
|
|
2015-07-04 08:38:12 +00:00
|
|
|
exec nix-build \
|
|
|
|
-A system \
|
|
|
|
--no-out-link \
|
|
|
|
'<nixos>'
|