From 3925c1090eb33f6228c58e51ee705d6def7fb463 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Thu, 6 Jun 2024 02:08:35 +0100 Subject: [PATCH] pkgs: Add window2layer and swaylock-plugin --- pkgs/default.nix | 2 ++ pkgs/swaylock-plugin.nix | 41 ++++++++++++++++++++++++++++++++++++++++ pkgs/windowtolayer.nix | 18 ++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 pkgs/swaylock-plugin.nix create mode 100644 pkgs/windowtolayer.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 73e310c..851e35e 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -10,4 +10,6 @@ in modrinth-app = callPackage ./modrinth-app { }; glfw-minecraft = callPackage ./glfw-minecraft { }; chocolate-doom2xx = callPackage ./chocolate-doom2xx.nix { }; + windowtolayer = callPackage ./windowtolayer.nix { }; + swaylock-plugin = callPackage ./swaylock-plugin.nix { }; } diff --git a/pkgs/swaylock-plugin.nix b/pkgs/swaylock-plugin.nix new file mode 100644 index 0000000..a7d2db3 --- /dev/null +++ b/pkgs/swaylock-plugin.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchFromGitHub, fetchpatch +, meson, ninja, pkg-config, scdoc, wayland-scanner +, wayland, wayland-protocols, libxkbcommon, cairo, gdk-pixbuf, pam +}: + +stdenv.mkDerivation rec { + pname = "swaylock-plugin"; + version = "1dd15b6"; + + src = fetchFromGitHub { + owner = "mstoeckl"; + repo = pname; + rev = "1dd15b6ecbe91be7a3dc4a0fa9514fb166fb2e07"; + hash = "sha256-xWyDDT8sXAL58HtA9ifzCenKMmOZquzXZaz3ttGGJuY="; + }; + + strictDeps = true; + depsBuildBuild = [ pkg-config ]; + nativeBuildInputs = [ meson ninja pkg-config scdoc wayland-scanner ]; + buildInputs = [ wayland wayland-protocols libxkbcommon cairo gdk-pixbuf pam ]; + + mesonFlags = [ + "-Dpam=enabled" "-Dgdk-pixbuf=enabled" "-Dman-pages=enabled" + ]; + env.NIX_CFLAGS_COMPILE = "-Wno-maybe-uninitialized"; + + meta = with lib; { + description = "Screen locker for Wayland -- fork with background plugin support"; + longDescription = '' + Fork of swaylock, a screen locking utility for Wayland compositors. + With swaylock-plugin, you can for your lockscreen background display + the animated output from any wallpaper program that implements the + wlr-layer-shell-unstable-v1 protocol. + ''; + inherit (src.meta) homepage; + mainProgram = "swaylock"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ devplayer0 ]; + }; +} diff --git a/pkgs/windowtolayer.nix b/pkgs/windowtolayer.nix new file mode 100644 index 0000000..f90ea3d --- /dev/null +++ b/pkgs/windowtolayer.nix @@ -0,0 +1,18 @@ +{ lib +, fetchFromGitLab +, rustPlatform +}: +rustPlatform.buildRustPackage rec { + pname = "windowtolayer"; + version = "a5b89c3c"; + + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "mstoeckl"; + repo = pname; + rev = "a5b89c3c047297fd574932860a6c89e9ea02ba5d"; + hash = "sha256-rssL2XkbTqUvJqfUFhzULeE4/VBzjeBC5iZWSJ8MJ+M="; + }; + + cargoHash = "sha256-XHmLsx9qdjlBz4xJFFiO24bR9CMw1o5368K+YMpMIBA="; +}