swhkd: update package

This commit is contained in:
EdenQwQ 2025-03-08 13:11:01 +08:00
parent 0af4114413
commit f7bc7da5fb
3 changed files with 10 additions and 31 deletions

View file

@ -5,10 +5,8 @@ let
lib lib
rustPlatform rustPlatform
fetchFromGitHub fetchFromGitHub
makeWrapper
pkg-config pkg-config
systemd udev
libgcc
; ;
}; };
in in

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<action id="com.github.swhkd.pkexec">
<message>Authentication is required to run Simple Wayland Hotkey Daemon</message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/swhkd</annotate>
</action>
</policyconfig>

View file

@ -2,10 +2,8 @@
lib, lib,
rustPlatform, rustPlatform,
fetchFromGitHub, fetchFromGitHub,
makeWrapper,
pkg-config, pkg-config,
systemd, udev,
libgcc,
}: }:
rustPlatform.buildRustPackage { rustPlatform.buildRustPackage {
pname = "swhkd"; pname = "swhkd";
@ -22,24 +20,20 @@ rustPlatform.buildRustPackage {
cargoHash = "sha256-LBbmFyddyw7vV5voctXq3L4U3Ddbh428j5XbI+td/dg="; cargoHash = "sha256-LBbmFyddyw7vV5voctXq3L4U3Ddbh428j5XbI+td/dg=";
nativeBuildInputs = [ nativeBuildInputs = [
makeWrapper
pkg-config pkg-config
]; ];
postInstall = '' buildInputs = [
cp ${./com.github.swhkd.pkexec.policy} ./com.github.swhkd.pkexec.policy udev
];
install -D -m0444 -t "$out/share/polkit-1/actions" ./com.github.swhkd.pkexec.policy postBuild = ''
$src/scripts/build-polkit-policy.sh --swhkd-path=$out/bin/swhkd
substituteInPlace "$out/share/polkit-1/actions/com.github.swhkd.pkexec.policy" \
--replace /usr/bin/swhkd \
"$out/bin/swhkd"
''; '';
buildInputs = [ postInstall = ''
systemd install -D -m0444 ./com.github.swhkd.pkexec.policy -t $out/share/polkit-1/actions
libgcc '';
];
meta = with lib; { meta = with lib; {
description = "A drop-in replacement for sxhkd that works with wayland"; description = "A drop-in replacement for sxhkd that works with wayland";