Skip to content

Feature: New (optional?) format for modules, rices and hosts #9

@yunfachi

Description

@yunfachi

Ideally, the delib.module should work with two variants at the same time

Before

delib.module {
  name = "programs.swww";

  options.programs.swww = with delib; {
    enable = boolOption true; #TODO default false
    enableCommands = boolOption true;
  };

  myconfig.ifEnabled = {cfg, ...}: {
    commands.onWindowManager = lib.mkIf cfg.enableCommands [
      "swww-daemon"
    ];
  };

  home.ifEnabled.home.packages = [pkgs.swww];
}

After

delib.module "programs.swww" (cfg: {
  options.programs.swww = with delib; {
    enable = boolOption true;
    enableCommands = boolOption true;
  };

  myconfig.ifEnabled.commands.onWindowManager = lib.mkIf cfg.enableCommands [
    "swww-daemon"
  ];

  home.ifEnabled.home.packages = [pkgs.swww];
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions