about summary refs log tree commit diff
path: root/pkgs/by-name/sy
diff options
context:
space:
mode:
authorOlli Helenius <liff@iki.fi>2023-10-05 17:47:28 +0300
committerOlli Helenius <liff@iki.fi>2024-01-27 11:55:02 +0200
commit28f40adf8c7b2802ac8a2331203f9130a8be9a0a (patch)
treeceb66ea6b88f7a389ad3d933650c818816d780f2 /pkgs/by-name/sy
parent0e5b36a10ce9dbe6843301ceb5896543af4ecb33 (diff)
systemd-lock-handler: init at 2.4.2
Diffstat (limited to 'pkgs/by-name/sy')
-rw-r--r--pkgs/by-name/sy/systemd-lock-handler/package.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/by-name/sy/systemd-lock-handler/package.nix b/pkgs/by-name/sy/systemd-lock-handler/package.nix
new file mode 100644
index 0000000000000..b46b9f1206dbb
--- /dev/null
+++ b/pkgs/by-name/sy/systemd-lock-handler/package.nix
@@ -0,0 +1,47 @@
+{ lib
+, fetchFromSourcehut
+, buildGoModule
+, nix-update-script
+}:
+
+buildGoModule rec {
+  pname = "systemd-lock-handler";
+  version = "2.4.2";
+
+  src = fetchFromSourcehut {
+    owner = "~whynothugo";
+    repo = "systemd-lock-handler";
+    rev = "v${version}";
+    hash = "sha256-sTVAabwWtyvHuDp/+8FKNbfej1x/egoa9z1jLIMJuBg=";
+  };
+
+  vendorHash = "sha256-dWzojV3tDA5lLdpAQNC9NaADGyvV7dNOS3x8mfgNNtA=";
+
+  passthru.updateScript = nix-update-script { };
+
+  # The Makefile expects to find the binary in the source root. Make
+  # the one built by `buildGoModule` available so that `make install`
+  # doesn’t try to build it again.
+  postBuild = ''
+    cp -a $GOPATH/bin/* .
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    substituteInPlace systemd-lock-handler.service \
+      --replace /usr/lib/ $out/lib/
+
+    make install DESTDIR= PREFIX=$out
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://git.sr.ht/~whynothugo/systemd-lock-handler";
+    description = "Translates systemd-system lock/sleep signals into systemd-user target activations";
+    license = licenses.isc;
+    maintainers = with maintainers; [ liff ];
+    platforms = platforms.linux;
+  };
+}