From fed5dc66f80ae3a159a2449904ae067f60a04a67 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 28 Dec 2022 23:38:06 +0100 Subject: [PATCH] treewide: isCoercibleToString -> isMoreCoercibleToString No change in behavior. --- lib/strings.nix | 2 +- lib/types.nix | 4 ++-- nixos/modules/services/misc/nix-daemon.nix | 2 +- nixos/modules/services/system/self-deploy.nix | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/strings.nix b/lib/strings.nix index 897fa3e3a204..6d2462d03b2a 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -810,7 +810,7 @@ rec { */ isMoreCoercibleToString = x: elem (typeOf x) [ "path" "string" "null" "int" "float" "bool" ] || - (isList x && lib.all isCoercibleToString x) || + (isList x && lib.all isMoreCoercibleToString x) || x ? outPath || x ? __toString; diff --git a/lib/types.nix b/lib/types.nix index a99872d2f96b..b5ac0369c539 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -54,7 +54,7 @@ let concatStringsSep escapeNixString hasInfix - isCoercibleToString + isMoreCoercibleToString isSimpleCoercibleToString ; inherit (lib.trivial) @@ -480,7 +480,7 @@ rec { path = mkOptionType { name = "path"; descriptionClass = "noun"; - check = x: isCoercibleToString x && builtins.substring 0 1 (toString x) == "/"; + check = x: isMoreCoercibleToString x && builtins.substring 0 1 (toString x) == "/"; merge = mergeEqualOption; }; diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix index 10db7cdfb33c..98d5150f2436 100644 --- a/nixos/modules/services/misc/nix-daemon.nix +++ b/nixos/modules/services/misc/nix-daemon.nix @@ -42,7 +42,7 @@ let else if isDerivation v then toString v else if builtins.isPath v then toString v else if isString v then v - else if strings.isCoercibleToString v then toString v + else if strings.isMoreCoercibleToString v then toString v else abort "The nix conf value: ${toPretty {} v} can not be encoded"; mkKeyValue = k: v: "${escape [ "=" ] k} = ${mkValueString v}"; diff --git a/nixos/modules/services/system/self-deploy.nix b/nixos/modules/services/system/self-deploy.nix index 9b1ebfd37522..9f5f39970f26 100644 --- a/nixos/modules/services/system/self-deploy.nix +++ b/nixos/modules/services/system/self-deploy.nix @@ -18,7 +18,7 @@ let in lib.concatStrings (lib.mapAttrsToList toArg args); - isPathType = x: lib.strings.isCoercibleToString x && builtins.substring 0 1 (toString x) == "/"; + isPathType = x: lib.strings.isMoreCoercibleToString x && builtins.substring 0 1 (toString x) == "/"; in {