1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-19 14:53:00 +00:00
home-manager/modules/programs/comodoro.nix
Austin Horstman d2c014e1c7
treewide: null package support (#6582)
Can generate the config without installing application through home-manager. Helpful when a package is broken (or not provided) on a specific platform through nixpkgs and needs to be installed through other means but you still can benefit from the declarative configuration.
2025-03-07 18:17:52 -06:00

31 lines
854 B
Nix

{ 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;
};
}