1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-15 17:50:53 +00:00

chromium: add nativeMessagingHosts option

This commit is contained in:
Heitor Augusto 2024-10-29 18:35:32 -03:00
parent e83414058e
commit 10b0e3108b
No known key found for this signature in database

View file

@ -137,6 +137,18 @@ let
List of ${name} dictionaries to install. List of ${name} dictionaries to install.
''; '';
}; };
nativeMessagingHosts = mkOption {
type = types.listOf types.package;
default = [ ];
example = literalExpression ''
[
pkgs.kdePackages.plasma-browser-integration
]
'';
description = ''
List of ${name} native messaging hosts to install.
'';
};
}; };
browserConfig = cfg: browserConfig = cfg:
@ -178,6 +190,11 @@ let
value.source = pkg; value.source = pkg;
}; };
nativeMessagingHostsJoined = pkgs.symlinkJoin {
name = "${drvName}-native-messaging-hosts";
paths = cfg.nativeMessagingHosts;
};
package = if cfg.commandLineArgs != [ ] then package = if cfg.commandLineArgs != [ ] then
cfg.package.override { cfg.package.override {
commandLineArgs = concatStringsSep " " cfg.commandLineArgs; commandLineArgs = concatStringsSep " " cfg.commandLineArgs;
@ -189,7 +206,13 @@ let
home.packages = [ package ]; home.packages = [ package ];
home.file = optionalAttrs (!isProprietaryChrome) (listToAttrs home.file = optionalAttrs (!isProprietaryChrome) (listToAttrs
((map extensionJson cfg.extensions) ((map extensionJson cfg.extensions)
++ (map dictionary cfg.dictionaries))); ++ (map dictionary cfg.dictionaries)) // {
"${configDir}/NativeMessagingHosts" = {
source =
"${nativeMessagingHostsJoined}/etc/chromium/native-messaging-hosts";
recursive = true;
};
});
}; };
in { in {