lib.options.mkPackageOption: use lib.showAttrPath
Make use of `lib.showAttrPath` instead of manually doing `concatStringsSep "."`. This means edge-cases such as the attr-path including names that are not valid nix identifiers will be handled better. See: - https://nix.dev/manual/nix/2.26/language/identifiers - https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.attrsets.showAttrPath
This commit is contained in:
@@ -57,5 +57,19 @@ in
|
||||
};
|
||||
in
|
||||
lib.mkPackageOption myPkgs "hello" { };
|
||||
|
||||
packageInvalidIdentifier =
|
||||
let
|
||||
myPkgs."123"."with\"quote" = { inherit (pkgs) hello; };
|
||||
in
|
||||
lib.mkPackageOption myPkgs [ "123" "with\"quote" "hello" ] { };
|
||||
|
||||
packageInvalidIdentifierExample = lib.mkPackageOption pkgs "hello" {
|
||||
example = [
|
||||
"123"
|
||||
"with\"quote"
|
||||
"hello"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user