Allow options with type "package" to be store paths

For example, this allows writing

  nix.package = /nix/store/786mlvhd17xvcp2r4jmmay6jj4wj6b7f-nix-1.10pre4206_896428c;

Also, document types.package in the manual.
This commit is contained in:
Eelco Dolstra
2015-08-06 19:55:42 +02:00
parent fa7a0f24a4
commit 214d4fb73c
4 changed files with 30 additions and 4 deletions

View File

@@ -218,4 +218,9 @@ rec {
# Format a number adding leading zeroes up to fixed width.
fixedWidthNumber = width: n: fixedWidthString width "0" (toString n);
# Check whether a value is a store path.
isStorePath = x: builtins.substring 0 1 (toString x) == "/" && dirOf (builtins.toPath x) == builtins.storeDir;
}