2024-05-28 19:43:04 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-02-18 01:37:35 +02:00
|
|
|
source common.sh
|
|
|
|
|
|
|
|
drvPath=$(nix-instantiate simple.nix)
|
|
|
|
|
2024-06-04 23:32:33 +03:00
|
|
|
nix derivation show "$drvPath" | jq .[] > "$TEST_HOME"/simple.json
|
2023-02-18 01:37:35 +02:00
|
|
|
|
2024-06-04 23:32:33 +03:00
|
|
|
drvPath2=$(nix derivation add < "$TEST_HOME"/simple.json)
|
2023-02-18 01:37:35 +02:00
|
|
|
|
|
|
|
[[ "$drvPath" = "$drvPath2" ]]
|
|
|
|
|
|
|
|
# Input addressed derivations cannot be renamed.
|
2024-06-04 23:32:33 +03:00
|
|
|
jq '.name = "foo"' < "$TEST_HOME"/simple.json | expectStderr 1 nix derivation add | grepQuiet "has incorrect output"
|