Skip to content
/ flops Public
forked from divnix/flops

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

Notifications You must be signed in to change notification settings

tao3k/flops

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nix 99.0%
  • Shell 1.0%