about summary refs log tree commit diff stats
path: root/home-manager/firefox
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager/firefox')
-rw-r--r--home-manager/firefox/default.nix232
1 files changed, 116 insertions, 116 deletions
diff --git a/home-manager/firefox/default.nix b/home-manager/firefox/default.nix
index 5e9b9632..af627a21 100644
--- a/home-manager/firefox/default.nix
+++ b/home-manager/firefox/default.nix
@@ -4,12 +4,14 @@
   pkgs,
   lib,
   stdenv,
+  strip_js_comments,
+  user_js,
   ...
 }: let
   user_js_override = "./settings/override.js";
-  user_js = lib.runCommand "user.js" {} ''
+  user_js = pkgs.runCommand "user.js" {} ''
     mkdir $out;
-    ${config.inputs.strip_js_comments}/bin ${config.inputs.user_js} > $out/user.js;
+    ${strip_js_comments}/bin "${user_js}/user.js" > $out/user.js;
     cat ${user_js_override} >> $out/user.js;
     sed 's/user_pref(\(.*\)",\(.*\));/\1" = \2;/' $out/user.js > $out/user.nix;
   '';
@@ -96,125 +98,123 @@
       #"security.webauth.webauthn_enable_softtoken" = true;
       #"security.webauth.webauthn_enable_usbtoken" = true;
     }
-    builtins.readFile
-    "${user_js}/user.nix";
+    (builtins.readFile
+      "${user_js}/user.nix");
 in {
-  home-manager.users.${config.soisha.user.username} = {
-    packages = [
-      pkgs.firefox-wayland
-    ];
-    sessionVariables = {
-      # improve touch input & make scrolling smother
-      MOZ_USE_XINPUT2 = "1";
-      # improve wayland support
-      MOZ_ENABLE_WAYLAND = 1;
-      XDG_CURRENT_DESKTOP = "river";
-    };
-    xdg.mimeApps = {
-      enable = true;
-      defaultApplications = {
-        "text/html" = ["firefox.desktop"];
-        "x-scheme-handler/http" = ["firefox.desktop"];
-        "x-scheme-handler/https" = ["firefox.desktop"];
-        "x-scheme-handler/about" = ["firefox.desktop"];
-        "x-scheme-handler/unknown" = ["firefox.desktop"];
-      };
+  home.packages = [
+    pkgs.firefox-wayland
+  ];
+  sessionVariables = {
+    # improve touch input & make scrolling smother
+    MOZ_USE_XINPUT2 = "1";
+    # improve wayland support
+    MOZ_ENABLE_WAYLAND = 1;
+    XDG_CURRENT_DESKTOP = "river";
+  };
+  xdg.mimeApps = {
+    enable = true;
+    defaultApplications = {
+      "text/html" = ["firefox.desktop"];
+      "x-scheme-handler/http" = ["firefox.desktop"];
+      "x-scheme-handler/https" = ["firefox.desktop"];
+      "x-scheme-handler/about" = ["firefox.desktop"];
+      "x-scheme-handler/unknown" = ["firefox.desktop"];
     };
-    programs.firefox = {
-      enable = true;
-      package = pkgs.firefox;
-      extensions = builtins.map buildFirefoxXpiAddon (lib.attrValues (lib.importJSON ./extensions.json));
-      profile."default" = {
-        isDefault = true;
-        id = 0;
-        name = "default";
-
-        userChrome = builtins.readFile "./chrome/userChrome.css";
-
-        search = {
-          default = "Brave Search";
-          force = true;
-
-          engines = {
-            "Brave Search" = {
-              urls = [{template = "https://search.brave.com/search?q={searchTerms}";}];
-              iconUpdateURL = "https://cdn.search.brave.com/serp/v1/static/brand/8eabe183f0d1f2cb3e2916b7b20c310efd196d740c8cecd341732fcd396fb665-apple-touch-icon.png";
-              updateInterval = 24 * 60 * 60 * 1000; # every day
-              definedAliases = ["@bs"];
-            };
-
-            "Nix Packages" = {
-              urls = [
-                {
-                  template = "https://search.nixos.org/packages";
-                  params = [
-                    {
-                      name = "type";
-                      value = "packages";
-                    }
-                    {
-                      name = "query";
-                      value = "{searchTerms}";
-                    }
-                  ];
-                }
-              ];
-
-              icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
-              definedAliases = ["@np"];
-            };
-
-            "NixOS Wiki" = {
-              urls = [{template = "https://nixos.wiki/index.php?search={searchTerms}";}];
-              iconUpdateURL = "https://nixos.wiki/favicon.png";
-              updateInterval = 24 * 60 * 60 * 1000; # every day
-              definedAliases = ["@nw"];
-            };
-            "Bing".metaData.hidden = true;
-            "Google".metaData.hidden = true;
-            "Amazon.de".metaData.hidden = true;
+  };
+  programs.firefox = {
+    enable = true;
+    package = pkgs.firefox;
+    extensions = builtins.map buildFirefoxXpiAddon (lib.attrValues (lib.importJSON ./extensions.json));
+    profile."default" = {
+      isDefault = true;
+      id = 0;
+      name = "default";
+
+      userChrome = builtins.readFile "./chrome/userChrome.css";
+
+      search = {
+        default = "Brave Search";
+        force = true;
+
+        engines = {
+          "Brave Search" = {
+            urls = [{template = "https://search.brave.com/search?q={searchTerms}";}];
+            iconUpdateURL = "https://cdn.search.brave.com/serp/v1/static/brand/8eabe183f0d1f2cb3e2916b7b20c310efd196d740c8cecd341732fcd396fb665-apple-touch-icon.png";
+            updateInterval = 24 * 60 * 60 * 1000; # every day
+            definedAliases = ["@bs"];
           };
-        };
 
-        bookmarks = [
-          {
-            name = "Rust::std";
-            # TODO
-            url = "file:///home/dt/.local/share/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html/std/all.html";
-          }
-
-          {
-            name = "Feed - Piped";
-            url = "https://piped.kavin.rocks/feed";
-          }
-
-          {
-            name = "DeepL Translate";
-            url = "https://www.deepl.com/translator#en/de/test";
-          }
-
-          {
-            name = "Google Scholar";
-            url = "https://scholar.google.com/";
-          }
-
-          {
-            name = "ArchWiki";
-            url = "https://wiki.archlinux.org/";
-          }
-
-          {
-            name = "Arch Package ";
-            url = "https://archlinux.org/packages/";
-          }
-
-          {
-            name = "layout.css.devPixelsPerPx";
-            url = "about:config";
-          }
-        ];
-        inherit settings;
+          "Nix Packages" = {
+            urls = [
+              {
+                template = "https://search.nixos.org/packages";
+                params = [
+                  {
+                    name = "type";
+                    value = "packages";
+                  }
+                  {
+                    name = "query";
+                    value = "{searchTerms}";
+                  }
+                ];
+              }
+            ];
+
+            icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
+            definedAliases = ["@np"];
+          };
+
+          "NixOS Wiki" = {
+            urls = [{template = "https://nixos.wiki/index.php?search={searchTerms}";}];
+            iconUpdateURL = "https://nixos.wiki/favicon.png";
+            updateInterval = 24 * 60 * 60 * 1000; # every day
+            definedAliases = ["@nw"];
+          };
+          "Bing".metaData.hidden = true;
+          "Google".metaData.hidden = true;
+          "Amazon.de".metaData.hidden = true;
+        };
       };
+
+      bookmarks = [
+        {
+          name = "Rust::std";
+          # TODO
+          url = "file:///home/dt/.local/share/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html/std/all.html";
+        }
+
+        {
+          name = "Feed - Piped";
+          url = "https://piped.kavin.rocks/feed";
+        }
+
+        {
+          name = "DeepL Translate";
+          url = "https://www.deepl.com/translator#en/de/test";
+        }
+
+        {
+          name = "Google Scholar";
+          url = "https://scholar.google.com/";
+        }
+
+        {
+          name = "ArchWiki";
+          url = "https://wiki.archlinux.org/";
+        }
+
+        {
+          name = "Arch Package ";
+          url = "https://archlinux.org/packages/";
+        }
+
+        {
+          name = "layout.css.devPixelsPerPx";
+          url = "about:config";
+        }
+      ];
+      inherit settings;
     };
   };
 }