diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-11-10 12:17:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-10 12:17:11 +0100 |
commit | a218cfd6c7e1686ee10cb0ef214cf3c624d15765 (patch) | |
tree | f1106cd05e50b5e81bd086792a9a375c5f25905a | |
parent | 67179472dfe30c97af9a5aeed0190c0e765936cf (diff) | |
parent | ceeecf2f9e62ee9077228f71e714b947b72717a6 (diff) |
Merge pull request #5528 from matthewbauer/recognize-nixosModule
Recognize singular "nixosModule" in nix flake show
-rw-r--r-- | src/nix/flake.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nix/flake.cc b/src/nix/flake.cc index 5eeb5498a..97f4d911c 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -1052,7 +1052,8 @@ struct CmdFlakeShow : FlakeCommand, MixJSON (attrPath.size() == 1 && attrPath[0] == "overlay") || (attrPath.size() == 2 && attrPath[0] == "overlays") ? std::make_pair("nixpkgs-overlay", "Nixpkgs overlay") : attrPath.size() == 2 && attrPath[0] == "nixosConfigurations" ? std::make_pair("nixos-configuration", "NixOS configuration") : - attrPath.size() == 2 && attrPath[0] == "nixosModules" ? std::make_pair("nixos-module", "NixOS module") : + (attrPath.size() == 1 && attrPath[0] == "nixosModule") + || (attrPath.size() == 2 && attrPath[0] == "nixosModules") ? std::make_pair("nixos-module", "NixOS module") : std::make_pair("unknown", "unknown"); if (json) { j.emplace("type", type); |