summaryrefslogtreecommitdiffstats
path: root/by-name.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-11-02 15:27:36 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-11-02 15:27:36 +0100
commit867aaf8a3491810a7b5bcf39e6eca4365ab9a0aa (patch)
tree2cecb78077a1096324f161b4e8b1cbfcf2c3f618 /by-name.nix
parenttreewide: Add new math and options subcategories and restructure (diff)
downloadnix-library-867aaf8a3491810a7b5bcf39e6eca4365ab9a0aa.zip
by-name.nix: Remove useless `warn` function
Both cppnix and lix now have the `builtins.warn` function.
Diffstat (limited to 'by-name.nix')
-rw-r--r--by-name.nix7
1 files changed, 3 insertions, 4 deletions
diff --git a/by-name.nix b/by-name.nix
index 2d03e75..1b03712 100644
--- a/by-name.nix
+++ b/by-name.nix
@@ -7,7 +7,6 @@
#
# You should have received a copy of the License along with this program.
# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-{warn}:
# Adapted from this: https://github.com/NixOS/nixpkgs/blob/1814b56453c91192f6d5a6276079948f9fe96c18/pkgs/top-level/by-name-overlay.nix
# This file should not depend on `pkgs` and thus not use `lib`.
{
@@ -77,7 +76,7 @@ assert fileRegex == null -> fileName != null; let
# Type: String -> String -> ListOf Path
namesForShard = shard: type:
if type != "directory"
- then warn "Ignored non-directory, whilst importing by-name directory (${fileDisplay}): '${shard}'" {}
+ then builtins.warn "Ignored non-directory, whilst importing by-name directory (${fileDisplay}): '${shard}'" {}
else if useShards
then namesForElementShard shard type
else namesForElementDirect shard type;
@@ -102,14 +101,14 @@ assert fileRegex == null -> fileName != null; let
else if relativePaths
then pathSegment
else path
- else warn "'${builtins.toString path}' does not exist. Skipped" null;
+ else builtins.warn "'${builtins.toString path}' does not exist. Skipped" null;
in
if toplevelType != "directory"
then
# The `namesForShard` function should have already printed a warning.
[null]
else if (builtins.attrValues paths) == []
- then warn "'${fileDisplay}' did not match anything in ${builtins.toString rawPath}. Skipped" [null]
+ then builtins.warn "'${fileDisplay}' did not match anything in ${builtins.toString rawPath}. Skipped" [null]
else mapAttrsToList checkPath paths;
filterNull = list: builtins.filter (value: value != null) list;