1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

zed-editor: allow for nullable package (#7220)

(cherry picked from commit 1d595a5b64)
This commit is contained in:
isabel 2025-06-06 21:51:16 +01:00 committed by Austin Horstman
parent 6f656618eb
commit 3b955f5f0a

View file

@ -31,7 +31,7 @@ in
programs.zed-editor = {
enable = lib.mkEnableOption "Zed, the high performance, multiplayer code editor from the creators of Atom and Tree-sitter";
package = lib.mkPackageOption pkgs "zed-editor" { };
package = lib.mkPackageOption pkgs "zed-editor" { nullable = true; };
extraPackages = mkOption {
type = with types; listOf package;
@ -128,7 +128,7 @@ in
};
config = mkIf cfg.enable {
home.packages =
home.packages = mkIf (cfg.package != null) (
if cfg.extraPackages != [ ] then
[
(pkgs.symlinkJoin {
@ -143,7 +143,8 @@ in
})
]
else
[ cfg.package ];
[ cfg.package ]
);
home.file = mkIf (cfg.installRemoteServer && (cfg.package ? remote_server)) (
let
@ -184,5 +185,12 @@ in
}
) cfg.themes
);
assertions = [
{
assertion = cfg.extraPackages != [ ] -> cfg.package != null;
message = "{option}programs.zed-editor.extraPackages requires non null {option}programs.zed-editor.package";
}
];
};
}