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