1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-06 16:57:03 +00:00

chromium: add nativeMessagingHosts option (#6019)

This commit is contained in:
Heitor Augusto 2025-02-22 04:10:22 -03:00 committed by GitHub
parent 2b382e499a
commit f4a07823a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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 {