summaryrefslogtreecommitdiff
path: root/package.nix
blob: 096d140d592f698c1e80b1af16aed31f9537c715 (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
{ callPackage, fetchFromGitHub, makeRustPlatform, stdenv, pkgs, ... }:

let mkRustPlatform = { date, channel }:
      let
        mozillaOverlay = fetchFromGitHub {
            owner = "mozilla";
            repo = "nixpkgs-mozilla";
            rev = "5300241b41243cb8962fad284f0004afad187dad";
            sha256 = "1h3g3817anicwa9705npssvkwhi876zijyyvv4c86qiklrkn5j9w";
          };
          mozilla = callPackage "${mozillaOverlay.out}/package-set.nix" {};
          rustSpecific = (mozilla.rustChannelOf { inherit date channel; }).rust;
      in
        makeRustPlatform {
          cargo = rustSpecific;
          rustc = rustSpecific;
        };
in let
  rustPlatform = mkRustPlatform {
    date = "2020-01-15";
    channel = "nightly";
  };
in rustPlatform.buildRustPackage rec {
  pname = "pjournal";
  version = "0.1.0";

  # https://git.breakds.org/breakds/nixvital/src/branch/master/pkgs/simple-reflection-server/default.nix
  postInstall = ''
    mkdir $out/etc/
    cp -r templates $out/etc
    wrapProgram "$out/bin/pjournal" \
      --prefix ROCKET_TEMPLATE_DIR : "$out/etc/templates"
  '';

  buildInputs = with pkgs; [
    openssl pkgconfig postgresql makeWrapper
  ];

  src = ./.;

  cargoSha256 = "1s2cix5a74g0cwfw93sak8mx7yrxba476fz89zgpz01y57wzgybr";
  # verifyCargoDeps = true;
}