aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-01 10:02:30 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-01 10:02:30 -0500
commit43414738a029a0b98f1937ba31501cf492d58003 (patch)
tree599f0381d096997d9ef75c62527d986e4b35bc0f /tests
parentb6c98752f6a7c1824945b3aee9d94e0af16046f8 (diff)
parent518da6c6a30881bd0e767a84c8193a198eeed230 (diff)
Merge remote-tracking branch 'upstream/master' into path-info
Diffstat (limited to 'tests')
-rw-r--r--tests/flakes/show.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/flakes/show.sh b/tests/flakes/show.sh
index 995de8dc3..dd13264b9 100644
--- a/tests/flakes/show.sh
+++ b/tests/flakes/show.sh
@@ -37,3 +37,30 @@ in
assert show_output.legacyPackages.${builtins.currentSystem}.hello.name == "simple";
true
'
+
+# Test that attributes are only reported when they have actual content
+cat >flake.nix <<EOF
+{
+ description = "Bla bla";
+
+ outputs = inputs: rec {
+ apps.$system = { };
+ checks.$system = { };
+ devShells.$system = { };
+ legacyPackages.$system = { };
+ packages.$system = { };
+ packages.someOtherSystem = { };
+
+ formatter = { };
+ nixosConfigurations = { };
+ nixosModules = { };
+ };
+}
+EOF
+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 == { };
+true
+'