From 76bd26326b692c788d16cfab4e57676ac9bd5878 Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 22 Oct 2024 14:31:25 +0800 Subject: [PATCH 01/13] gtklock: move to pkgs/by-name --- .../gtklock/default.nix => by-name/gt/gtklock/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{tools/wayland/gtklock/default.nix => by-name/gt/gtklock/package.nix} (100%) diff --git a/pkgs/tools/wayland/gtklock/default.nix b/pkgs/by-name/gt/gtklock/package.nix similarity index 100% rename from pkgs/tools/wayland/gtklock/default.nix rename to pkgs/by-name/gt/gtklock/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4de9da69dcc9..64baeb662bef 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14388,8 +14388,6 @@ with pkgs; gpxsee = gpxsee-qt5; - gtklock = callPackage ../tools/wayland/gtklock { }; - gtklock-playerctl-module = callPackage ../tools/wayland/gtklock/playerctl-module.nix { }; gtklock-powerbar-module = callPackage ../tools/wayland/gtklock/powerbar-module.nix { }; From e220f5b28da0e8b5292fc7c3fbe0766ca08b4b76 Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 22 Oct 2024 14:31:43 +0800 Subject: [PATCH 02/13] gtklock: format with nixfmt-rfc-style --- pkgs/by-name/gt/gtklock/package.nix | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/gt/gtklock/package.nix b/pkgs/by-name/gt/gtklock/package.nix index 79e3870b81a4..0f60a056dbda 100644 --- a/pkgs/by-name/gt/gtklock/package.nix +++ b/pkgs/by-name/gt/gtklock/package.nix @@ -1,14 +1,15 @@ -{ lib -, stdenv -, fetchFromGitHub -, meson -, ninja -, scdoc -, pkg-config -, wrapGAppsHook3 -, gtk3 -, pam -, gtk-session-lock +{ + lib, + stdenv, + fetchFromGitHub, + meson, + ninja, + scdoc, + pkg-config, + wrapGAppsHook3, + gtk3, + pam, + gtk-session-lock, }: stdenv.mkDerivation rec { @@ -50,7 +51,10 @@ stdenv.mkDerivation rec { ''; # Following nixpkgs/pkgs/applications/window-managers/sway/lock.nix homepage = "https://github.com/jovanlanik/gtklock"; license = licenses.gpl3Only; - maintainers = with maintainers; [ dit7ya aleksana ]; + maintainers = with maintainers; [ + dit7ya + aleksana + ]; platforms = platforms.linux; mainProgram = "gtklock"; }; From 2421f1e6eef8c374f18872d1ce4d6f73fd24fc10 Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 22 Oct 2024 14:33:09 +0800 Subject: [PATCH 03/13] gtklock-playerctl-module: move to pkgs/by-name --- .../gt/gtklock-playerctl-module/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{tools/wayland/gtklock/playerctl-module.nix => by-name/gt/gtklock-playerctl-module/package.nix} (100%) diff --git a/pkgs/tools/wayland/gtklock/playerctl-module.nix b/pkgs/by-name/gt/gtklock-playerctl-module/package.nix similarity index 100% rename from pkgs/tools/wayland/gtklock/playerctl-module.nix rename to pkgs/by-name/gt/gtklock-playerctl-module/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 64baeb662bef..7216d05cba74 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14388,8 +14388,6 @@ with pkgs; gpxsee = gpxsee-qt5; - gtklock-playerctl-module = callPackage ../tools/wayland/gtklock/playerctl-module.nix { }; - gtklock-powerbar-module = callPackage ../tools/wayland/gtklock/powerbar-module.nix { }; gtklock-userinfo-module = callPackage ../tools/wayland/gtklock/userinfo-module.nix { }; From 77df6568e1c0bbd475c551a4ce0e84ebb4bd6735 Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 22 Oct 2024 14:33:31 +0800 Subject: [PATCH 04/13] gtklock-playerctl-module: format with nixfmt-rfc-style --- .../gt/gtklock-playerctl-module/package.nix | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/gt/gtklock-playerctl-module/package.nix b/pkgs/by-name/gt/gtklock-playerctl-module/package.nix index ac3c31ca0a03..356c04fb82c1 100644 --- a/pkgs/by-name/gt/gtklock-playerctl-module/package.nix +++ b/pkgs/by-name/gt/gtklock-playerctl-module/package.nix @@ -1,10 +1,11 @@ -{ lib -, stdenv -, fetchFromGitHub -, pkg-config -, gtk3 -, playerctl -, libsoup +{ + lib, + stdenv, + fetchFromGitHub, + pkg-config, + gtk3, + playerctl, + libsoup, }: stdenv.mkDerivation rec { @@ -20,7 +21,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = [ gtk3 playerctl libsoup ]; + buildInputs = [ + gtk3 + playerctl + libsoup + ]; makeFlags = [ "PREFIX=$(out)" ]; From 060794d950582aaa3a452a195905b4d18bf4d2df Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 22 Oct 2024 14:34:18 +0800 Subject: [PATCH 05/13] gtklock-powerbar-module: move to pkgs/by-name --- .../gt/gtklock-powerbar-module/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{tools/wayland/gtklock/powerbar-module.nix => by-name/gt/gtklock-powerbar-module/package.nix} (100%) diff --git a/pkgs/tools/wayland/gtklock/powerbar-module.nix b/pkgs/by-name/gt/gtklock-powerbar-module/package.nix similarity index 100% rename from pkgs/tools/wayland/gtklock/powerbar-module.nix rename to pkgs/by-name/gt/gtklock-powerbar-module/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7216d05cba74..d0f69aae8fc9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14388,8 +14388,6 @@ with pkgs; gpxsee = gpxsee-qt5; - gtklock-powerbar-module = callPackage ../tools/wayland/gtklock/powerbar-module.nix { }; - gtklock-userinfo-module = callPackage ../tools/wayland/gtklock/userinfo-module.nix { }; guvcview = libsForQt5.callPackage ../os-specific/linux/guvcview { }; From 0c8cec39e76204a00eddb5a8d1eac143101d5680 Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 22 Oct 2024 14:34:36 +0800 Subject: [PATCH 06/13] gtklock-powerbar-module: format with nixfmt-rfc-style --- pkgs/by-name/gt/gtklock-powerbar-module/package.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/gt/gtklock-powerbar-module/package.nix b/pkgs/by-name/gt/gtklock-powerbar-module/package.nix index 5c22d6535795..f7a88fa0918f 100644 --- a/pkgs/by-name/gt/gtklock-powerbar-module/package.nix +++ b/pkgs/by-name/gt/gtklock-powerbar-module/package.nix @@ -1,8 +1,9 @@ -{ lib -, stdenv -, fetchFromGitHub -, pkg-config -, gtk3 +{ + lib, + stdenv, + fetchFromGitHub, + pkg-config, + gtk3, }: stdenv.mkDerivation rec { From 7b9bf8ab9846d494985ecfc7fddca56fa8b8c4b8 Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 22 Oct 2024 14:35:15 +0800 Subject: [PATCH 07/13] gtklock-userinfo-module: move to pkgs/by-name --- .../gt/gtklock-userinfo-module/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{tools/wayland/gtklock/userinfo-module.nix => by-name/gt/gtklock-userinfo-module/package.nix} (100%) diff --git a/pkgs/tools/wayland/gtklock/userinfo-module.nix b/pkgs/by-name/gt/gtklock-userinfo-module/package.nix similarity index 100% rename from pkgs/tools/wayland/gtklock/userinfo-module.nix rename to pkgs/by-name/gt/gtklock-userinfo-module/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d0f69aae8fc9..74adcd97c7e8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14388,8 +14388,6 @@ with pkgs; gpxsee = gpxsee-qt5; - gtklock-userinfo-module = callPackage ../tools/wayland/gtklock/userinfo-module.nix { }; - guvcview = libsForQt5.callPackage ../os-specific/linux/guvcview { }; hachoir = with python3Packages; toPythonApplication hachoir; From 676b56208b33ea570396834282c87c1c3b72f33e Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 22 Oct 2024 14:35:30 +0800 Subject: [PATCH 08/13] gtklock-userinfo-module: format with nixfmt-rfc-style --- .../gt/gtklock-userinfo-module/package.nix | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/gt/gtklock-userinfo-module/package.nix b/pkgs/by-name/gt/gtklock-userinfo-module/package.nix index 72e650861cd3..fdecaa9d0d8f 100644 --- a/pkgs/by-name/gt/gtklock-userinfo-module/package.nix +++ b/pkgs/by-name/gt/gtklock-userinfo-module/package.nix @@ -1,10 +1,11 @@ -{ lib -, stdenv -, fetchFromGitHub -, pkg-config -, gtk3 -, glib -, accountsservice +{ + lib, + stdenv, + fetchFromGitHub, + pkg-config, + gtk3, + glib, + accountsservice, }: stdenv.mkDerivation rec { @@ -20,7 +21,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = [ gtk3 glib accountsservice ]; + buildInputs = [ + gtk3 + glib + accountsservice + ]; makeFlags = [ "PREFIX=$(out)" ]; From 25e67ab7fd277e7a8c13dbb31e6b0572ac37dd44 Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 22 Oct 2024 14:39:20 +0800 Subject: [PATCH 09/13] gtklock: 3.0.0 -> 4.0.0 --- pkgs/by-name/gt/gtklock/package.nix | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/gt/gtklock/package.nix b/pkgs/by-name/gt/gtklock/package.nix index 0f60a056dbda..e4a3853f78d8 100644 --- a/pkgs/by-name/gt/gtklock/package.nix +++ b/pkgs/by-name/gt/gtklock/package.nix @@ -12,15 +12,16 @@ gtk-session-lock, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "gtklock"; - version = "3.0.0"; + # Must run nixpkgs-review between version changes + version = "4.0.0"; src = fetchFromGitHub { owner = "jovanlanik"; repo = "gtklock"; - rev = "v${version}"; - hash = "sha256-B6pySjiwPBRFb4avE9NHsS1KkWMPW81DAqYro/wtrmQ="; + rev = "v${finalAttrs.version}"; + hash = "sha256-e/JRJtQAyIvQhL5hSbY7I/f12Z9g2N0MAHQvX+aXz8Q="; }; nativeBuildInputs = [ @@ -39,23 +40,19 @@ stdenv.mkDerivation rec { strictDeps = true; - installFlags = [ - "DESTDIR=$(out)" - "PREFIX=" - ]; - - meta = with lib; { + meta = { description = "GTK-based lockscreen for Wayland"; longDescription = '' Important note: for gtklock to work you need to set "security.pam.services.gtklock = {};" manually. + Otherwise you'll lock youself out of desktop and unable to authenticate. ''; # Following nixpkgs/pkgs/applications/window-managers/sway/lock.nix homepage = "https://github.com/jovanlanik/gtklock"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ dit7ya aleksana ]; - platforms = platforms.linux; + platforms = lib.platforms.linux; mainProgram = "gtklock"; }; -} +}) From 48c03f11aae9dbb9858092053d3e78922754ed4a Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 22 Oct 2024 15:09:48 +0800 Subject: [PATCH 10/13] gtklock: add module compatibility check helper --- pkgs/by-name/gt/gtklock/package.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/by-name/gt/gtklock/package.nix b/pkgs/by-name/gt/gtklock/package.nix index e4a3853f78d8..ff3369c1ebbf 100644 --- a/pkgs/by-name/gt/gtklock/package.nix +++ b/pkgs/by-name/gt/gtklock/package.nix @@ -10,6 +10,7 @@ gtk3, pam, gtk-session-lock, + runCommand, }: stdenv.mkDerivation (finalAttrs: { @@ -40,6 +41,21 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; + passthru.testModule = + module: + runCommand "${module.name}-test.sh" { } '' + MODULE_PATH=$(find ${module}/lib/gtklock -maxdepth 1 -name '*.so') + echo -e "[main]\nmodules=''${MODULE_PATH}" >./config.ini + ${finalAttrs.finalPackage}/bin/gtklock --config ./config.ini >./log 2>&1 || true + if grep incompatible ./log; then + echo "${module.name} is incompatible with current ${finalAttrs.finalPackage.name}!" + exit 1 + else + echo "Successfully tested ${module.name} against ${finalAttrs.finalPackage.name}." + fi + touch $out + ''; + meta = { description = "GTK-based lockscreen for Wayland"; longDescription = '' From 8c307b51efbbdf6ee8e7c513e17d3cb11efdd432 Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 22 Oct 2024 15:14:15 +0800 Subject: [PATCH 11/13] gtklock-playerctl-module: 3.0.0 -> 4.0.0 --- .../gt/gtklock-playerctl-module/package.nix | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/gt/gtklock-playerctl-module/package.nix b/pkgs/by-name/gt/gtklock-playerctl-module/package.nix index 356c04fb82c1..847f17305747 100644 --- a/pkgs/by-name/gt/gtklock-playerctl-module/package.nix +++ b/pkgs/by-name/gt/gtklock-playerctl-module/package.nix @@ -2,38 +2,45 @@ lib, stdenv, fetchFromGitHub, + meson, + ninja, pkg-config, gtk3, playerctl, - libsoup, + libsoup_3, + gtklock, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "gtklock-playerctl-module"; - version = "3.0.0"; + version = "4.0.0"; src = fetchFromGitHub { owner = "jovanlanik"; - repo = pname; - rev = "v${version}"; - hash = "sha256-eN4E3+jv8IyRvV8pvfCjCc6pl8y7qSLRlj7tYkX0JrE="; + repo = "gtklock-playerctl-module"; + rev = "v${finalAttrs.version}"; + hash = "sha256-YlnZxp06Bb8eIgZhCvbiX6jgnNuGoSv4wx0N4AD1V7o="; }; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + ]; buildInputs = [ gtk3 playerctl - libsoup + libsoup_3 ]; - makeFlags = [ "PREFIX=$(out)" ]; + passthru.tests.testModule = gtklock.testModule finalAttrs.finalPackage; - meta = with lib; { + meta = { description = "Gtklock module adding media player controls to the lockscreen"; homepage = "https://github.com/jovanlanik/gtklock-playerctl-module"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ aleksana ]; - platforms = platforms.linux; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ aleksana ]; + platforms = lib.platforms.linux; }; -} +}) From 18b40fe3acf7c442a154af4ea7cbca10ae807087 Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 22 Oct 2024 15:17:11 +0800 Subject: [PATCH 12/13] gtklock-powerbar-module: 3.0.0 -> 4.0.0 --- .../gt/gtklock-powerbar-module/package.nix | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/gt/gtklock-powerbar-module/package.nix b/pkgs/by-name/gt/gtklock-powerbar-module/package.nix index f7a88fa0918f..9be823146038 100644 --- a/pkgs/by-name/gt/gtklock-powerbar-module/package.nix +++ b/pkgs/by-name/gt/gtklock-powerbar-module/package.nix @@ -2,32 +2,39 @@ lib, stdenv, fetchFromGitHub, + meson, + ninja, pkg-config, gtk3, + gtklock, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "gtklock-powerbar-module"; - version = "3.0.0"; + version = "4.0.0"; src = fetchFromGitHub { owner = "jovanlanik"; - repo = pname; - rev = "v${version}"; - hash = "sha256-uqGWr3/PaXif+JuxqRDlvfeiVG2nbausfe5dZOHcm7o="; + repo = "gtklock-powerbar-module"; + rev = "v${finalAttrs.version}"; + hash = "sha256-Zakdta1i0o7S2AbHydlonnh5OMGVgGjB2H/AiHgQT9A="; }; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + ]; buildInputs = [ gtk3 ]; - makeFlags = [ "PREFIX=$(out)" ]; + passthru.tests.testModule = gtklock.testModule finalAttrs.finalPackage; - meta = with lib; { + meta = { description = "Gtklock module adding power controls to the lockscreen"; homepage = "https://github.com/jovanlanik/gtklock-powerbar-module"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ aleksana ]; - platforms = platforms.linux; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ aleksana ]; + platforms = lib.platforms.linux; }; -} +}) From bd43c4d6c9614189864017469fd00b5dae006fea Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 22 Oct 2024 15:20:29 +0800 Subject: [PATCH 13/13] gtklock-userinfo-module: 3.0.0 -> 4.0.0 --- .../gt/gtklock-userinfo-module/package.nix | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/gt/gtklock-userinfo-module/package.nix b/pkgs/by-name/gt/gtklock-userinfo-module/package.nix index fdecaa9d0d8f..8bf94d73610e 100644 --- a/pkgs/by-name/gt/gtklock-userinfo-module/package.nix +++ b/pkgs/by-name/gt/gtklock-userinfo-module/package.nix @@ -2,24 +2,31 @@ lib, stdenv, fetchFromGitHub, + meson, + ninja, pkg-config, gtk3, glib, accountsservice, + gtklock, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "gtklock-userinfo-module"; - version = "3.0.0"; + version = "4.0.0"; src = fetchFromGitHub { owner = "jovanlanik"; - repo = pname; - rev = "v${version}"; - hash = "sha256-gZ9TGARuWFGyWLROlJQWwiEtbzQC9rlG8NKxUuGh57c="; + repo = "gtklock-userinfo-module"; + rev = "v${finalAttrs.version}"; + hash = "sha256-d9S0Tj7aII2JQ5/PZmt8HaUIb5caoD4GND0PGvuRMn8="; }; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + ]; buildInputs = [ gtk3 @@ -27,13 +34,13 @@ stdenv.mkDerivation rec { accountsservice ]; - makeFlags = [ "PREFIX=$(out)" ]; + passthru.tests.testModule = gtklock.testModule finalAttrs.finalPackage; - meta = with lib; { + meta = { description = "Gtklock module adding user info to the lockscreen"; homepage = "https://github.com/jovanlanik/gtklock-userinfo-module"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ aleksana ]; - platforms = platforms.linux; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ aleksana ]; + platforms = lib.platforms.linux; }; -} +})