depot/third_party/nixpkgs/pkgs/misc/screensavers/slock/default.nix
Default email 01ed8ef136 Project import generated by Copybara.
GitOrigin-RevId: 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8
2022-11-21 19:40:18 +02:00

38 lines
1 KiB
Nix

{ lib, stdenv, fetchurl, writeText
, xorgproto, libX11, libXext, libXrandr, libxcrypt
# default header can be obtained from
# https://git.suckless.org/slock/tree/config.def.h
, conf ? null }:
stdenv.mkDerivation (finalAttrs: {
pname = "slock";
version = "1.5";
src = fetchurl {
url = "https://dl.suckless.org/tools/slock-${finalAttrs.version}.tar.gz";
hash = "sha256-ruHj+/aid/tiWjg4BzuXm2SD57rKTOgvVt4f8ZLbDk0=";
};
buildInputs = [ xorgproto libX11 libXext libXrandr libxcrypt ];
installFlags = [ "PREFIX=$(out)" ];
postPatch = "sed -i '/chmod u+s/d' Makefile";
preBuild = lib.optionalString (conf != null) ''
cp ${writeText "config.def.h" conf} config.def.h
'';
makeFlags = [ "CC:=$(CC)" ];
meta = with lib; {
homepage = "https://tools.suckless.org/slock";
description = "Simple X display locker";
longDescription = ''
Simple X display locker. This is the simplest X screen locker.
'';
license = licenses.mit;
maintainers = with maintainers; [ astsmtl ];
platforms = platforms.linux;
};
})