summaryrefslogtreecommitdiff
path: root/bragi/bar/default.nix
blob: 98b369014ad4528be2bb08ad6128440e37c1f07c (plain)
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
{ haskellPackages
, stdenv
, fetchFromGitHub
, fetchurl
, haskell
}:

let
  pkg = haskellPackages.callPackage ./generated.nix {};
  webshim = stdenv.mkDerivation rec {
    name = "webshim-${version}";
    version = "1.16.0";
    src = fetchFromGitHub {
      owner = "aFarkas";
      repo = "webshim";
      rev = "1.16.0";
      sha256 = "14pk7hljqipzp0n7vpgcfxr3w4bla57cwyd7bmwmmxrm2zn62cyh";
    };

    installPhase = ''
      mkdir -p $out/js
      cp -r $src/js-webshim/dev/* $out/js/
    '';
  };
  jquery = stdenv.mkDerivation rec {
    name = "jquery-${version}";
    version = "3.3.1";
    src = fetchurl {
      url = "https://github.com/jquery/jquery/archive/${version}.tar.gz";
      sha256 = "1d1pilrwiz0yjx27cd7gbn8qar6hw5zgwjhpsyaijcg52z82wi5q";
    };

    installPhase = ''
      mkdir -p $out/js
      cp -r dist/jquery.js $out/js/
    '';
  };
in stdenv.lib.overrideDerivation pkg (drv: {
  postUnpack = ''
    (
      cd bar-*/static
      rm -rf jquery.js webshim
      ln -vs ${jquery}/js/jquery.js .
      ln -vs ${webshim}/js webshim
    )
  '';
})