mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-24 09:50:58 +01:00
chromium: fix null package
This commit is contained in:
parent
af7c726e8b
commit
7b34e428f3
1 changed files with 11 additions and 4 deletions
|
|
@ -40,7 +40,7 @@ let
|
|||
|
||||
finalPackage = mkOption {
|
||||
inherit visible;
|
||||
type = types.package;
|
||||
type = types.nullOr types.package;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
Resulting customized ${name} package
|
||||
|
|
@ -220,15 +220,22 @@ let
|
|||
};
|
||||
|
||||
in
|
||||
|
||||
lib.mkIf cfg.enable {
|
||||
programs.${browser}.finalPackage = lib.mkIf (cfg.package != null) (
|
||||
assertions = [
|
||||
{
|
||||
assertion = !(cfg.package == null && cfg.commandLineArgs != [ ]);
|
||||
message = "Cannot set `commandLineArgs` when `package` is null for ${browser}.";
|
||||
}
|
||||
];
|
||||
|
||||
programs.${browser}.finalPackage =
|
||||
if cfg.commandLineArgs != [ ] then
|
||||
cfg.package.override {
|
||||
commandLineArgs = lib.concatStringsSep " " cfg.commandLineArgs;
|
||||
}
|
||||
else
|
||||
cfg.package
|
||||
);
|
||||
cfg.package;
|
||||
|
||||
home.packages = lib.mkIf (cfg.finalPackage != null) [
|
||||
cfg.finalPackage
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue