summaryrefslogtreecommitdiff
path: root/pkgs
diff options
context:
space:
mode:
authorKjetil Orbekk <kjetil.orbekk@gmail.com>2020-02-12 06:04:53 -0500
committerKjetil Orbekk <kjetil.orbekk@gmail.com>2020-02-12 06:04:53 -0500
commit5630bc0c5d48acdf50b6bb078fd0a2711287ea89 (patch)
tree93d17345712530ffe15b75a524d341bcde4329ab /pkgs
parentb8fd8460a2bc9b25b80df35072205a1a1a9c2496 (diff)
Add pjournal package
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/pjournal/default.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/pkgs/pjournal/default.nix b/pkgs/pjournal/default.nix
new file mode 100644
index 0000000..ca9d116
--- /dev/null
+++ b/pkgs/pjournal/default.nix
@@ -0,0 +1,51 @@
+{ callPackage, fetchgit, 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"
+ '';
+
+ preConfigure = ''
+ export HOME=$(mktemp -d)
+ '';
+
+ buildInputs = with pkgs; [
+ openssl pkgconfig postgresql makeWrapper
+ ];
+
+ src = fetchgit {
+ url = "https://git.orbekk.com/pjournal.git";
+ rev = "02eca80d8e357e80585f766b873ef3efceabfe42";
+ sha256 = "0f3swk92sma7a8dvc1pm22na94wflkb17nshcarc37jigqmmcw6d";
+ };
+
+ cargoSha256 = "1fblssff1g74x70din0wb89ral1651mg00v9gprwffszgc17mcd2";
+ # verifyCargoDeps = true;
+}