From 40386f1a37acc215f358334b199254f7121b089c Mon Sep 17 00:00:00 2001 From: Picnoir Date: Wed, 30 Oct 2024 10:26:17 +0100 Subject: [PATCH] swaylock-plugin: init at unstable-2025-01-28 This project is based on swaylock. Its release cycle is mirroring the swaylock one. I decided to initially target the current master instead of the 1.8 tag (mirroring the swaylock 1.8 one) because the author pushed quite some important fixes since the 1.8 tag: ac02c52 * main origin/main Check if keymap is NULL before dereferencing 7df380e * Implement the wl_data_device_manager interface cda81da * Document that grace period is off by default fdade0d * Set _POSIX_C_SOURCE for seat.c 97bb7b2 * Add missing include and use a standard clock 969b502 * Add grace period feature c112872 * Fix potential NULL deference after getpwuid bfed22d * Fix leak of dmabuf plane file descriptors 13f641d * Implement zwp_linux_buffer_params_v1.create 3a9e5f6 * Allow role-less commits 2406d92 * Fix dmabuf-feedback event order 45326ee * Add missing implementation for zwlr_layer_shell_v1.destroy e792b19 * Exit when password handling subprocess crashes 541f9f1 * Fix completion install paths 337a6a3 * Fix uninitialized variable warning e1ae7cd * picnoir/main Stop processing auth requests after success 7be1a21 * Improve frame callback and commit handling 58103bd * Fix a divide by zero crash 9b18ea3 * Fix a crash on client timeout 5669df9 * Silence an unnecessary warning 04dbb56 * Require that surface size matches acknowledged configure 3a6ea3b * Implement viewporter and fractional scale 0fb1438 * Update to version 5 of zwlr_layer_shell_v1 c4802c2 * Fix crash when client exits without making a registry 5b0293e * Make removing timers safer for event loop --- pkgs/by-name/sw/swaylock-plugin/package.nix | 88 +++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 pkgs/by-name/sw/swaylock-plugin/package.nix diff --git a/pkgs/by-name/sw/swaylock-plugin/package.nix b/pkgs/by-name/sw/swaylock-plugin/package.nix new file mode 100644 index 000000000000..4e4e7fa258e7 --- /dev/null +++ b/pkgs/by-name/sw/swaylock-plugin/package.nix @@ -0,0 +1,88 @@ +{ + cairo, + fetchFromGitHub, + gdk-pixbuf, + lib, + libxcrypt, + libxkbcommon, + makeWrapper, + meson, + ninja, + nix-update-script, + pam, + pkg-config, + scdoc, + stdenv, + swaybg, + systemd, + versionCheckHook, + wayland, + wayland-protocols, + wayland-scanner, +}: + +stdenv.mkDerivation { + pname = "swaylock-plugin"; + version = "unstable-2025-01-28"; + src = fetchFromGitHub { + owner = "mstoeckl"; + repo = "swaylock-plugin"; + rev = "ac02c528bce8f529f33c85065d77eac1aceccbe5"; + hash = "sha256-e4iQ7yCPkkJBpgD0aE94lsID8v3kXhr7YmAszfFi7zA="; + }; + + strictDeps = true; + depsBuildBuild = [ pkg-config ]; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + nativeBuildInputs = [ + makeWrapper + meson + ninja + pkg-config + scdoc + wayland-scanner + ]; + buildInputs = [ + cairo + libxcrypt + gdk-pixbuf + libxkbcommon + pam + systemd + wayland + wayland-protocols + ]; + + postInstall = '' + wrapProgram $out/bin/swaylock-plugin \ + --prefix PATH : "${lib.makeBinPath [ swaybg ]}" + ''; + + mesonFlags = [ + "-Dpam=enabled" + "-Dgdk-pixbuf=enabled" + "-Dman-pages=enabled" + ]; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { + description = "Screen locker for Wayland, forked from swaylock"; + longDescription = '' + swaylock-pulgins is a fork of swaylock, a screen locking utility for Wayland compositors. + On top of the usual swaylock features, it allow you to use a + subcommand to generate the lockscreen background. + + Important note: You need to set "security.pam.services.swaylock-plugin = {};" manually. + ''; + homepage = "https://github.com/mstoeckl/swaylock-plugin"; + mainProgram = "swaylock-plugin"; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ picnoir ]; + }; +}