about summary refs log tree commit diff
path: root/nixos/modules/programs
diff options
context:
space:
mode:
authorYuri Nesterov <yuriy.nesterov@unikie.com>2024-03-04 14:39:04 +0200
committerYuri Nesterov <yuriy.nesterov@unikie.com>2024-03-06 21:32:18 +0200
commit960f93fd4fdb7f2f2140f40edd7dd4a42da65713 (patch)
treeed249ad1be3bb02399107e61c1978167f2aa6ef5 /nixos/modules/programs
parent2f7fc27d4618c84cc45f706606eedfbf28d7218b (diff)
downloadnixlib-960f93fd4fdb7f2f2140f40edd7dd4a42da65713.tar
nixlib-960f93fd4fdb7f2f2140f40edd7dd4a42da65713.tar.gz
nixlib-960f93fd4fdb7f2f2140f40edd7dd4a42da65713.tar.bz2
nixlib-960f93fd4fdb7f2f2140f40edd7dd4a42da65713.tar.lz
nixlib-960f93fd4fdb7f2f2140f40edd7dd4a42da65713.tar.xz
nixlib-960f93fd4fdb7f2f2140f40edd7dd4a42da65713.tar.zst
nixlib-960f93fd4fdb7f2f2140f40edd7dd4a42da65713.zip
nixos/chromium: add the ability to set initial preferences
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r--nixos/modules/programs/chromium.nix19
1 files changed, 19 insertions, 0 deletions
diff --git a/nixos/modules/programs/chromium.nix b/nixos/modules/programs/chromium.nix
index 45a9e9e2a689..5e8983730048 100644
--- a/nixos/modules/programs/chromium.nix
+++ b/nixos/modules/programs/chromium.nix
@@ -98,6 +98,24 @@ in
           }
         '';
       };
+
+      initialPrefs = mkOption {
+        type = types.attrs;
+        description = lib.mdDoc ''
+          Initial preferences are used to configure the browser for the first run.
+          Unlike {option}`programs.chromium.extraOpts`, initialPrefs can be changed by users in the browser settings.
+          More information can be found in the Chromium documentation:
+          <https://www.chromium.org/administrators/configuring-other-preferences/>
+        '';
+        default = {};
+        example = literalExpression ''
+          {
+            "first_run_tabs" = [
+              "https://nixos.org/"
+            ];
+          }
+        '';
+      };
     };
   };
 
@@ -110,6 +128,7 @@ in
         { 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/extra.json" = lib.mkIf (cfg.extraOpts != {}) { text = builtins.toJSON cfg.extraOpts; };
+      "chromium/initial_preferences" = lib.mkIf (cfg.initialPrefs != {}) { text = builtins.toJSON cfg.initialPrefs; };
       # 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"; };