about summary refs log tree commit diff
path: root/pkgs/applications/display-managers/lightdm-tiny-greeter/default.nix
blob: c6c479505d12c37a424dc74df652cc1ac3aa8d71 (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
{ lib, stdenv, linkFarm, lightdm-tiny-greeter, fetchFromGitHub
, pkg-config, lightdm, gtk3, glib, wrapGAppsHook, config, conf ? config.lightdm-tiny-greeter.conf or "" }:

stdenv.mkDerivation rec {
  pname = "lightdm-tiny-greeter";
  version = "1.2";

  src = fetchFromGitHub {
    owner = "off-world";
    repo = "lightdm-tiny-greeter";
    rev = version;
    sha256 = "08azpj7b5qgac9bgi1xvd6qy6x2nb7iapa0v40ggr3d1fabyhrg6";
  };

  nativeBuildInputs = [ pkg-config wrapGAppsHook ];
  buildInputs = [ lightdm gtk3 glib ];

  postUnpack = lib.optionalString (conf != "") ''
    cp ${builtins.toFile "config.h" conf} source/config.h
  '';

  buildPhase = ''
    mkdir -p $out/bin $out/share/xgreeters
    make ${pname}
    mv ${pname} $out/bin/.
    mv lightdm-tiny-greeter.desktop $out/share/xgreeters
  '';

  installPhase = ''
    substituteInPlace "$out/share/xgreeters/lightdm-tiny-greeter.desktop" \
      --replace "Exec=lightdm-tiny-greeter" "Exec=$out/bin/lightdm-tiny-greeter"
  '';

  passthru.xgreeters = linkFarm "lightdm-tiny-greeter-xgreeters" [{
    path = "${lightdm-tiny-greeter}/share/xgreeters/lightdm-tiny-greeter.desktop";
    name = "lightdm-tiny-greeter.desktop";
  }];

  meta = with lib; {
    description = "A tiny multi user lightdm greeter";
    mainProgram = "lightdm-tiny-greeter";
    homepage = "https://github.com/off-world/lightdm-tiny-greeter";
    license = licenses.bsd3;
    maintainers = with maintainers; [ edwtjo ];
    platforms = platforms.linux;
  };
}