default.nix 857 Bytes
Newer Older
Ben Gamari's avatar
Ben Gamari committed
1
{ nixpkgs ? (import ./nixpkgs.nix {}) }:
Ben Gamari's avatar
Ben Gamari committed
2 3 4

with nixpkgs;
let
Ben Gamari's avatar
Ben Gamari committed
5 6
  src = nix-gitignore.gitignoreSource [] ./.;
  hs = haskellPackages.callCabal2nix "ghc-homepage" src {};
Ben Gamari's avatar
Ben Gamari committed
7

Ben Gamari's avatar
Ben Gamari committed
8 9
  scripts = stdenv.mkDerivation {
    name = "ghc-homepage-scripts";
Ben Gamari's avatar
Ben Gamari committed
10
    buildInputs = [ linkchecker ];
Ben Gamari's avatar
Ben Gamari committed
11
    nativeBuildInputs = [ makeWrapper ];
Ben Gamari's avatar
Ben Gamari committed
12
    inherit src;
Ben Gamari's avatar
Ben Gamari committed
13 14
    installPhase = ''
      mkdir -p $out/bin
Ben Gamari's avatar
Ben Gamari committed
15
      install check.sh $out/bin
Ben Gamari's avatar
Ben Gamari committed
16
      chmod ugo+rx $out/bin/check.sh
Ben Gamari's avatar
Ben Gamari committed
17 18
      wrapProgram $out/bin/check.sh \
        --prefix PATH : ${linkchecker}/bin:$out/bin
Ben Gamari's avatar
Ben Gamari committed
19 20 21
      makeWrapper ${hs}/bin/ghc-homepage $out/bin/ghc-homepage \
        --set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive" \
        --set LANG en_US.UTF-8
Ben Gamari's avatar
Ben Gamari committed
22
      makeWrapper ${hs}/bin/gen-index $out/bin/gen-index
Ben Gamari's avatar
Ben Gamari committed
23 24
    '';
  };
Ben Gamari's avatar
Ben Gamari committed
25

Ben Gamari's avatar
Ben Gamari committed
26
in buildEnv { name = "ghc-homepage-utils"; paths = [ scripts openssh rclone ]; }