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.
This commit is contained in:
parent
6c2b79403e
commit
d2c014e1c7
83 changed files with 269 additions and 222 deletions
|
|
@ -10,7 +10,7 @@ in {
|
|||
options.programs.comodoro = {
|
||||
enable = lib.mkEnableOption "Comodoro, a CLI to manage your time";
|
||||
|
||||
package = lib.mkPackageOption pkgs "comodoro" { };
|
||||
package = lib.mkPackageOption pkgs "comodoro" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = lib.types.submodule { freeformType = tomlFormat.type; };
|
||||
|
|
@ -23,7 +23,7 @@ in {
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
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