1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2026-01-14 17:21:01 +00:00
ncc/lib/values.nix
2025-02-23 21:05:40 +03:00

18 lines
598 B
Nix

_: self: _: let
inherit (self) merge mkMerge;
in {
# When the block has a `_type` attribute in the NixOS
# module system, anything not immediately relevant is
# silently ignored. We can make use of that by adding
# a `__functor` attribute, which lets us call the set.
merge = mkMerge [] // {
__functor = self: next: self // {
# Technically, `contents` is implementation defined
# but nothing ever happens, so we can rely on this.
contents = self.contents ++ [ next ];
};
};
enabled = merge { enable = true; };
disabled = merge { enable = false; };
}