treewide: implement auto importing for modules
Reduce maintenance burden and increase efficiency by automatically importing modules following a specific convention. Co-authored-by: awwpotato <awwpotato@voidq.com> Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
fefeb0e928
commit
4fca600cb1
461 changed files with 72 additions and 474 deletions
37
modules/programs/comodoro/default.nix
Normal file
37
modules/programs/comodoro/default.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.comodoro;
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.hm.maintainers; [ soywod ];
|
||||
|
||||
options.programs.comodoro = {
|
||||
enable = lib.mkEnableOption "Comodoro, a CLI to manage your time";
|
||||
|
||||
package = lib.mkPackageOption pkgs "comodoro" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = lib.types.submodule { freeformType = tomlFormat.type; };
|
||||
default = { };
|
||||
description = ''
|
||||
Comodoro configuration.
|
||||
See <https://pimalaya.org/comodoro/cli/configuration/> for supported values.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
xdg.configFile."comodoro/config.toml".source =
|
||||
tomlFormat.generate "comodoro-config.toml" cfg.settings;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue