-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Niklas Korz <[email protected]>
- Loading branch information
1 parent
92d4367
commit 2ac3b27
Showing
4 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/app/cmd/server.go b/app/cmd/server.go | ||
index fcfbeec2..71f01c9d 100644 | ||
--- a/app/cmd/server.go | ||
+++ b/app/cmd/server.go | ||
@@ -46,7 +46,6 @@ func RunServer() int { | ||
}) | ||
} | ||
|
||
- copyEtcFiles(ctx) | ||
startJobs(ctx) | ||
|
||
e := routes(web.New()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
version, | ||
src, | ||
lib, | ||
esbuild, | ||
buildGoModule, | ||
fetchFromGitHub, | ||
buildNpmPackage, | ||
}: | ||
let | ||
esbuild' = esbuild.override { | ||
buildGoModule = | ||
args: | ||
buildGoModule ( | ||
args | ||
// rec { | ||
version = "0.14.38"; | ||
src = fetchFromGitHub { | ||
owner = "evanw"; | ||
repo = "esbuild"; | ||
rev = "v${version}"; | ||
hash = "sha256-rvMi1oC7qGidvi4zrm9KCMMntu6LJGVOGN6VmU2ivQE="; | ||
}; | ||
vendorHash = "sha256-QPkBR+FscUc3jOvH7olcGUhM6OW4vxawmNJuRQxPuGs="; | ||
} | ||
); | ||
}; | ||
in | ||
buildNpmPackage { | ||
inherit src version; | ||
pname = "fider-frontend"; | ||
|
||
nativeBuildInputs = [ esbuild' ]; | ||
|
||
npmDepsHash = "sha256-gnboT5WQzftOCZ2Ouuza7bqpxJf+Zs7OWC8OHMZNHvw="; | ||
|
||
buildPhase = '' | ||
runHook preBuild | ||
npx lingui extract public/ | ||
npx lingui compile | ||
NODE_ENV=production node esbuild.config.js | ||
NODE_ENV=production npx webpack-cli | ||
runHook postBuild | ||
''; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out | ||
cp -r dist ssr.js favicon.png robots.txt $out/ | ||
runHook postInstall | ||
''; | ||
|
||
env = { | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = 1; | ||
ESBUILD_BINARY_PATH = lib.getExe esbuild'; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
lib, | ||
stdenvNoCC, | ||
fetchFromGitHub, | ||
callPackage, | ||
}: | ||
stdenvNoCC.mkDerivation (finalAttrs: { | ||
pname = "fider"; | ||
version = "0.23.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "getfider"; | ||
repo = "fider"; | ||
rev = "v${finalAttrs.version}"; | ||
hash = "sha256-QZMBapCeT+xEOf/XvOFHhF4g1inwOW2a5N5TxcQJOHU="; | ||
}; | ||
|
||
dontConfigure = true; | ||
dontBuild = true; | ||
|
||
server = callPackage ./server.nix { | ||
inherit (finalAttrs) src version; | ||
}; | ||
frontend = callPackage ./frontend.nix { | ||
inherit (finalAttrs) src version; | ||
}; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/etc | ||
cp -r locale views migrations $out/ | ||
cp -r etc/*.md $out/etc/ | ||
ln -s ${finalAttrs.server}/* $out/ | ||
ln -s ${finalAttrs.frontend}/* $out/ | ||
runHook postInstall | ||
''; | ||
|
||
meta = { | ||
description = "Open platform to collect and prioritize feedback"; | ||
homepage = "https://github.com/getfider/fider"; | ||
license = lib.licenses.agpl3Only; | ||
mainProgram = "fider"; | ||
maintainers = with lib.maintainers; [ | ||
drupol | ||
niklaskorz | ||
]; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
version, | ||
src, | ||
buildGoModule, | ||
}: | ||
buildGoModule { | ||
inherit src version; | ||
pname = "fider-server"; | ||
|
||
patches = [ | ||
./0001-disable-etc-copy.patch | ||
]; | ||
|
||
vendorHash = "sha256-CfopU72fpXiTaBtdf9A57Wb+flDu2XEtTISxImeJLL0="; | ||
|
||
ldflags = [ | ||
"-s" | ||
"-w" | ||
]; | ||
|
||
doCheck = false; # requires a running PostgreSQL database | ||
|
||
# preCheck = '' | ||
# set -o allexport | ||
# source ./.test.env | ||
# set +o allexport | ||
# ''; | ||
} |