apparently this feature got lost in the migration to exec'ing daemons. Change-Id: Iac9425cf6d20781bb49e5cf12f2056f4a3ec23ba
34 lines
628 B
Bash
34 lines
628 B
Bash
source common.sh
|
|
|
|
clearStore
|
|
|
|
withDaemonTrusting() {
|
|
local trusting="$1"
|
|
shift
|
|
|
|
trap killDaemon EXIT
|
|
|
|
NIX_CONFIG="
|
|
extra-experimental-features = daemon-trust-override
|
|
trusted-users = $trusting
|
|
" startDaemon "$@"
|
|
}
|
|
|
|
(
|
|
withDaemonTrusting "" --default-trust
|
|
nix store ping --json | jq -e '.trusted | not'
|
|
)
|
|
(
|
|
withDaemonTrusting "" --force-trusted
|
|
nix store ping --json | jq -e '.trusted'
|
|
)
|
|
|
|
(
|
|
withDaemonTrusting "$(whoami)" --default-trust
|
|
nix store ping --json | jq -e '.trusted'
|
|
)
|
|
(
|
|
withDaemonTrusting "$(whoami)" --force-untrusted
|
|
nix store ping --json | jq -e '.trusted | not'
|
|
)
|