From 679224d7c76a17da4ac5e5d6170f8e3023217fea Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 21 Jun 2024 13:44:31 +0300 Subject: [PATCH] gnomeExtensions.systemd-manager: nixfmt & add doronbehar as maintainer --- .../extensions/systemd-manager/default.nix | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/pkgs/desktops/gnome/extensions/systemd-manager/default.nix b/pkgs/desktops/gnome/extensions/systemd-manager/default.nix index 6ccfae4c9c3e..0b8e52af802b 100644 --- a/pkgs/desktops/gnome/extensions/systemd-manager/default.nix +++ b/pkgs/desktops/gnome/extensions/systemd-manager/default.nix @@ -10,7 +10,11 @@ systemd ? config.systemd.package, }: -assert lib.elem allowPolkitPolicy [ "none" "pkexec" "systemctl" ]; +assert lib.elem allowPolkitPolicy [ + "none" + "pkexec" + "systemctl" +]; stdenvNoCC.mkDerivation rec { pname = "gnome-shell-extension-systemd-manager"; @@ -27,22 +31,25 @@ stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ glib ]; - postInstall = '' - rm systemd-manager@hardpixel.eu/schemas/gschemas.compiled - glib-compile-schemas systemd-manager@hardpixel.eu/schemas + postInstall = + '' + rm systemd-manager@hardpixel.eu/schemas/gschemas.compiled + glib-compile-schemas systemd-manager@hardpixel.eu/schemas - mkdir -p $out/share/gnome-shell/extensions - mv systemd-manager@hardpixel.eu $out/share/gnome-shell/extensions - '' + lib.optionalString (allowPolkitPolicy == "pkexec") '' - local bn=org.freedesktop.policykit.pkexec.systemctl.policy - mkdir -p $out/share/polkit-1/actions - substitute systemd-policies/$bn $out/share/polkit-1/actions/$bn \ - --replace-fail /usr/bin/systemctl ${lib.getBin systemd}/bin/systemctl - '' + lib.optionalString (allowPolkitPolicy == "systemctl") '' - install -Dm0644 \ - systemd-policies/10-service_status.rules \ - $out/share/polkit-1/rules.d/10-gnome-extension-systemd-manager.rules - ''; + mkdir -p $out/share/gnome-shell/extensions + mv systemd-manager@hardpixel.eu $out/share/gnome-shell/extensions + '' + + lib.optionalString (allowPolkitPolicy == "pkexec") '' + local bn=org.freedesktop.policykit.pkexec.systemctl.policy + mkdir -p $out/share/polkit-1/actions + substitute systemd-policies/$bn $out/share/polkit-1/actions/$bn \ + --replace-fail /usr/bin/systemctl ${lib.getBin systemd}/bin/systemctl + '' + + lib.optionalString (allowPolkitPolicy == "systemctl") '' + install -Dm0644 \ + systemd-policies/10-service_status.rules \ + $out/share/polkit-1/rules.d/10-gnome-extension-systemd-manager.rules + ''; passthru = { extensionUuid = "systemd-manager@hardpixel.eu"; @@ -53,6 +60,9 @@ stdenvNoCC.mkDerivation rec { description = "GNOME Shell extension to manage systemd services"; homepage = "https://github.com/hardpixel/systemd-manager"; license = licenses.gpl3Only; - maintainers = with maintainers; [ linsui ]; + maintainers = with maintainers; [ + linsui + doronbehar + ]; }; }