26 lines
656 B
Nix
26 lines
656 B
Nix
lib:
|
|
let
|
|
overrideExistingOld =
|
|
old:
|
|
new:
|
|
builtins.mapAttrs (name: value: new.${name} or value) old;
|
|
|
|
overrideExistingNew =
|
|
old:
|
|
new:
|
|
old // (builtins.intersectAttrs old new);
|
|
|
|
bigdata = lib.genAttrs (lib.imap0 (i: _: toString i) (lib.replicate 999999 null)) (_: null);
|
|
attrsToOverride = {
|
|
"1" = "lmao";
|
|
"183" = "lmao";
|
|
"1823" = "lmao";
|
|
"1223" = "lmao";
|
|
"ads;fkjasdlfkja" = "no";
|
|
};
|
|
in {
|
|
old = overrideExistingOld bigdata attrsToOverride;
|
|
new = overrideExistingNew bigdata attrsToOverride;
|
|
sanity = (overrideExistingOld bigdata attrsToOverride) == (overrideExistingNew bigdata attrsToOverride);
|
|
}
|