Tweak geoclue for via-nix

This commit is contained in:
clsty
2025-11-03 23:48:07 +08:00
parent bd14c73f9b
commit 47810c95da
2 changed files with 16 additions and 15 deletions
@@ -7,13 +7,16 @@ if pgrep -f 'geoclue-2.0/demos/agent' > /dev/null; then
fi
# List of known possible GeoClue agent paths
AGENT_PATHS="
/usr/libexec/geoclue-2.0/demos/agent
/usr/lib/geoclue-2.0/demos/agent
"
AGENT_PATHS=(
/usr/libexec/geoclue-2.0/demos/agent
/usr/lib/geoclue-2.0/demos/agent
"$HOME/.nix-profile/libexec/geoclue-2.0/demos/agent"
"$HOME/.nix-profile/lib/geoclue-2.0/demos/agent"
/run/current-system/sw/libexec/geoclue-2.0/demos/agent
)
# Find the first valid agent path
for path in $AGENT_PATHS; do
for path in "${AGENT_PATHS[@]}"; do
if [ -x "$path" ]; then
echo "Starting GeoClue agent from: $path"
"$path" & # starts in the background
+8 -10
View File
@@ -21,14 +21,6 @@
## Allow fontconfig to discover fonts in home.packages
fonts.fontconfig.enable = true;
# home.sessionVariables.NIXOS_OZONE_WL = "1";
wayland.windowManager.hyprland = {
## Make sure home-manager not generate ~/.config/hypr/hyprland.conf
systemd.enable = false; plugins = []; settings = {}; extraConfig = "";
enable = true;
## Use NixGL
package = config.lib.nixGL.wrap pkgs.hyprland;
};
home = {
packages = with pkgs; [
@@ -64,10 +56,16 @@
playerctl #playerctl
### illogical-impulse-backlight
# TODO: geoclue is used in https://github.com/end-4/dots-hyprland/blob/0551c010b586dbf5578c32de2735698cca0801a7/dots/.config/hypr/hyprland/scripts/start_geoclue_agent.sh with hardcoded absolute path to search the agent. Below will not work without futher tweaks in that start_geoclue_agent.sh
geoclue2 # geoclue
# TODO: geoclue agent is used in .config/hypr/hyprland/scripts/start_geoclue_agent.sh with hardcoded path under /usr/ .
# If installed by Nix, then the agent path will be ${cfg.package}/libexec/geoclue-2.0/demos/agent , where ${cfg.package} is defined by Nix, see https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/desktops/geoclue2.nix .
# it won't work without futher tweaks.
# geoclue2 # geoclue
(geoclue2.override { withDemoAgent = true; })
brightnessctl # brightnessctl
ddcutil # ddcutil
]
++ [
(config.lib.nixGL.wrap pkgs.hyprland)
];
}//home_attrs;
}