aboutsummaryrefslogtreecommitdiff
path: root/app/cryptpad/build/default.nix
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-05-05 17:45:15 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-05-05 17:45:15 +0200
commitf0ead6efed2ce7078302b825ad6b98fbbeebc693 (patch)
treebf179638e23db1842284430970732034600c0a1c /app/cryptpad/build/default.nix
parentf27636dd14cc06b84f1564f48c148be7394540b3 (diff)
downloadinfrastructure-f0ead6efed2ce7078302b825ad6b98fbbeebc693.tar.gz
infrastructure-f0ead6efed2ce7078302b825ad6b98fbbeebc693.zip
WIP Cryptpad packaging
Diffstat (limited to 'app/cryptpad/build/default.nix')
-rw-r--r--app/cryptpad/build/default.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/app/cryptpad/build/default.nix b/app/cryptpad/build/default.nix
new file mode 100644
index 0000000..2069a58
--- /dev/null
+++ b/app/cryptpad/build/default.nix
@@ -0,0 +1,27 @@
+let
+ common = import ./common.nix;
+ pkgs = import common.pkgsSrc {};
+ nodejs = pkgs.${common.nodejs};
+in
+ pkgs.stdenv.mkDerivation {
+ name = "cryptpad";
+ src = ./cryptpad;
+
+ installPhase = ''
+ mkdir -p $out/{bin,opt}
+
+ cp -r config customize.dist lib node_modules package.json package-lock.json server.js www $out/opt/
+ ln -s / $out/opt/root
+
+ cat > $out/bin/cryptpad <<EOF
+ cd $out/opt/
+ #!${pkgs.bash}/bin/bash
+ ${nodejs}/bin/node server.js
+ EOF
+
+ chmod +x $out/bin/cryptpad
+ '';
+
+ dontFixup = true;
+ }
+