-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab424a3
commit 79c084c
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
source ./common.sh | ||
|
||
flakeDir=$TEST_ROOT/flake | ||
mkdir -p "$flakeDir" | ||
|
||
writeSimpleFlake "$flakeDir" | ||
cd "$flakeDir" | ||
|
||
|
||
# By default: Only show the packages content for the current system and no | ||
# legacyPackages at all | ||
nix flake show --json > show-output.json | ||
nix eval --impure --expr ' | ||
let show_output = builtins.fromJSON (builtins.readFile ./show-output.json); | ||
in | ||
assert show_output.packages.someOtherSystem.default == {}; | ||
assert show_output.packages.${builtins.currentSystem}.default.name == "simple"; | ||
assert show_output.legacyPackages.${builtins.currentSystem} == {}; | ||
true | ||
' | ||
|
||
# With `--all-systems`, show the packages for all systems | ||
nix flake show --json --all-systems > show-output.json | ||
nix eval --impure --expr ' | ||
let show_output = builtins.fromJSON (builtins.readFile ./show-output.json); | ||
in | ||
assert show_output.packages.someOtherSystem.default.name == "simple"; | ||
assert show_output.legacyPackages.${builtins.currentSystem} == {}; | ||
true | ||
' | ||
|
||
# With `--legacy`, show the legacy packages | ||
nix flake show --json --legacy > show-output.json | ||
nix eval --impure --expr ' | ||
let show_output = builtins.fromJSON (builtins.readFile ./show-output.json); | ||
in | ||
assert show_output.legacyPackages.${builtins.currentSystem}.hello.name == "simple"; | ||
true | ||
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters