lib.systems.equals: Ignore all function attributes reflectively
Co-authored-by: Artturi <Artturin@artturin.com>
This commit is contained in:
parent
18c7f6237f
commit
144018541b
@ -24,8 +24,8 @@ rec {
|
|||||||
both arguments have been `elaborate`-d.
|
both arguments have been `elaborate`-d.
|
||||||
*/
|
*/
|
||||||
equals =
|
equals =
|
||||||
let uncomparable = { canExecute = null; emulator = null; emulatorAvailable = null; isCompatible = null; };
|
let removeFunctions = a: lib.filterAttrs (_: v: !builtins.isFunction v) a;
|
||||||
in a: b: a // uncomparable == b // uncomparable;
|
in a: b: removeFunctions a == removeFunctions b;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Try to convert an elaborated system back to a simple string. If not possible,
|
Try to convert an elaborated system back to a simple string. If not possible,
|
||||||
|
@ -69,7 +69,7 @@ lib.runTests (
|
|||||||
let modified =
|
let modified =
|
||||||
assert origValue != arbitraryValue;
|
assert origValue != arbitraryValue;
|
||||||
lib.systems.elaborate "x86_64-linux" // { ${platformAttrName} = arbitraryValue; };
|
lib.systems.elaborate "x86_64-linux" // { ${platformAttrName} = arbitraryValue; };
|
||||||
arbitraryValue = "<<modified>>";
|
arbitraryValue = x: "<<modified>>";
|
||||||
in {
|
in {
|
||||||
expr = lib.systems.equals (lib.systems.elaborate "x86_64-linux") modified;
|
expr = lib.systems.equals (lib.systems.elaborate "x86_64-linux") modified;
|
||||||
expected = {
|
expected = {
|
||||||
|
Loading…
Reference in New Issue
Block a user