-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
37 lines (37 loc) · 961 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> { }
, lib ? pkgs.lib
, naersk ? pkgs.callPackage
(pkgs.fetchFromGitHub {
owner = "nix-community";
repo = "naersk";
rev = "c3e56b8a4ffb6d906cdfcfee034581f9a8ece571";
sha256 = "0mq4jqvvqmy35bapybsqqpngy0r6j43n3pzm1y75bbfnyq5f4gab";
})
{ }
}:
let
stdenv = pkgs.stdenv;
binaries = naersk.buildPackage {
name = "onion-or-news";
src = lib.sourceFilesBySuffices ./. [
"Cargo.lock"
"Cargo.toml"
".rs"
".sql"
];
nativeBuildInputs = with pkgs; [ openssl pkg-config postgresql.lib ];
};
static = stdenv.mkDerivation {
name = "onion-or-news-static";
src = lib.sourceFilesBySuffices ./. [ ".html" ".js" ];
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
mkdir -p $out/share/static
cp -r oon_web/static/. $out/share/static
'';
};
in
pkgs.symlinkJoin {
name = "onion-or-news-deploy";
paths = [ binaries static ];
}