Commit 4142b5d

HPCesia <me@hpcesia.com>
2026-10-22 08:06:04
floorp: use natsumi
1 parent f00e020
Changed files (1)
modules
desktop
app
browser
modules/desktop/app/browser/floorp/default.nix
@@ -13,14 +13,35 @@
     };
 
     hjem = {
-      host,
+      config,
       pkgs,
       ...
     }: let
-      fontsCfg = host.settings.desktop.aesthetic.fonts;
+      natsumiSrc = pkgs.fetchFromGitHub {
+        owner = "greeeen-dev";
+        repo = "natsumi-browser";
+        rev = "v6.12.4";
+        hash = "sha256-Ur0+WjTEEY9MpGNSfLD+QzT9rcAxhv0db+oQtyOABCM=";
+      };
+
+      mkChrome = {config ? "", ...}:
+        pkgs.runCommand "floorp-natsumi-chrome" {} ''
+          mkdir -p $out
+          cp -r ${natsumiSrc}/natsumi $out/natsumi
+          cp ${natsumiSrc}/userChrome.css ${natsumiSrc}/userContent.css $out/
+          echo ${lib.escapeShellArg config} > $out/natsumi-config.css
+        '';
+
+      profileDir = ".floorp/${config.programs.floorp.profiles.default.path}";
     in {
       imports = [./_hjem-module.nix];
 
+      files."${profileDir}/chrome" = {
+        clobber = true;
+        generator = mkChrome;
+        value = {};
+      };
+
       programs.floorp = {
         enable = true;
 
@@ -127,7 +148,7 @@
             "browser.toolbars.bookmarks.visibility" = "always";
             "sidebar.verticalTabs" = true;
             "sidebar.main.tools" = "syncedtabs";
-            "sidebar.visibility" = "expand-on-hover";
+            "sidebar.visibility" = "always-show";
             # Floorp's new tab page
             "floorp.newtab.configs" = {
               "backround"."type" = "none";
@@ -217,6 +238,24 @@
               "seen" = ["developer-button"];
               "dirtyAreaCache" = [];
             };
+            # == Natsumi ==
+            "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
+            "layout.css.backdrop-filter.enabled" = true;
+            "layout.css.backdrop-filter.force-enabled" = true;
+
+            "natsumi.browser.type" = "floorp";
+            "natsumi.updater.disabled" = true;
+            "natsumi.welcome.viewed" = true;
+            "natsumi.startup.sound" = false;
+            "natsumi.browser.ignore-security-notice" = true;
+            "natsumi.theme.floorp-hide-preferences-warnings" = true;
+
+            "natsumi.pdfjs.disabled" = false;
+
+            "natsumi.theme.compact-extensions" = true;
+            "natsumi.urlbar.always-expanded" = true;
+
+            "natsumi.tabs.use-custom-type" = false;
           };
         };
       };
@@ -225,30 +264,18 @@
 
   den.aspects.desktop.app.browser.floorp.themes = {
     catppuccin = {
-      hjem = {
-        pkgs,
-        lib,
-        ...
-      }: let
-        # From catppuccin/nix
-        # Use static version to avoid IFD
-        themes = lib.importJSON ./catppuccin-firefox-themes.json;
-      in {
-        programs.floorp = {
-          profiles.default = {
-            extensions = {
-              packages = with pkgs.nur.repos.rycee.firefox-addons; [
-                firefox-color
-              ];
-              settings."FirefoxColor@mozilla.com" = {
-                force = true;
-                settings = {
-                  firstRunDone = true;
-                  theme = themes.mocha.mauve;
-                };
-              };
-            };
-          };
+      hjem = {config, ...}: {
+        # files.".floorp/${config.programs.floorp.profiles.default.path}/natsumi-theme/master.json".source = ./catppuccin-natsumi.json;
+        files.".floorp/${config.programs.floorp.profiles.default.path}/chrome".value.config = ''
+          * {
+            --natsumi-accent-color: #cba6f7;
+            --natsumi-theme-layer-0-opacity: 0.85;
+            --natsumi-theme-layer-0-background: hsl(240deg, 21%, 15%);
+          }
+        '';
+
+        programs.floorp.profiles.default.settings = {
+          "natsumi.theme.type" = "custom";
         };
       };
     };