-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
65 lines (61 loc) · 2.6 KB
/
flake.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
# Stolen/borrowed from Corteza forums: Blog post: https://forum.cortezaproject.org/t/nix-custom-build-auth-callback-path-returning-404/252/2
description = "A very basic flake";
inputs = {
nixpkgs.url = github:nixos/nixpkgs;
};
outputs = { self, nixpkgs }:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in
{
packages.x86_64-linux.corteza = (with pkgs;
let
meta = with lib; {
description = "Corteza is the only 100% free, open-source, standardized and enterprise-grade Low-code platform";
homepage = "https://cortezaproject.org/";
license = licenses.asl20;
# maintainers = [ maintainers. ];
};
version = "2022.3.4";
server = buildGoModule rec {
pname = "corteza-server";
inherit version meta;
src = fetchFromGitHub {
owner = "cortezaproject";
repo = pname;
rev = "${version}";
sha256 = "sha256-e+LBQGJN0mAFrEQ1zxh1Q3HhPUoFHfV0sx0MnAF5P8k=";
};
vendorSha256 = null;
subPackages = [ "cmd/corteza" ];
postInstall = ''
cp -r provision $out
rm -f $out/provision/README.adoc $out/provision/update.sh
cp -r auth/assets $out/auth
'';
doCheck = false;
};
releasesURL = "https://releases.cortezaproject.org/files";
webapp = app: "${releasesURL}/corteza-webapp-${app}-${version}.tar.gz";
admin = fetchurl { url = webapp "admin"; sha256 = "sha256-IUGj++SU8mqXLfOhlJN12Q5H4zw9Pw3Lv+qP3JNL/bA="; };
compose = fetchurl { url = webapp "compose"; sha256 = "sha256-2DPzWmoFfnIfCi/VLATyD4DfzMx+NkRwqGPOZoOxFrg="; };
workflow = fetchurl { url = webapp "workflow"; sha256 = "sha256-VuViU2twRMx0/bpamUZUt16XanK6rmHRaa8pm4WVTus="; };
one = fetchurl { url = webapp "one"; sha256 = "sha256-M4R5aaDh9bBkjlCJA7jOUwgFGyzrPhMbAIBCk68EtTg="; };
in
stdenv.mkDerivation rec {
pname = "corteza";
inherit version meta;
src = ./.;
installPhase = ''
mkdir -p $out/webapp/admin $out/webapp/compose $out/webapp/workflow
cp -r ${server}/* $out
tar -xzmokf ${one} --directory=$out/webapp
tar -xzmokf ${admin} --directory=$out/webapp/admin
tar -xzmokf ${compose} --directory=$out/webapp/compose
tar -xzmokf ${workflow} --directory=$out/webapp/workflow
'';
});
defaultPackage.x86_64-linux = self.packages.x86_64-linux.corteza;
};
}