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
|
|
@ -23,9 +23,6 @@ let
|
|||
|
||||
formatPair = key: value:
|
||||
if isAttrs value then formatSet key value else formatLine key value;
|
||||
|
||||
homeConf = "${config.xdg.configHome}/task/home-manager-taskrc";
|
||||
userConf = "${config.xdg.configHome}/task/taskrc";
|
||||
in {
|
||||
options = {
|
||||
programs.taskwarrior = {
|
||||
|
|
@ -85,13 +82,18 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
package =
|
||||
mkPackageOption pkgs "taskwarrior" { example = "pkgs.taskwarrior3"; };
|
||||
package = mkPackageOption pkgs "taskwarrior" {
|
||||
nullable = true;
|
||||
example = "pkgs.taskwarrior3";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
config = let
|
||||
homeConf = "${config.xdg.configHome}/task/home-manager-taskrc";
|
||||
userConf = "${config.xdg.configHome}/task/taskrc";
|
||||
in mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.file."${homeConf}".text = ''
|
||||
data.location=${cfg.dataLocation}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue