there can be only one nixos-query

This commit is contained in:
tv 2015-06-24 20:46:25 +02:00
parent a9aaf3c9b1
commit aaa777168e
3 changed files with 13 additions and 31 deletions

View File

@ -15,11 +15,18 @@ if ! test -e "$secrets_rsync"; then
exit # nothing to do exit # nothing to do
fi fi
retiolum_secret=$(nixos-query $system_name tv.retiolum.privateKeyFile) # XXX this is ugly
retiolum_uid=$(nixos-query $system_name users.extraUsers.retiolum-tinc.uid) # Notice NIX_PATH used from host
# Notice secrets required to evaluate configuration
NIX_PATH=$NIX_PATH:nixos-config=$PWD/modules/$system_name
NIX_PATH=$NIX_PATH:secrets=$PWD/secrets/$system_name/nix
export NIX_PATH
ejabberd_secret=$(nixos-query $system_name services.ejabberd-cd.certFile) retiolum_secret=$(new-nixos-query tv.retiolum.privateKeyFile)
ejabberd_uid=$(nixos-query $system_name users.extraUsers.ejabberd.uid) retiolum_uid=$(new-nixos-query users.extraUsers.retiolum-tinc.uid)
ejabberd_secret=$(new-nixos-query services.ejabberd-cd.certFile)
ejabberd_uid=$(new-nixos-query users.extraUsers.ejabberd.uid)
(set -x (set -x
rsync \ rsync \

View File

@ -1,8 +0,0 @@
#! /bin/sh
set -euf
nix-instantiate \
-A config."$1" \
--eval \
--json \
'<nixos>' \
| jq -r .

View File

@ -1,21 +1,4 @@
#! /bin/sh #! /bin/sh
set -euf set -euf
result=$(nix-instantiate -A config."$1" --eval --json '<nixos>')
host=$1 echo $result | jq -r .
attr=$2
nixpkgs=$nixpkgs_root/$host
nixos_config=$config_root/modules/$host
secrets_nix=$secrets_root/$host/nix
secrets_rsync=$secrets_root/$host/rsync
nix-instantiate \
-I "$nixpkgs" \
-I nixos-config="$nixos_config" \
-I retiolum-hosts="$retiolum_hosts" \
-I secrets="$secrets_nix" \
-A config."$attr" \
'<nixos>' \
--eval \
--json \
| jq -r .