~yoctocell/yoctocell.xyz

ref: 10a379eef2eba3370bcd35bab05a15d483f90d11 yoctocell.xyz/default.nix -rw-r--r-- 817 bytes
10a379eeXinglu Chen posts: Use fill-mode 10 months ago
                                                                                
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
{ compiler ? "ghc884"
, pkgs
}:
let
  haskellPackages = pkgs.haskell.packages.${compiler}.override {
    overrides = hpNew: hpOld: {

      yoctocell-xyz = hpNew.callCabal2nix "yoctocell-xyz" ./. { };

    };
  };

  project = haskellPackages.yoctocell-xyz;

  updateServer = pkgs.writeScriptBin "update-server"
    ''
      rsync -aAXv public/ root@yoctocell.xyz:/var/www/yoctocell.xyz
    '';
in
{
  myProject = project;

  myShell = haskellPackages.shellFor {
    packages = p: with p; [
      project
    ];

    buildInputs = with haskellPackages; [
      updateServer
      brittany
      cabal-install
    ];

    withHoogle = true;

    shellHook = ''
      git config sendemail.to '~yoctocell/yoctocell.xyz-devel@lists.sr.ht'
      ln -s ${updateServer}/bin/update-server .git/hooks/pre-push
    '';

  };
}