powered by POP: Pure Object Prototypes && haumea
A nix language configuration framework based on POP: Pure Object
if you want to understand this repo how works and use cases easily, just read the tests and expressions directly. For having a human-readable test set, the problem of complexity wouldn’t exist anymore.
- snapshots : https://github.com/GTrunSec/flops/blob/master/tests/_snapshots/haumea
- expr: https://github.com/GTrunSec/flops/blob/master/tests/haumea/expr.nix
We could avoid putting all the inputs in the main flake.nix
- use the
flake.pops.default
to load a subflake.
callInputs =
(flops.lib.flake.pops.default.setInitInputs ./lib/__lock)
.setSystem
"x86_64-linux";
you can’t use the dmerge for the nixosModules
- David Arnold (blaggacao) said
dmerge can only work with json-serializable data on both sides. That’s by design.
test = with dmerge;
merge {
a.b.c = [];
a.c = lib.mkOption {
type = lib.types.submodule {
freeformType = lib.types.attrs;
options = {
enable = lib.mkEnableOption (lib.mdDoc "Whether to enable git profile");
};
};
};
} {a.b.c = append ["a" "b" "c"];};
testNonMerge =
{
a.b.c = [];
a.c = lib.mkOption {
type = lib.types.submodule {
freeformType = lib.types.attrs;
options = {
enable = lib.mkEnableOption (lib.mdDoc "Whether to enable git profile");
};
};
};
}
// {d = "d";};
So, we use withoutMergedOptions to keep the native options after the action of merged.