about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/sw/swaylock-fancy/package.nix
blob: 83d56def4dcce46ba8d2fdeae46951884ccd327e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ lib
, stdenv
, fetchFromGitHub
, coreutils
, grim
, gawk
, jq
, swaylock
, imagemagick
, getopt
, fontconfig
, wmctrl
, makeWrapper
, bash
}:

let
  depsPath = lib.makeBinPath [
    coreutils
    grim
    gawk
    jq
    swaylock
    imagemagick
    getopt
    fontconfig
    wmctrl
  ];
  mainProgram = "swaylock-fancy";
in

stdenv.mkDerivation {
  pname = "swaylock-fancy";
  version = "unstable-2023-11-21";

  src = fetchFromGitHub {
    owner = "Big-B";
    repo = "swaylock-fancy";
    rev = "ff37ae3c6d0f100f81ff64fdb9d422c37de2f4f6";
    hash = "sha256-oS4YCbZOIrMP4QSM5eHWzTn18k3w2OnJ2k+64x/DnuM=";
  };

  postPatch = ''
    substituteInPlace ${mainProgram} \
      --replace "/usr/share" "$out/share"
  '';

  strictDeps = true;
  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [ bash ];

  makeFlags = [ "PREFIX=${placeholder "out"}" ];

  postInstall = ''
    wrapProgram $out/bin/${mainProgram} \
      --prefix PATH : "${depsPath}"
  '';

  meta = with lib; {
    description = "This is an swaylock bash script that takes a screenshot of the desktop, blurs the background and adds a lock icon and text";
    homepage = "https://github.com/Big-B/swaylock-fancy";
    license = licenses.mit;
    platforms = platforms.linux;
    maintainers = with maintainers; [ frogamic ];
    inherit mainProgram;
  };
}