mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos/chromium: add enablePlasmaBrowserIntegration, plasmaBrowserIntegrationPackage options
This commit is contained in:
parent
a73a43d737
commit
d4df5391d0
1 changed files with 9 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -21,6 +21,10 @@ in
|
||||||
programs.chromium = {
|
programs.chromium = {
|
||||||
enable = mkEnableOption (lib.mdDoc "{command}`chromium` policies");
|
enable = mkEnableOption (lib.mdDoc "{command}`chromium` policies");
|
||||||
|
|
||||||
|
enablePlasmaBrowserIntegration = mkEnableOption (lib.mdDoc "Native Messaging Host for Plasma Browser Integration");
|
||||||
|
|
||||||
|
plasmaBrowserIntegrationPackage = mkPackageOption pkgs "plasma5Packages.plasma-browser-integration" { };
|
||||||
|
|
||||||
extensions = mkOption {
|
extensions = mkOption {
|
||||||
type = with types; nullOr (listOf str);
|
type = with types; nullOr (listOf str);
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
|
@ -102,9 +106,13 @@ in
|
||||||
config = {
|
config = {
|
||||||
environment.etc = lib.mkIf cfg.enable {
|
environment.etc = lib.mkIf cfg.enable {
|
||||||
# for chromium
|
# for chromium
|
||||||
|
"chromium/native-messaging-hosts/org.kde.plasma.browser_integration.json" = lib.mkIf cfg.enablePlasmaBrowserIntegration
|
||||||
|
{ source = "${cfg.plasmaBrowserIntegrationPackage}/etc/chromium/native-messaging-hosts/org.kde.plasma.browser_integration.json"; };
|
||||||
"chromium/policies/managed/default.json" = lib.mkIf (defaultProfile != {}) { text = builtins.toJSON defaultProfile; };
|
"chromium/policies/managed/default.json" = lib.mkIf (defaultProfile != {}) { text = builtins.toJSON defaultProfile; };
|
||||||
"chromium/policies/managed/extra.json" = lib.mkIf (cfg.extraOpts != {}) { text = builtins.toJSON cfg.extraOpts; };
|
"chromium/policies/managed/extra.json" = lib.mkIf (cfg.extraOpts != {}) { text = builtins.toJSON cfg.extraOpts; };
|
||||||
# for google-chrome https://www.chromium.org/administrators/linux-quick-start
|
# for google-chrome https://www.chromium.org/administrators/linux-quick-start
|
||||||
|
"opt/chrome/native-messaging-hosts/org.kde.plasma.browser_integration.json" = lib.mkIf cfg.enablePlasmaBrowserIntegration
|
||||||
|
{ source = "${cfg.plasmaBrowserIntegrationPackage}/etc/opt/chrome/native-messaging-hosts/org.kde.plasma.browser_integration.json"; };
|
||||||
"opt/chrome/policies/managed/default.json" = lib.mkIf (defaultProfile != {}) { text = builtins.toJSON defaultProfile; };
|
"opt/chrome/policies/managed/default.json" = lib.mkIf (defaultProfile != {}) { text = builtins.toJSON defaultProfile; };
|
||||||
"opt/chrome/policies/managed/extra.json" = lib.mkIf (cfg.extraOpts != {}) { text = builtins.toJSON cfg.extraOpts; };
|
"opt/chrome/policies/managed/extra.json" = lib.mkIf (cfg.extraOpts != {}) { text = builtins.toJSON cfg.extraOpts; };
|
||||||
# for brave
|
# for brave
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue