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:
Austin Horstman
2025-03-07 18:17:52 -06:00
committed by GitHub
parent 6c2b79403e
commit d2c014e1c7
83 changed files with 269 additions and 222 deletions

View File

@@ -16,7 +16,7 @@ in {
options.programs.lazygit = {
enable = mkEnableOption "lazygit, a simple terminal UI for git commands";
package = mkPackageOption pkgs "lazygit" { };
package = mkPackageOption pkgs "lazygit" { nullable = true; };
settings = mkOption {
type = yamlFormat.type;
@@ -45,7 +45,7 @@ in {
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
home.file."Library/Application Support/lazygit/config.yml" =
mkIf (cfg.settings != { } && (isDarwin && !config.xdg.enable)) {