From ac64c303450b2fea54e95b08ca090d3778bb3211 Mon Sep 17 00:00:00 2001 From: 5225225 <5225225@mailbox.org> Date: Mon, 2 Feb 2026 21:35:47 +0000 Subject: [PATCH] Fix lix warnings for using "or" as an identifier > warning: using or as an identifier is deprecated because it cannot be > used in most places (try let or = 1; in or). Use > --extra-deprecated-features or-as-identifier to disable this warning. This is a bit of a hack, using quotes to silence the warning for now. It does *work*, but only in places where it's not ambiguous anyways. Long term, we should come up with a different name that doesn't conflict with a keyword. --- src/bools/default.nix | 2 +- src/bools/default.test.nix | 8 ++++---- src/options/default.nix | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bools/default.nix b/src/bools/default.nix index 49867da..696da19 100644 --- a/src/bools/default.nix +++ b/src/bools/default.nix @@ -44,7 +44,7 @@ lib: { /** Perform a logical OR operation on two values. */ - or = a: b: a || b; + "or" = a: b: a || b; /** Perform a logical OR operation on two functions being applied to a value. diff --git a/src/bools/default.test.nix b/src/bools/default.test.nix index 1f9c924..e3f1154 100644 --- a/src/bools/default.test.nix +++ b/src/bools/default.test.nix @@ -117,25 +117,25 @@ in "returns true when both are true" = let expected = true; - actual = lib.bools.or true true; + actual = lib.bools."or" true true; in actual == expected; "returns true when first is true" = let expected = true; - actual = lib.bools.or true false; + actual = lib.bools."or" true false; in actual == expected; "returns true when second is true" = let expected = true; - actual = lib.bools.or false true; + actual = lib.bools."or" false true; in actual == expected; "returns false when both are false" = let expected = false; - actual = lib.bools.or false false; + actual = lib.bools."or" false false; in actual == expected; }; diff --git a/src/options/default.nix b/src/options/default.nix index 082008f..26c9ed2 100644 --- a/src/options/default.nix +++ b/src/options/default.nix @@ -17,7 +17,7 @@ lib: { mergedFunctions = x: lib.options.mergeDefault location (builtins.map (f: f x) values); mergedLists = builtins.concatLists values; mergedAttrs = builtins.foldl' lib.attrs.merge { } values; - mergedBools = builtins.any lib.bools.or false values; + mergedBools = builtins.any lib.bools."or" false values; mergedStrings = lib.strings.concat values; in if builtins.length values == 1 then