tao3k / flops

A nix language configuration framework based on POP: Pure Object Prototypes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README

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.

bye bye, a bloated flake inputs

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";

Merge

dmerge

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.

About

A nix language configuration framework based on POP: Pure Object Prototypes


Languages

Language:Nix 100.0%