irongit
hygoland/scripts/Polkit-NixOS.sh
21 lines879 BBourne Again Shell (bash)
1#!/bin/bash
2# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
3# For NixOS starting of polkit-gnome. Dec 2023, the settings stated in NixOS wiki does not work so have to manual start it
4
5# Find all polkit-gnome executables in the Nix store
6polkit_gnome_paths=$(find /nix/store -name 'polkit-gnome-authentication-agent-1' -type f 2>/dev/null)
7
8for polkit_gnome_path in $polkit_gnome_paths; do
9 # Extract the directory containing the executable
10 polkit_gnome_dir=$(dirname "$polkit_gnome_path")
11
12 # Check if the executable is valid and exists
13 if [ -x "$polkit_gnome_dir/polkit-gnome-authentication-agent-1" ]; then
14 # Start the Polkit-GNOME Authentication Agent
15 "$polkit_gnome_dir/polkit-gnome-authentication-agent-1" &
16 exit 0
17 fi
18done
19
20# If no valid executable is found, report an error
21echo "No valid Polkit-GNOME Authentication Agent executable found."