mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-02 15:11:03 +01:00
chromium: add finalPackage option (#8155)
Adds a finalPackage option to chromium-based browsers. Allows users to use overriden package binary in their setups, without relying on PATH availability.
This commit is contained in:
parent
dfca39f8af
commit
33f63da61a
1 changed files with 20 additions and 9 deletions
|
|
@ -38,6 +38,15 @@ let
|
|||
description = "The ${name} package to use.";
|
||||
};
|
||||
|
||||
finalPackage = mkOption {
|
||||
inherit visible;
|
||||
type = types.package;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
Resulting customized ${name} package
|
||||
'';
|
||||
};
|
||||
|
||||
commandLineArgs = mkOption {
|
||||
inherit visible;
|
||||
type = types.listOf types.str;
|
||||
|
|
@ -212,15 +221,17 @@ let
|
|||
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [
|
||||
(
|
||||
programs.${browser}.finalPackage = lib.mkIf (cfg.package != null) (
|
||||
if cfg.commandLineArgs != [ ] then
|
||||
cfg.package.override {
|
||||
commandLineArgs = lib.concatStringsSep " " cfg.commandLineArgs;
|
||||
}
|
||||
else
|
||||
cfg.package
|
||||
)
|
||||
);
|
||||
|
||||
home.packages = lib.mkIf (cfg.finalPackage != null) [
|
||||
cfg.finalPackage
|
||||
];
|
||||
home.file = lib.optionalAttrs (!isProprietaryChrome) (
|
||||
lib.listToAttrs ((map extensionJson cfg.extensions) ++ (map dictionary cfg.dictionaries))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue