waylock: use zigHook

Also, a cosmetic refactor:

- Reorder parameter listing
- Use rec-less, overlay-style overridable recursive attributes (in effect since
NixOS#119942);
- Remove nested with (according to
https://nix.dev/recipes/best-practices#with-scopes)
This commit is contained in:
Anderson Torres 2023-07-09 22:28:39 -03:00
parent 6d87dc7136
commit 5c68e0e7e1
2 changed files with 25 additions and 27 deletions

View File

@ -1,27 +1,33 @@
{ lib
, stdenv
, fetchFromGitHub
, zig
, wayland
, pkg-config
, scdoc
, wayland-protocols
, libxkbcommon
, pam
, pkg-config
, scdoc
, wayland
, wayland-protocols
, zigHook
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "waylock";
version = "0.6.2";
src = fetchFromGitHub {
owner = "ifreund";
repo = pname;
rev = "v${version}";
hash = "sha256-jl4jSDWvJB6OfBbVXfVQ7gv/aDkN6bBy+/yK+AQDQL0=";
repo = "waylock";
rev = "v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-jl4jSDWvJB6OfBbVXfVQ7gv/aDkN6bBy+/yK+AQDQL0=";
};
nativeBuildInputs = [ zig wayland scdoc pkg-config ];
nativeBuildInputs = [
pkg-config
scdoc
wayland
zigHook
];
buildInputs = [
wayland-protocols
@ -29,23 +35,13 @@ stdenv.mkDerivation rec {
pam
];
dontConfigure = true;
zigBuildFlags = [ "-Dman-pages" ];
preBuild = ''
export HOME=$TMPDIR
'';
installPhase = ''
runHook preInstall
zig build -Drelease-safe -Dman-pages -Dcpu=baseline --prefix $out install
runHook postInstall
'';
meta = with lib; {
meta = {
homepage = "https://github.com/ifreund/waylock";
description = "A small screenlocker for Wayland compositors";
license = licenses.isc;
platforms = platforms.linux;
maintainers = with maintainers; [ jordanisaacs ];
license = lib.licenses.isc;
maintainers = with lib.maintainers; [ jordanisaacs ];
platforms = lib.platforms.linux;
};
}
})

View File

@ -32343,8 +32343,10 @@ with pkgs;
waycorner = callPackage ../applications/misc/waycorner { };
waylock = callPackage ../applications/misc/waylock {
zigHook = zigHook.override {
zig = buildPackages.zig_0_10;
};
};
wayshot = callPackage ../tools/misc/wayshot { };