Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yunfachi opened this issue Sep 8, 2024 · 0 comments
Open

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

yunfachi opened this issue Sep 8, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@yunfachi
Copy link
Owner

yunfachi commented Sep 8, 2024

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];
})
@yunfachi yunfachi added the enhancement New feature or request label Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant