aboutsummaryrefslogtreecommitdiff
path: root/cluster/prod/app/cryptpad/build/shell.nix
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-08-24 15:42:47 +0200
committerAlex Auvolat <alex@adnab.me>2022-08-24 15:42:47 +0200
commit2e8923b383eb06c53261eee8e5c442b857fb67e4 (patch)
tree0ad148f75f7b54dfed2dbac8f43f6df9badc502a /cluster/prod/app/cryptpad/build/shell.nix
parent9848f3090f77363a2fda0f9fa673ebcf1fb8228c (diff)
downloadnixcfg-2e8923b383eb06c53261eee8e5c442b857fb67e4.tar.gz
nixcfg-2e8923b383eb06c53261eee8e5c442b857fb67e4.zip
Move app files into cluster subdirectories; add prod garage
Diffstat (limited to 'cluster/prod/app/cryptpad/build/shell.nix')
-rw-r--r--cluster/prod/app/cryptpad/build/shell.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/cluster/prod/app/cryptpad/build/shell.nix b/cluster/prod/app/cryptpad/build/shell.nix
new file mode 100644
index 0000000..bf701fe
--- /dev/null
+++ b/cluster/prod/app/cryptpad/build/shell.nix
@@ -0,0 +1,31 @@
+let
+ common = import ./common.nix;
+ pkgs = import common.pkgsSrc {};
+
+ bower2nixRepo = (import common.bower2nixSrc {
+ inherit pkgs;
+ });
+ bower2nix = bower2nixRepo // {
+ package = bower2nixRepo.package.override {
+ postInstall = "tsc";
+ };
+ };
+in
+ pkgs.mkShell {
+ nativeBuildInputs = [
+ bower2nix.package
+ pkgs.nodePackages.node2nix
+ ];
+
+ shellHook = ''
+function update_lock {
+ set -exuo pipefail
+ mkdir -p nix.lock
+ ${pkgs.wget}/bin/wget https://raw.githubusercontent.com/xwiki-labs/cryptpad/${common.cryptpadCommit}/package.json -O nix.lock/package.json
+ ${pkgs.wget}/bin/wget https://raw.githubusercontent.com/xwiki-labs/cryptpad/${common.cryptpadCommit}/package-lock.json -O nix.lock/package-lock.json
+ ${pkgs.wget}/bin/wget https://raw.githubusercontent.com/xwiki-labs/cryptpad/${common.cryptpadCommit}/bower.json -O nix.lock/bower.json
+ ${bower2nix.package}/bin/bower2nix nix.lock/bower.json nix.lock/bower.nix
+ ${pkgs.nodePackages.node2nix}/bin/node2nix --input nix.lock/package.json --lock nix.lock/package-lock.json --composition nix.lock/npm.nix --node-env nix.lock/node-env.nix --output nix.lock/node-packages.nix
+}
+ '';
+ }