stockholm/bin/nixos-build

25 lines
525 B
Bash
Executable File

#! /bin/sh
#
# nixos-build system_name -> system_path
#
set -euf
system_name=$1
NIXOS_CONFIG=$config_root/modules/$system_name
export NIXOS_CONFIG
# Notice how host's NIX_PATH is used to prefetch nixpkgs.
prefetch nixpkgs "$nixpkgs_root/$system_name"
NIX_PATH=$nixpkgs_root/$system_name
NIX_PATH=$NIX_PATH:secrets=$secrets_root/$system_name/nix
NIX_PATH=$NIX_PATH:pubkeys=$config_root/pubkeys
NIX_PATH=$NIX_PATH:retiolum-hosts=$retiolum_hosts
export NIX_PATH
exec nix-build \
-A system \
--no-out-link \
'<nixos>'