forked from SEbbaDK/maptogether
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
37 lines (34 loc) · 997 Bytes
/
default.nix
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
{ pkgs ? import ../nixpkgs.nix { }
, mkDerivation ? pkgs.stdenv.mkDerivation
, # Dependencies
crystal ? pkgs.crystal
, shards ? pkgs.shards
, pkg-config ? pkgs.pkg-config
, openssl ? pkgs.openssl
, crystal2nix ? pkgs.crystal2nix
, buildCrystalPackage ? pkgs.crystal.buildCrystalPackage
, ...
}:
let
shard = builtins.readFile ./shard.yml;
version = builtins.head (builtins.match ".*version: ([0-9.]+).*" shard);
in
(buildCrystalPackage rec {
pname = "maptogether-server";
inherit version;
buildInputs = [ openssl openssl.out ];
src = pkgs.runCommand "source" { } ''
mkdir $out
ln -s ${./shard.yml} $out/shard.yml
ln -s ${./src} $out/src
ln -s ${./spec} $out/spec
'';
format = "shards";
lockFile = ./shard.lock;
shardsFile = ./shards.nix;
# Disable tests until they work
doCheck = false;
doInstallCheck = false;
})
# This line enables quicker builds
.overrideAttrs (old: { buildPhase = builtins.replaceStrings [ "--release" ] [ "" ] old.buildPhase; })