Skip to content

Commit

Permalink
chromium: add nativeMessagingHosts option (#6019)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeitorAugustoLN authored Feb 22, 2025
1 parent 2b382e4 commit f4a0782
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion modules/programs/chromium.nix
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ let
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:
Expand Down Expand Up @@ -178,6 +190,11 @@ let
value.source = pkg;
};

nativeMessagingHostsJoined = pkgs.symlinkJoin {
name = "${drvName}-native-messaging-hosts";
paths = cfg.nativeMessagingHosts;
};

package = if cfg.commandLineArgs != [ ] then
cfg.package.override {
commandLineArgs = concatStringsSep " " cfg.commandLineArgs;
Expand All @@ -189,7 +206,13 @@ let
home.packages = [ package ];
home.file = optionalAttrs (!isProprietaryChrome) (listToAttrs
((map extensionJson cfg.extensions)
++ (map dictionary cfg.dictionaries)));
++ (map dictionary cfg.dictionaries)) // {
"${configDir}/NativeMessagingHosts" = {
source =
"${nativeMessagingHostsJoined}/etc/chromium/native-messaging-hosts";
recursive = true;
};
});
};

in {
Expand Down

0 comments on commit f4a0782

Please sign in to comment.