diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-05-06 17:34:30 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-05-06 17:35:09 +0200 |
commit | 071e87a2025edfa8694fd3ae05be894d2be434ee (patch) | |
tree | cacc8e997f669a3ae497b2256394aa90c83c711e /app/cryptpad/build/shell.nix | |
parent | 0561fa8d5f07f183a27b068feb820e4777b0c020 (diff) | |
download | nixcfg-071e87a2025edfa8694fd3ae05be894d2be434ee.tar.gz nixcfg-071e87a2025edfa8694fd3ae05be894d2be434ee.zip |
Own packaging of Cryptpad
Diffstat (limited to 'app/cryptpad/build/shell.nix')
-rw-r--r-- | app/cryptpad/build/shell.nix | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/app/cryptpad/build/shell.nix b/app/cryptpad/build/shell.nix new file mode 100644 index 0000000..bf701fe --- /dev/null +++ b/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 +} + ''; + } |