lib.systems.equals: Ignore all function attributes reflectively

Co-authored-by: Artturi <Artturin@artturin.com>
This commit is contained in:
Robert Hensing 2023-06-13 10:22:06 +02:00
parent 18c7f6237f
commit 144018541b
2 changed files with 3 additions and 3 deletions

View File

@ -24,8 +24,8 @@ rec {
both arguments have been `elaborate`-d.
*/
equals =
let uncomparable = { canExecute = null; emulator = null; emulatorAvailable = null; isCompatible = null; };
in a: b: a // uncomparable == b // uncomparable;
let removeFunctions = a: lib.filterAttrs (_: v: !builtins.isFunction v) a;
in a: b: removeFunctions a == removeFunctions b;
/*
Try to convert an elaborated system back to a simple string. If not possible,

View File

@ -69,7 +69,7 @@ lib.runTests (
let modified =
assert origValue != arbitraryValue;
lib.systems.elaborate "x86_64-linux" // { ${platformAttrName} = arbitraryValue; };
arbitraryValue = "<<modified>>";
arbitraryValue = x: "<<modified>>";
in {
expr = lib.systems.equals (lib.systems.elaborate "x86_64-linux") modified;
expected = {