From ceeecf2f9e62ee9077228f71e714b947b72717a6 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 9 Nov 2021 11:14:15 -0600 Subject: [PATCH] Recognize singular "nixosModule" in nix flake show This makes nixosModule appears as a "NixOS Module" like nixosModules does. --- src/nix/flake.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);