summary refs log tree commit diff
path: root/pkgs/servers/icingaweb2/theme-unicorn/default.nix
blob: a2bb3f9e4a2b8fb0356a257b25af6a6c0526e3c2 (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
{ lib
, stdenv
, fetchurl
, fetchFromGitHub
}:

stdenv.mkDerivation rec {
  name = "icingaweb2-theme-unicorn";
  version = "1.0.2";

  srcs = [
    (fetchFromGitHub {
      owner = "Mikesch-mp";
      repo = name;
      rev = "v${version}";
      sha256 = "1qmcajdf0g70vp2avqa50lfrfigq22k91kggbgn5ablwyg9dki05";
    })
    (fetchurl {
      url = "http://i.imgur.com/SCfMd.png";
      sha256 = "1y6wqm1z6mn0a6jankd7pzqgi7zm5320kk6knvbv3qhzx2b74ypp";
    })
  ];

  unpackPhase = ''
    for src in $srcs; do
      case $src in
        *.png)
          cp $src unicorn.png
          ;;
        *)
          cp -r $src/* .
          ;;
      esac
    done
  '';

  installPhase = ''
    mkdir -p "$out"
    cp -r * "$out"
    chmod 755 $out/public/img
    cp unicorn.png "$out/public/img/unicorn.png"
  '';

  meta = with lib; {
    description = "Unicorn theme for IcingaWeb 2";
    homepage = "https://github.com/Mikesch-mp/icingaweb2-theme-unicorn";
    license = licenses.publicDomain;
    platforms = platforms.all;
    maintainers = with maintainers; [ das_j ];
  };
}