zaphyra's git: nixfiles

zaphyra's nixfiles

commit 602dea942e208de5ef6230bc6dce3385b879d9a9
parent 22be4fa39b6455ab0f6c3cd06b6a7bc7f27f4cf0
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Wed, 6 Aug 2025 21:55:35 +0200

config/home-manager/zaphyra/programs: add `sherlock`
13 files changed, 98 insertions(+), 42 deletions(-)
diff --git a/config/home-manager/common/home.nix b/config/home-manager/common/home.nix
@@ -9,6 +9,7 @@
   imports = [
     inputs.niriFlake.homeModules.niri
     inputs.sopsNix.homeManagerModules.sops
+    inputs.sherlock.homeManagerModules.default
   ];
 
   home.stateVersion = lib.mkDefault "25.05";
diff --git a/config/home-manager/zaphyra/configure/niri.nix b/config/home-manager/zaphyra/configure/niri.nix
@@ -27,6 +27,7 @@ in
 
     programs.ghostty
     programs.fuzzel
+    programs.sherlock
     programs.overskride
   ];
 
diff --git a/config/home-manager/zaphyra/programs/fish.nix b/config/home-manager/zaphyra/programs/fish.nix
@@ -16,4 +16,6 @@
     generateCompletions = true;
   };
 
+  programs.sherlock.settings.ignore = "fish";
+
 }
diff --git a/config/home-manager/zaphyra/programs/gpg.nix b/config/home-manager/zaphyra/programs/gpg.nix
@@ -7,17 +7,6 @@
 
 {
 
-  xdg = {
-    desktopEntries = {
-      gscriptor = {
-        name = "gscriptor";
-        settings = {
-          NoDisplay = "true";
-        };
-      };
-    };
-  };
-
   home = {
     packages = [ pkgs.pcsctools ];
 

@@ -48,6 +37,8 @@
       signByDefault = true;
       key = "95F0FE7CD7E6A022";
     };
+
+    sherlock.settings.ignore = "Gscriptor";
   };
 
   services = {
diff --git a/config/home-manager/zaphyra/programs/helix.nix b/config/home-manager/zaphyra/programs/helix.nix
@@ -35,4 +35,6 @@
     ];
   };
 
+  programs.sherlock.settings.ignore = "Helix";
+
 }
diff --git a/config/home-manager/zaphyra/programs/htop.nix b/config/home-manager/zaphyra/programs/htop.nix
@@ -17,11 +17,6 @@
     };
   };
 
-  xdg = lib.mkIf pkgs.stdenv.isLinux {
-    desktopEntries.htop = {
-      name = "Htop";
-      settings.NoDisplay = "true";
-    };
-  };
+  programs.sherlock.settings.ignore = "Htop";
 
 }
diff --git a/config/home-manager/zaphyra/programs/libreoffice.nix b/config/home-manager/zaphyra/programs/libreoffice.nix
@@ -4,18 +4,6 @@
 
   home.packages = [ pkgs.libreoffice-fresh ];
 
-  xdg.desktopEntries = {
-    impress.name = "LibreOffice Impress";
-    impress.settings.NoDisplay = "true";
-
-    math.name = "LibreOffice Math";
-    math.settings.NoDisplay = "true";
-
-    base.name = "LibreOffice Base";
-    base.settings.NoDisplay = "true";
-
-    draw.name = "LibreOffice Draw";
-    draw.settings.NoDisplay = "true";
-  };
+  programs.sherlock.settings.ignore = "LibreOffice *";
 
 }
diff --git a/config/home-manager/zaphyra/programs/micro.nix b/config/home-manager/zaphyra/programs/micro.nix
@@ -28,11 +28,6 @@
     };
   };
 
-  xdg = lib.mkIf pkgs.stdenv.isLinux {
-    desktopEntries.micro = {
-      name = "micro";
-      settings.NoDisplay = "true";
-    };
-  };
+  programs.sherlock.settings.ignore = "Micro";
 
 }
diff --git a/config/home-manager/zaphyra/programs/mpv.nix b/config/home-manager/zaphyra/programs/mpv.nix
@@ -12,9 +12,4 @@
     mpv.scripts = [ pkgs.mpvScripts.mpris ];
   };
 
-  xdg.desktopEntries = {
-    umpv.name = "umpv Media Player";
-    umpv.settings.NoDisplay = "true";
-  };
-
 }
diff --git a/config/home-manager/zaphyra/programs/networkManagerDmenu.nix b/config/home-manager/zaphyra/programs/networkManagerDmenu.nix
@@ -38,4 +38,6 @@
     };
   };
 
+  programs.sherlock.settings.ignore = "NetworkManager Dmenu";
+
 }
diff --git a/config/home-manager/zaphyra/programs/sherlock.nix b/config/home-manager/zaphyra/programs/sherlock.nix
@@ -0,0 +1,81 @@
+{ config, pkgs, lib, ... }:
+
+{
+
+  home.persistence."/nix/persist/home/${config.home.username}".directories = [
+    "sherlock/.cache/sherlock"
+  ];
+
+  programs.niri.settings.binds = with config.lib.niri.actions; {
+    "Mod+Space".action = spawn (lib.getExe pkgs.sherlock-launcher);
+  };
+
+  programs.sherlock = {
+    enable = true;
+    settings = {
+      style = ''
+        window {
+          border-radius: 5px;
+          border: 2px solid rgba(255, 255, 255, 0.08);
+        }
+      '';
+      ignore = ''
+        btop++
+      '';
+      config = {
+        default_apps = {
+          terminal = "${config.home.sessionVariables.TERMINAL} -e";
+          browser = "${config.home.sessionVariables.BROWSER} %u";
+        };
+        caching.enable = true;
+      };
+      launchers = [
+        {
+          name = "Weather";
+          type = "weather";
+          args.location = "darmstadt";
+          args.update_interval = 30;
+          home = "OnlyHome";
+          priority = 1;
+          async = true;
+          shortcut = false;
+          spawn_focus = false;
+          actions = [{
+            name = "Show on wttr.in";
+            exec = "https://www.wttr.in/darmstadt";
+            icon = "emblem-symbolic-link";
+            method = "web_launcher";
+          }];
+        }
+        {
+          name = "App Launcher";
+          type = "app_launcher";
+          alias = "app";
+          priority = 3;
+          home = "OnlyHome";
+        }
+        {
+          name = "Emoji Picker";
+          type = "emoji_picker";
+          alias = "emoji";
+          priority = 4;
+          home = "OnlyHome";
+        }
+      ];
+    };
+  };
+
+  systemd.user.services.sherlock = {
+    Unit = {
+      Description = "sherlock daemon";
+      After = [ "graphical-session.target" ];
+    };
+    Service = {
+      ExecStart = "${lib.getExe pkgs.sherlock-launcher} --daemonize";
+      Restart = "on-failure";
+      RestartSec = 5;
+    };
+    Install.WantedBy = [ "graphical-session.target" ];
+  };
+
+}+
\ No newline at end of file
diff --git a/config/home-manager/zaphyra/programs/yazi.nix b/config/home-manager/zaphyra/programs/yazi.nix
@@ -32,4 +32,6 @@
     '';
   };
 
+  programs.sherlock.settings.ignore = "Yazi";
+
 }
diff --git a/config/home-manager/zaphyra/services/niri.nix b/config/home-manager/zaphyra/services/niri.nix
@@ -152,8 +152,8 @@
 
       binds = with config.lib.niri.actions; {
         "Mod+Shift+E".action = quit;
-        "Mod+Space".action = spawn (lib.getExe pkgs.fuzzel);
         "Mod+Return".action = spawn (lib.getExe pkgs.ghostty);
+        "Mod+Space".action = lib.mkDefault (spawn (lib.getExe pkgs.fuzzel));
 
         "Mod+L".action = spawn (lib.getExe' pkgs.systemd "loginctl") "lock-session";
         "Mod+Z".action = power-off-monitors;