1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-28 18:47:44 +00:00
ncc/lib/values.nix

18 lines
596 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; };
}