git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #132974 from asbachb/bugfix/isso-129277

isso: added generation of javascript files, added module

commit53bd44342d22b53677b245c15de6e8f8a37718d0 authorTimothy DeHerrera <tim.deh@pm.me> dateMon 9 Aug 2021, 21:18 (5 years ago) parent524f7918629662
9 files changed+1278−44
nixos/doc/manual/from_md/release-notes/rl-2111.section.xml+7−35 nixos/doc/manual/release-notes/rl-2111.section.md+3−6 nixos/modules/module-list.nix+1 nixos/modules/services/web-apps/isso.nix+69 nixos/tests/isso.nix+30 pkgs/servers/isso/default.nix+22−3 pkgs/servers/isso/node-env.nix+573 pkgs/servers/isso/node-packages.nix+558 pkgs/servers/isso/package.json+15
nixos/doc/manual/from_md/release-notes/rl-2111.section.xml+7−35
@@ -164,6 +164,13 @@
164164 <link linkend="opt-services.influxdb2.enable">services.influxdb2</link>.
165165 </para>
166166 </listitem>
167+ <listitem>
168+ <para>
169+ <link xlink:href="https://posativ.org/isso/">isso</link>, a
170+ commenting server similar to Disqus. Available as
171+ <link linkend="opt-services.isso.enable">isso</link>
172+ </para>
173+ </listitem>
167174 </itemizedlist>
168175 </section>
169176 <section xml:id="sec-release-21.11-incompatibilities">
@@ -654,32 +661,6 @@
654661 to use wildcards in the <literal>source</literal> argument.
655662 </para>
656663 </listitem>
657− <listitem>
658− <para>
659− The <literal>openrazer</literal> and
660− <literal>openrazer-daemon</literal> packages as well as the
661− <literal>hardware.openrazer</literal> module now require users
662− to be members of the <literal>openrazer</literal> group
663− instead of <literal>plugdev</literal>. With this change, users
664− no longer need be granted the entire set of
665− <literal>plugdev</literal> group permissions, which can
666− include permissions other than those required by
667− <literal>openrazer</literal>. This is desirable from a
668− security point of view. The setting
669− <link xlink:href="options.html#opt-services.hardware.openrazer.users"><literal>harware.openrazer.users</literal></link>
670− can be used to add users to the <literal>openrazer</literal>
671− group.
672− </para>
673− </listitem>
674− <listitem>
675− <para>
676− The <literal>yambar</literal> package has been split into
677− <literal>yambar</literal> and
678− <literal>yambar-wayland</literal>, corresponding to the xorg
679− and wayland backend respectively. Please switch to
680− <literal>yambar-wayland</literal> if you are on wayland.
681− </para>
682− </listitem>
683664 </itemizedlist>
684665 </section>
685666 <section xml:id="sec-release-21.11-notable-changes">
@@ -849,15 +830,6 @@
849830 version of zfs.
850831 </para>
851832 </listitem>
852− <listitem>
853− <para>
854− Nginx will use the value of
855− <literal>sslTrustedCertificate</literal> if provided for a
856− virtual host, even if <literal>enableACME</literal> is set.
857− This is useful for providers not using the same certificate to
858− sign OCSP responses and server certificates.
859− </para>
860− </listitem>
861833 </itemizedlist>
862834 </section>
863835</section>
nixos/doc/manual/release-notes/rl-2111.section.md+3−6
@@ -50,6 +50,9 @@ pt-services.clipcat.enable).
5050
5151- [influxdb2](https://github.com/influxdata/influxdb), a Scalable datastore for metrics, events, and real-time analytics. Available as [services.influxdb2](#opt-services.influxdb2.enable).
5252
53+- [isso](https://posativ.org/isso/), a commenting server similar to Disqus.
54+ Available as [isso](#opt-services.isso.enable)
55+
5356## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
5457
5558- The `staticjinja` package has been upgraded from 1.0.4 to 3.0.1
@@ -166,10 +169,6 @@ pt-services.clipcat.enable).
166169
167170- `programs.neovim.runtime` switched to a `linkFarm` internally, making it impossible to use wildcards in the `source` argument.
168171
169−- The `openrazer` and `openrazer-daemon` packages as well as the `hardware.openrazer` module now require users to be members of the `openrazer` group instead of `plugdev`. With this change, users no longer need be granted the entire set of `plugdev` group permissions, which can include permissions other than those required by `openrazer`. This is desirable from a security point of view. The setting [`harware.openrazer.users`](options.html#opt-services.hardware.openrazer.users) can be used to add users to the `openrazer` group.
170−
171−- The `yambar` package has been split into `yambar` and `yambar-wayland`, corresponding to the xorg and wayland backend respectively. Please switch to `yambar-wayland` if you are on wayland.
172−
173172## Other Notable Changes {#sec-release-21.11-notable-changes}
174173
175174- The setting [`services.openssh.logLevel`](options.html#opt-services.openssh.logLevel) `"VERBOSE"` `"INFO"`. This brings NixOS in line with upstream and other Linux distributions, and reduces log spam on servers due to bruteforcing botnets.
@@ -215,5 +214,3 @@ pt-services.clipcat.enable).
215214- The [services.syncoid.enable](options.html#opt-services.syncoid.enable) module now properly drops ZFS permissions after usage. Before it delegated permissions to whole pools instead of datasets and didn't clean up after execution. You can manually look this up for your pools by running `zfs allow your-pool-name` and use `zfs unallow syncoid your-pool-name` to clean this up.
216215
217216- Zfs: `latestCompatibleLinuxPackages` is now exported on the zfs package. One can use `boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;` to always track the latest compatible kernel with a given version of zfs.
218−
219−- Nginx will use the value of `sslTrustedCertificate` if provided for a virtual host, even if `enableACME` is set. This is useful for providers not using the same certificate to sign OCSP responses and server certificates.
nixos/modules/module-list.nix+1
@@ -960,6 +960,7 @@
960960 ./services/web-apps/icingaweb2/icingaweb2.nix
961961 ./services/web-apps/icingaweb2/module-monitoring.nix
962962 ./services/web-apps/ihatemoney
963+ ./services/web-apps/isso.nix
963964 ./services/web-apps/jirafeau.nix
964965 ./services/web-apps/jitsi-meet.nix
965966 ./services/web-apps/keycloak.nix
nixos/modules/services/web-apps/isso.nixnew file+69
@@ -0,0 +1,69 @@
1+{ config, lib, pkgs, ... }:
2+
3+let
4+ inherit (lib) mkEnableOption mkIf mkOption types literalExample;
5+
6+ cfg = config.services.isso;
7+
8+ settingsFormat = pkgs.formats.ini { };
9+ configFile = settingsFormat.generate "isso.conf" cfg.settings;
10+in {
11+
12+ options = {
13+ services.isso = {
14+ enable = mkEnableOption ''
15+ A commenting server similar to Disqus.
16+
17+ Note: The application's author suppose to run isso behind a reverse proxy.
18+ The embedded solution offered by NixOS is also only suitable for small installations
19+ below 20 requests per second.
20+ '';
21+
22+ settings = mkOption {
23+ description = ''
24+ Configuration for <package>isso</package>.
25+
26+ See <link xlink:href="https://posativ.org/isso/docs/configuration/server/">Isso Server Configuration</link>
27+ for supported values.
28+ '';
29+
30+ type = types.submodule {
31+ freeformType = settingsFormat.type;
32+ };
33+
34+ example = literalExample ''
35+ {
36+ general = {
37+ host = "http://localhost";
38+ };
39+ }
40+ '';
41+ };
42+ };
43+ };
44+
45+ config = mkIf cfg.enable {
46+ services.isso.settings.general.dbpath = lib.mkDefault "/var/lib/isso/comments.db";
47+
48+ systemd.services.isso = {
49+ description = "isso, a commenting server similar to Disqus";
50+ wantedBy = [ "multi-user.target" ];
51+
52+ serviceConfig = {
53+ User = "isso";
54+ Group = "isso";
55+
56+ DynamicUser = true;
57+
58+ StateDirectory = "isso";
59+
60+ ExecStart = ''
61+ ${pkgs.isso}/bin/isso -c ${configFile}
62+ '';
63+
64+ Restart = "on-failure";
65+ RestartSec = 1;
66+ };
67+ };
68+ };
69+}
nixos/tests/isso.nixnew file+30
@@ -0,0 +1,30 @@
1+import ./make-test-python.nix ({ pkgs, ... }: {
2+ name = "isso";
3+ meta = with pkgs.lib.maintainers; {
4+ maintainers = [ asbachb ];
5+ };
6+
7+ machine = { config, pkgs, ... }: {
8+ services.isso = {
9+ enable = true;
10+ settings = {
11+ general = {
12+ dbpath = "/var/lib/isso/comments.db";
13+ host = "http://localhost";
14+ };
15+ };
16+ };
17+ };
18+
19+ testScript = let
20+ port = 8080;
21+ in
22+ ''
23+ machine.wait_for_unit("isso.service")
24+
25+ machine.wait_for_open_port("${toString port}")
26+
27+ machine.succeed("curl --fail http://localhost:${toString port}/?uri")
28+ machine.succeed("curl --fail http://localhost:${toString port}/js/embed.min.js")
29+ '';
30+})
pkgs/servers/isso/default.nix+22−3
@@ -1,11 +1,23 @@
1−{ lib, python3Packages, fetchFromGitHub }:
1+{ pkgs, nodejs, lib, python3Packages, fetchFromGitHub }:
2+let
3+ nodeEnv = import ./node-env.nix {
4+ inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
5+ inherit pkgs nodejs;
6+ libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
7+ };
8+ nodePackages = import ./node-packages.nix {
9+ inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
10+ inherit nodeEnv;
11+ };
212
13+ nodeDependencies = (nodePackages.shell.override (old: {
14+ })).nodeDependencies;
15+in
316with python3Packages; buildPythonApplication rec {
417
518 pname = "isso";
619 version = "0.12.5";
720
8− # no tests on PyPI
921 src = fetchFromGitHub {
1022 owner = "posativ";
1123 repo = pname;
@@ -25,8 +37,16 @@ with python3Packages; buildPythonApplication rec {
2537
2638 nativeBuildInputs = [
2739 cffi
40+ nodejs
2841 ];
2942
43+ preBuild = ''
44+ ln -s ${nodeDependencies}/lib/node_modules ./node_modules
45+ export PATH="${nodeDependencies}/bin:$PATH"
46+
47+ make js
48+ '';
49+
3050 checkInputs = [ nose ];
3151
3252 checkPhase = ''
@@ -40,4 +60,3 @@ with python3Packages; buildPythonApplication rec {
4060 maintainers = with maintainers; [ fgaz ];
4161 };
4262}
43−
pkgs/servers/isso/node-env.nixnew file+573
@@ -0,0 +1,573 @@
1+# This file originates from node2nix
2+
3+{lib, stdenv, nodejs, python2, pkgs, libtool, runCommand, writeTextFile}:
4+
5+let
6+ # Workaround to cope with utillinux in Nixpkgs 20.09 and util-linux in Nixpkgs master
7+ utillinux = if pkgs ? utillinux then pkgs.utillinux else pkgs.util-linux;
8+
9+ python = if nodejs ? python then nodejs.python else python2;
10+
11+ # Create a tar wrapper that filters all the 'Ignoring unknown extended header keyword' noise
12+ tarWrapper = runCommand "tarWrapper" {} ''
13+ mkdir -p $out/bin
14+
15+ cat > $out/bin/tar <<EOF
16+ #! ${stdenv.shell} -e
17+ $(type -p tar) "\$@" --warning=no-unknown-keyword --delay-directory-restore
18+ EOF
19+
20+ chmod +x $out/bin/tar
21+ '';
22+
23+ # Function that generates a TGZ file from a NPM project
24+ buildNodeSourceDist =
25+ { name, version, src, ... }:
26+
27+ stdenv.mkDerivation {
28+ name = "node-tarball-${name}-${version}";
29+ inherit src;
30+ buildInputs = [ nodejs ];
31+ buildPhase = ''
32+ export HOME=$TMPDIR
33+ tgzFile=$(npm pack | tail -n 1) # Hooks to the pack command will add output (https://docs.npmjs.com/misc/scripts)
34+ '';
35+ installPhase = ''
36+ mkdir -p $out/tarballs
37+ mv $tgzFile $out/tarballs
38+ mkdir -p $out/nix-support
39+ echo "file source-dist $out/tarballs/$tgzFile" >> $out/nix-support/hydra-build-products
40+ '';
41+ };
42+
43+ includeDependencies = {dependencies}:
44+ lib.optionalString (dependencies != [])
45+ (lib.concatMapStrings (dependency:
46+ ''
47+ # Bundle the dependencies of the package
48+ mkdir -p node_modules
49+ cd node_modules
50+
51+ # Only include dependencies if they don't exist. They may also be bundled in the package.
52+ if [ ! -e "${dependency.name}" ]
53+ then
54+ ${composePackage dependency}
55+ fi
56+
57+ cd ..
58+ ''
59+ ) dependencies);
60+
61+ # Recursively composes the dependencies of a package
62+ composePackage = { name, packageName, src, dependencies ? [], ... }@args:
63+ builtins.addErrorContext "while evaluating node package '${packageName}'" ''
64+ DIR=$(pwd)
65+ cd $TMPDIR
66+
67+ unpackFile ${src}
68+
69+ # Make the base dir in which the target dependency resides first
70+ mkdir -p "$(dirname "$DIR/${packageName}")"
71+
72+ if [ -f "${src}" ]
73+ then
74+ # Figure out what directory has been unpacked
75+ packageDir="$(find . -maxdepth 1 -type d | tail -1)"
76+
77+ # Restore write permissions to make building work
78+ find "$packageDir" -type d -exec chmod u+x {} \;
79+ chmod -R u+w "$packageDir"
80+
81+ # Move the extracted tarball into the output folder
82+ mv "$packageDir" "$DIR/${packageName}"
83+ elif [ -d "${src}" ]
84+ then
85+ # Get a stripped name (without hash) of the source directory.
86+ # On old nixpkgs it's already set internally.
87+ if [ -z "$strippedName" ]
88+ then
89+ strippedName="$(stripHash ${src})"
90+ fi
91+
92+ # Restore write permissions to make building work
93+ chmod -R u+w "$strippedName"
94+
95+ # Move the extracted directory into the output folder
96+ mv "$strippedName" "$DIR/${packageName}"
97+ fi
98+
99+ # Unset the stripped name to not confuse the next unpack step
100+ unset strippedName
101+
102+ # Include the dependencies of the package
103+ cd "$DIR/${packageName}"
104+ ${includeDependencies { inherit dependencies; }}
105+ cd ..
106+ ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
107+ '';
108+
109+ pinpointDependencies = {dependencies, production}:
110+ let
111+ pinpointDependenciesFromPackageJSON = writeTextFile {
112+ name = "pinpointDependencies.js";
113+ text = ''
114+ var fs = require('fs');
115+ var path = require('path');
116+
117+ function resolveDependencyVersion(location, name) {
118+ if(location == process.env['NIX_STORE']) {
119+ return null;
120+ } else {
121+ var dependencyPackageJSON = path.join(location, "node_modules", name, "package.json");
122+
123+ if(fs.existsSync(dependencyPackageJSON)) {
124+ var dependencyPackageObj = JSON.parse(fs.readFileSync(dependencyPackageJSON));
125+
126+ if(dependencyPackageObj.name == name) {
127+ return dependencyPackageObj.version;
128+ }
129+ } else {
130+ return resolveDependencyVersion(path.resolve(location, ".."), name);
131+ }
132+ }
133+ }
134+
135+ function replaceDependencies(dependencies) {
136+ if(typeof dependencies == "object" && dependencies !== null) {
137+ for(var dependency in dependencies) {
138+ var resolvedVersion = resolveDependencyVersion(process.cwd(), dependency);
139+
140+ if(resolvedVersion === null) {
141+ process.stderr.write("WARNING: cannot pinpoint dependency: "+dependency+", context: "+process.cwd()+"\n");
142+ } else {
143+ dependencies[dependency] = resolvedVersion;
144+ }
145+ }
146+ }
147+ }
148+
149+ /* Read the package.json configuration */
150+ var packageObj = JSON.parse(fs.readFileSync('./package.json'));
151+
152+ /* Pinpoint all dependencies */
153+ replaceDependencies(packageObj.dependencies);
154+ if(process.argv[2] == "development") {
155+ replaceDependencies(packageObj.devDependencies);
156+ }
157+ replaceDependencies(packageObj.optionalDependencies);
158+
159+ /* Write the fixed package.json file */
160+ fs.writeFileSync("package.json", JSON.stringify(packageObj, null, 2));
161+ '';
162+ };
163+ in
164+ ''
165+ node ${pinpointDependenciesFromPackageJSON} ${if production then "production" else "development"}
166+
167+ ${lib.optionalString (dependencies != [])
168+ ''
169+ if [ -d node_modules ]
170+ then
171+ cd node_modules
172+ ${lib.concatMapStrings (dependency: pinpointDependenciesOfPackage dependency) dependencies}
173+ cd ..
174+ fi
175+ ''}
176+ '';
177+
178+ # Recursively traverses all dependencies of a package and pinpoints all
179+ # dependencies in the package.json file to the versions that are actually
180+ # being used.
181+
182+ pinpointDependenciesOfPackage = { packageName, dependencies ? [], production ? true, ... }@args:
183+ ''
184+ if [ -d "${packageName}" ]
185+ then
186+ cd "${packageName}"
187+ ${pinpointDependencies { inherit dependencies production; }}
188+ cd ..
189+ ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
190+ fi
191+ '';
192+
193+ # Extract the Node.js source code which is used to compile packages with
194+ # native bindings
195+ nodeSources = runCommand "node-sources" {} ''
196+ tar --no-same-owner --no-same-permissions -xf ${nodejs.src}
197+ mv node-* $out
198+ '';
199+
200+ # Script that adds _integrity fields to all package.json files to prevent NPM from consulting the cache (that is empty)
201+ addIntegrityFieldsScript = writeTextFile {
202+ name = "addintegrityfields.js";
203+ text = ''
204+ var fs = require('fs');
205+ var path = require('path');
206+
207+ function augmentDependencies(baseDir, dependencies) {
208+ for(var dependencyName in dependencies) {
209+ var dependency = dependencies[dependencyName];
210+
211+ // Open package.json and augment metadata fields
212+ var packageJSONDir = path.join(baseDir, "node_modules", dependencyName);
213+ var packageJSONPath = path.join(packageJSONDir, "package.json");
214+
215+ if(fs.existsSync(packageJSONPath)) { // Only augment packages that exist. Sometimes we may have production installs in which development dependencies can be ignored
216+ console.log("Adding metadata fields to: "+packageJSONPath);
217+ var packageObj = JSON.parse(fs.readFileSync(packageJSONPath));
218+
219+ if(dependency.integrity) {
220+ packageObj["_integrity"] = dependency.integrity;
221+ } else {
222+ packageObj["_integrity"] = "sha1-000000000000000000000000000="; // When no _integrity string has been provided (e.g. by Git dependencies), add a dummy one. It does not seem to harm and it bypasses downloads.
223+ }
224+
225+ if(dependency.resolved) {
226+ packageObj["_resolved"] = dependency.resolved; // Adopt the resolved property if one has been provided
227+ } else {
228+ packageObj["_resolved"] = dependency.version; // Set the resolved version to the version identifier. This prevents NPM from cloning Git repositories.
229+ }
230+
231+ if(dependency.from !== undefined) { // Adopt from property if one has been provided
232+ packageObj["_from"] = dependency.from;
233+ }
234+
235+ fs.writeFileSync(packageJSONPath, JSON.stringify(packageObj, null, 2));
236+ }
237+
238+ // Augment transitive dependencies
239+ if(dependency.dependencies !== undefined) {
240+ augmentDependencies(packageJSONDir, dependency.dependencies);
241+ }
242+ }
243+ }
244+
245+ if(fs.existsSync("./package-lock.json")) {
246+ var packageLock = JSON.parse(fs.readFileSync("./package-lock.json"));
247+
248+ if(![1, 2].includes(packageLock.lockfileVersion)) {
249+ process.stderr.write("Sorry, I only understand lock file versions 1 and 2!\n");
250+ process.exit(1);
251+ }
252+
253+ if(packageLock.dependencies !== undefined) {
254+ augmentDependencies(".", packageLock.dependencies);
255+ }
256+ }
257+ '';
258+ };
259+
260+ # Reconstructs a package-lock file from the node_modules/ folder structure and package.json files with dummy sha1 hashes
261+ reconstructPackageLock = writeTextFile {
262+ name = "addintegrityfields.js";
263+ text = ''
264+ var fs = require('fs');
265+ var path = require('path');
266+
267+ var packageObj = JSON.parse(fs.readFileSync("package.json"));
268+
269+ var lockObj = {
270+ name: packageObj.name,
271+ version: packageObj.version,
272+ lockfileVersion: 1,
273+ requires: true,
274+ dependencies: {}
275+ };
276+
277+ function augmentPackageJSON(filePath, dependencies) {
278+ var packageJSON = path.join(filePath, "package.json");
279+ if(fs.existsSync(packageJSON)) {
280+ var packageObj = JSON.parse(fs.readFileSync(packageJSON));
281+ dependencies[packageObj.name] = {
282+ version: packageObj.version,
283+ integrity: "sha1-000000000000000000000000000=",
284+ dependencies: {}
285+ };
286+ processDependencies(path.join(filePath, "node_modules"), dependencies[packageObj.name].dependencies);
287+ }
288+ }
289+
290+ function processDependencies(dir, dependencies) {
291+ if(fs.existsSync(dir)) {
292+ var files = fs.readdirSync(dir);
293+
294+ files.forEach(function(entry) {
295+ var filePath = path.join(dir, entry);
296+ var stats = fs.statSync(filePath);
297+
298+ if(stats.isDirectory()) {
299+ if(entry.substr(0, 1) == "@") {
300+ // When we encounter a namespace folder, augment all packages belonging to the scope
301+ var pkgFiles = fs.readdirSync(filePath);
302+
303+ pkgFiles.forEach(function(entry) {
304+ if(stats.isDirectory()) {
305+ var pkgFilePath = path.join(filePath, entry);
306+ augmentPackageJSON(pkgFilePath, dependencies);
307+ }
308+ });
309+ } else {
310+ augmentPackageJSON(filePath, dependencies);
311+ }
312+ }
313+ });
314+ }
315+ }
316+
317+ processDependencies("node_modules", lockObj.dependencies);
318+
319+ fs.writeFileSync("package-lock.json", JSON.stringify(lockObj, null, 2));
320+ '';
321+ };
322+
323+ prepareAndInvokeNPM = {packageName, bypassCache, reconstructLock, npmFlags, production}:
324+ let
325+ forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com";
326+ in
327+ ''
328+ # Pinpoint the versions of all dependencies to the ones that are actually being used
329+ echo "pinpointing versions of dependencies..."
330+ source $pinpointDependenciesScriptPath
331+
332+ # Patch the shebangs of the bundled modules to prevent them from
333+ # calling executables outside the Nix store as much as possible
334+ patchShebangs .
335+
336+ # Deploy the Node.js package by running npm install. Since the
337+ # dependencies have been provided already by ourselves, it should not
338+ # attempt to install them again, which is good, because we want to make
339+ # it Nix's responsibility. If it needs to install any dependencies
340+ # anyway (e.g. because the dependency parameters are
341+ # incomplete/incorrect), it fails.
342+ #
343+ # The other responsibilities of NPM are kept -- version checks, build
344+ # steps, postprocessing etc.
345+
346+ export HOME=$TMPDIR
347+ cd "${packageName}"
348+ runHook preRebuild
349+
350+ ${lib.optionalString bypassCache ''
351+ ${lib.optionalString reconstructLock ''
352+ if [ -f package-lock.json ]
353+ then
354+ echo "WARNING: Reconstruct lock option enabled, but a lock file already exists!"
355+ echo "This will most likely result in version mismatches! We will remove the lock file and regenerate it!"
356+ rm package-lock.json
357+ else
358+ echo "No package-lock.json file found, reconstructing..."
359+ fi
360+
361+ node ${reconstructPackageLock}
362+ ''}
363+
364+ node ${addIntegrityFieldsScript}
365+ ''}
366+
367+ npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} rebuild
368+
369+ if [ "''${dontNpmInstall-}" != "1" ]
370+ then
371+ # NPM tries to download packages even when they already exist if npm-shrinkwrap is used.
372+ rm -f npm-shrinkwrap.json
373+
374+ npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} install
375+ fi
376+ '';
377+
378+ # Builds and composes an NPM package including all its dependencies
379+ buildNodePackage =
380+ { name
381+ , packageName
382+ , version
383+ , dependencies ? []
384+ , buildInputs ? []
385+ , production ? true
386+ , npmFlags ? ""
387+ , dontNpmInstall ? false
388+ , bypassCache ? false
389+ , reconstructLock ? false
390+ , preRebuild ? ""
391+ , dontStrip ? true
392+ , unpackPhase ? "true"
393+ , buildPhase ? "true"
394+ , meta ? {}
395+ , ... }@args:
396+
397+ let
398+ extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" "meta" ];
399+ in
400+ stdenv.mkDerivation ({
401+ name = "${name}-${version}";
402+ buildInputs = [ tarWrapper python nodejs ]
403+ ++ lib.optional (stdenv.isLinux) utillinux
404+ ++ lib.optional (stdenv.isDarwin) libtool
405+ ++ buildInputs;
406+
407+ inherit nodejs;
408+
409+ inherit dontStrip; # Stripping may fail a build for some package deployments
410+ inherit dontNpmInstall preRebuild unpackPhase buildPhase;
411+
412+ compositionScript = composePackage args;
413+ pinpointDependenciesScript = pinpointDependenciesOfPackage args;
414+
415+ passAsFile = [ "compositionScript" "pinpointDependenciesScript" ];
416+
417+ installPhase = ''
418+ # Create and enter a root node_modules/ folder
419+ mkdir -p $out/lib/node_modules
420+ cd $out/lib/node_modules
421+
422+ # Compose the package and all its dependencies
423+ source $compositionScriptPath
424+
425+ ${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }}
426+
427+ # Create symlink to the deployed executable folder, if applicable
428+ if [ -d "$out/lib/node_modules/.bin" ]
429+ then
430+ ln -s $out/lib/node_modules/.bin $out/bin
431+ fi
432+
433+ # Create symlinks to the deployed manual page folders, if applicable
434+ if [ -d "$out/lib/node_modules/${packageName}/man" ]
435+ then
436+ mkdir -p $out/share
437+ for dir in "$out/lib/node_modules/${packageName}/man/"*
438+ do
439+ mkdir -p $out/share/man/$(basename "$dir")
440+ for page in "$dir"/*
441+ do
442+ ln -s $page $out/share/man/$(basename "$dir")
443+ done
444+ done
445+ fi
446+
447+ # Run post install hook, if provided
448+ runHook postInstall
449+ '';
450+
451+ meta = {
452+ # default to Node.js' platforms
453+ platforms = nodejs.meta.platforms;
454+ } // meta;
455+ } // extraArgs);
456+
457+ # Builds a node environment (a node_modules folder and a set of binaries)
458+ buildNodeDependencies =
459+ { name
460+ , packageName
461+ , version
462+ , src
463+ , dependencies ? []
464+ , buildInputs ? []
465+ , production ? true
466+ , npmFlags ? ""
467+ , dontNpmInstall ? false
468+ , bypassCache ? false
469+ , reconstructLock ? false
470+ , dontStrip ? true
471+ , unpackPhase ? "true"
472+ , buildPhase ? "true"
473+ , ... }@args:
474+
475+ let
476+ extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ];
477+ in
478+ stdenv.mkDerivation ({
479+ name = "node-dependencies-${name}-${version}";
480+
481+ buildInputs = [ tarWrapper python nodejs ]
482+ ++ lib.optional (stdenv.isLinux) utillinux
483+ ++ lib.optional (stdenv.isDarwin) libtool
484+ ++ buildInputs;
485+
486+ inherit dontStrip; # Stripping may fail a build for some package deployments
487+ inherit dontNpmInstall unpackPhase buildPhase;
488+
489+ includeScript = includeDependencies { inherit dependencies; };
490+ pinpointDependenciesScript = pinpointDependenciesOfPackage args;
491+
492+ passAsFile = [ "includeScript" "pinpointDependenciesScript" ];
493+
494+ installPhase = ''
495+ mkdir -p $out/${packageName}
496+ cd $out/${packageName}
497+
498+ source $includeScriptPath
499+
500+ # Create fake package.json to make the npm commands work properly
501+ cp ${src}/package.json .
502+ chmod 644 package.json
503+ ${lib.optionalString bypassCache ''
504+ if [ -f ${src}/package-lock.json ]
505+ then
506+ cp ${src}/package-lock.json .
507+ fi
508+ ''}
509+
510+ # Go to the parent folder to make sure that all packages are pinpointed
511+ cd ..
512+ ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
513+
514+ ${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }}
515+
516+ # Expose the executables that were installed
517+ cd ..
518+ ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
519+
520+ mv ${packageName} lib
521+ ln -s $out/lib/node_modules/.bin $out/bin
522+ '';
523+ } // extraArgs);
524+
525+ # Builds a development shell
526+ buildNodeShell =
527+ { name
528+ , packageName
529+ , version
530+ , src
531+ , dependencies ? []
532+ , buildInputs ? []
533+ , production ? true
534+ , npmFlags ? ""
535+ , dontNpmInstall ? false
536+ , bypassCache ? false
537+ , reconstructLock ? false
538+ , dontStrip ? true
539+ , unpackPhase ? "true"
540+ , buildPhase ? "true"
541+ , ... }@args:
542+
543+ let
544+ nodeDependencies = buildNodeDependencies args;
545+ in
546+ stdenv.mkDerivation {
547+ name = "node-shell-${name}-${version}";
548+
549+ buildInputs = [ python nodejs ] ++ lib.optional (stdenv.isLinux) utillinux ++ buildInputs;
550+ buildCommand = ''
551+ mkdir -p $out/bin
552+ cat > $out/bin/shell <<EOF
553+ #! ${stdenv.shell} -e
554+ $shellHook
555+ exec ${stdenv.shell}
556+ EOF
557+ chmod +x $out/bin/shell
558+ '';
559+
560+ # Provide the dependencies in a development shell through the NODE_PATH environment variable
561+ inherit nodeDependencies;
562+ shellHook = lib.optionalString (dependencies != []) ''
563+ export NODE_PATH=${nodeDependencies}/lib/node_modules
564+ export PATH="${nodeDependencies}/bin:$PATH"
565+ '';
566+ };
567+in
568+{
569+ buildNodeSourceDist = lib.makeOverridable buildNodeSourceDist;
570+ buildNodePackage = lib.makeOverridable buildNodePackage;
571+ buildNodeDependencies = lib.makeOverridable buildNodeDependencies;
572+ buildNodeShell = lib.makeOverridable buildNodeShell;
573+}
pkgs/servers/isso/node-packages.nixnew file+558
@@ -0,0 +1,558 @@
1+# This file has been generated by node2nix 1.9.0. Do not edit!
2+
3+{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:
4+
5+let
6+ sources = {
7+ "acorn-1.2.2" = {
8+ name = "acorn";
9+ packageName = "acorn";
10+ version = "1.2.2";
11+ src = fetchurl {
12+ url = "https://registry.npmjs.org/acorn/-/acorn-1.2.2.tgz";
13+ sha1 = "c8ce27de0acc76d896d2b1fad3df588d9e82f014";
14+ };
15+ };
16+ "acorn-2.7.0" = {
17+ name = "acorn";
18+ packageName = "acorn";
19+ version = "2.7.0";
20+ src = fetchurl {
21+ url = "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz";
22+ sha1 = "ab6e7d9d886aaca8b085bc3312b79a198433f0e7";
23+ };
24+ };
25+ "acorn-globals-1.0.9" = {
26+ name = "acorn-globals";
27+ packageName = "acorn-globals";
28+ version = "1.0.9";
29+ src = fetchurl {
30+ url = "https://registry.npmjs.org/acorn-globals/-/acorn-globals-1.0.9.tgz";
31+ sha1 = "55bb5e98691507b74579d0513413217c380c54cf";
32+ };
33+ };
34+ "align-text-0.1.4" = {
35+ name = "align-text";
36+ packageName = "align-text";
37+ version = "0.1.4";
38+ src = fetchurl {
39+ url = "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz";
40+ sha1 = "0cd90a561093f35d0a99256c22b7069433fad117";
41+ };
42+ };
43+ "almond-0.3.3" = {
44+ name = "almond";
45+ packageName = "almond";
46+ version = "0.3.3";
47+ src = fetchurl {
48+ url = "https://registry.npmjs.org/almond/-/almond-0.3.3.tgz";
49+ sha1 = "a0e7c95ac7624d6417b4494b1e68bff693168a20";
50+ };
51+ };
52+ "amdefine-1.0.1" = {
53+ name = "amdefine";
54+ packageName = "amdefine";
55+ version = "1.0.1";
56+ src = fetchurl {
57+ url = "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz";
58+ sha1 = "4a5282ac164729e93619bcfd3ad151f817ce91f5";
59+ };
60+ };
61+ "asap-1.0.0" = {
62+ name = "asap";
63+ packageName = "asap";
64+ version = "1.0.0";
65+ src = fetchurl {
66+ url = "https://registry.npmjs.org/asap/-/asap-1.0.0.tgz";
67+ sha1 = "b2a45da5fdfa20b0496fc3768cc27c12fa916a7d";
68+ };
69+ };
70+ "camelcase-1.2.1" = {
71+ name = "camelcase";
72+ packageName = "camelcase";
73+ version = "1.2.1";
74+ src = fetchurl {
75+ url = "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz";
76+ sha1 = "9bb5304d2e0b56698b2c758b08a3eaa9daa58a39";
77+ };
78+ };
79+ "center-align-0.1.3" = {
80+ name = "center-align";
81+ packageName = "center-align";
82+ version = "0.1.3";
83+ src = fetchurl {
84+ url = "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz";
85+ sha1 = "aa0d32629b6ee972200411cbd4461c907bc2b7ad";
86+ };
87+ };
88+ "character-parser-1.2.1" = {
89+ name = "character-parser";
90+ packageName = "character-parser";
91+ version = "1.2.1";
92+ src = fetchurl {
93+ url = "https://registry.npmjs.org/character-parser/-/character-parser-1.2.1.tgz";
94+ sha1 = "c0dde4ab182713b919b970959a123ecc1a30fcd6";
95+ };
96+ };
97+ "clean-css-3.4.28" = {
98+ name = "clean-css";
99+ packageName = "clean-css";
100+ version = "3.4.28";
101+ src = fetchurl {
102+ url = "https://registry.npmjs.org/clean-css/-/clean-css-3.4.28.tgz";
103+ sha1 = "bf1945e82fc808f55695e6ddeaec01400efd03ff";
104+ };
105+ };
106+ "cliui-2.1.0" = {
107+ name = "cliui";
108+ packageName = "cliui";
109+ version = "2.1.0";
110+ src = fetchurl {
111+ url = "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz";
112+ sha1 = "4b475760ff80264c762c3a1719032e91c7fea0d1";
113+ };
114+ };
115+ "commander-2.6.0" = {
116+ name = "commander";
117+ packageName = "commander";
118+ version = "2.6.0";
119+ src = fetchurl {
120+ url = "https://registry.npmjs.org/commander/-/commander-2.6.0.tgz";
121+ sha1 = "9df7e52fb2a0cb0fb89058ee80c3104225f37e1d";
122+ };
123+ };
124+ "commander-2.8.1" = {
125+ name = "commander";
126+ packageName = "commander";
127+ version = "2.8.1";
128+ src = fetchurl {
129+ url = "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz";
130+ sha1 = "06be367febfda0c330aa1e2a072d3dc9762425d4";
131+ };
132+ };
133+ "constantinople-3.0.2" = {
134+ name = "constantinople";
135+ packageName = "constantinople";
136+ version = "3.0.2";
137+ src = fetchurl {
138+ url = "https://registry.npmjs.org/constantinople/-/constantinople-3.0.2.tgz";
139+ sha1 = "4b945d9937907bcd98ee575122c3817516544141";
140+ };
141+ };
142+ "css-1.0.8" = {
143+ name = "css";
144+ packageName = "css";
145+ version = "1.0.8";
146+ src = fetchurl {
147+ url = "https://registry.npmjs.org/css/-/css-1.0.8.tgz";
148+ sha1 = "9386811ca82bccc9ee7fb5a732b1e2a317c8a3e7";
149+ };
150+ };
151+ "css-parse-1.0.4" = {
152+ name = "css-parse";
153+ packageName = "css-parse";
154+ version = "1.0.4";
155+ src = fetchurl {
156+ url = "https://registry.npmjs.org/css-parse/-/css-parse-1.0.4.tgz";
157+ sha1 = "38b0503fbf9da9f54e9c1dbda60e145c77117bdd";
158+ };
159+ };
160+ "css-stringify-1.0.5" = {
161+ name = "css-stringify";
162+ packageName = "css-stringify";
163+ version = "1.0.5";
164+ src = fetchurl {
165+ url = "https://registry.npmjs.org/css-stringify/-/css-stringify-1.0.5.tgz";
166+ sha1 = "b0d042946db2953bb9d292900a6cb5f6d0122031";
167+ };
168+ };
169+ "decamelize-1.2.0" = {
170+ name = "decamelize";
171+ packageName = "decamelize";
172+ version = "1.2.0";
173+ src = fetchurl {
174+ url = "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz";
175+ sha1 = "f6534d15148269b20352e7bee26f501f9a191290";
176+ };
177+ };
178+ "graceful-readlink-1.0.1" = {
179+ name = "graceful-readlink";
180+ packageName = "graceful-readlink";
181+ version = "1.0.1";
182+ src = fetchurl {
183+ url = "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz";
184+ sha1 = "4cafad76bc62f02fa039b2f94e9a3dd3a391a725";
185+ };
186+ };
187+ "is-buffer-1.1.6" = {
188+ name = "is-buffer";
189+ packageName = "is-buffer";
190+ version = "1.1.6";
191+ src = fetchurl {
192+ url = "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz";
193+ sha512 = "NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==";
194+ };
195+ };
196+ "is-promise-1.0.1" = {
197+ name = "is-promise";
198+ packageName = "is-promise";
199+ version = "1.0.1";
200+ src = fetchurl {
201+ url = "https://registry.npmjs.org/is-promise/-/is-promise-1.0.1.tgz";
202+ sha1 = "31573761c057e33c2e91aab9e96da08cefbe76e5";
203+ };
204+ };
205+ "is-promise-2.2.2" = {
206+ name = "is-promise";
207+ packageName = "is-promise";
208+ version = "2.2.2";
209+ src = fetchurl {
210+ url = "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz";
211+ sha512 = "+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==";
212+ };
213+ };
214+ "jade-1.11.0" = {
215+ name = "jade";
216+ packageName = "jade";
217+ version = "1.11.0";
218+ src = fetchurl {
219+ url = "https://registry.npmjs.org/jade/-/jade-1.11.0.tgz";
220+ sha1 = "9c80e538c12d3fb95c8d9bb9559fa0cc040405fd";
221+ };
222+ };
223+ "jstransformer-0.0.2" = {
224+ name = "jstransformer";
225+ packageName = "jstransformer";
226+ version = "0.0.2";
227+ src = fetchurl {
228+ url = "https://registry.npmjs.org/jstransformer/-/jstransformer-0.0.2.tgz";
229+ sha1 = "7aae29a903d196cfa0973d885d3e47947ecd76ab";
230+ };
231+ };
232+ "kind-of-3.2.2" = {
233+ name = "kind-of";
234+ packageName = "kind-of";
235+ version = "3.2.2";
236+ src = fetchurl {
237+ url = "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz";
238+ sha1 = "31ea21a734bab9bbb0f32466d893aea51e4a3c64";
239+ };
240+ };
241+ "lazy-cache-1.0.4" = {
242+ name = "lazy-cache";
243+ packageName = "lazy-cache";
244+ version = "1.0.4";
245+ src = fetchurl {
246+ url = "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz";
247+ sha1 = "a1d78fc3a50474cb80845d3b3b6e1da49a446e8e";
248+ };
249+ };
250+ "longest-1.0.1" = {
251+ name = "longest";
252+ packageName = "longest";
253+ version = "1.0.1";
254+ src = fetchurl {
255+ url = "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz";
256+ sha1 = "30a0b2da38f73770e8294a0d22e6625ed77d0097";
257+ };
258+ };
259+ "minimist-1.2.5" = {
260+ name = "minimist";
261+ packageName = "minimist";
262+ version = "1.2.5";
263+ src = fetchurl {
264+ url = "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz";
265+ sha512 = "FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==";
266+ };
267+ };
268+ "mkdirp-0.5.5" = {
269+ name = "mkdirp";
270+ packageName = "mkdirp";
271+ version = "0.5.5";
272+ src = fetchurl {
273+ url = "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz";
274+ sha512 = "NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==";
275+ };
276+ };
277+ "optimist-0.3.7" = {
278+ name = "optimist";
279+ packageName = "optimist";
280+ version = "0.3.7";
281+ src = fetchurl {
282+ url = "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz";
283+ sha1 = "c90941ad59e4273328923074d2cf2e7cbc6ec0d9";
284+ };
285+ };
286+ "promise-2.0.0" = {
287+ name = "promise";
288+ packageName = "promise";
289+ version = "2.0.0";
290+ src = fetchurl {
291+ url = "https://registry.npmjs.org/promise/-/promise-2.0.0.tgz";
292+ sha1 = "46648aa9d605af5d2e70c3024bf59436da02b80e";
293+ };
294+ };
295+ "promise-6.1.0" = {
296+ name = "promise";
297+ packageName = "promise";
298+ version = "6.1.0";
299+ src = fetchurl {
300+ url = "https://registry.npmjs.org/promise/-/promise-6.1.0.tgz";
301+ sha1 = "2ce729f6b94b45c26891ad0602c5c90e04c6eef6";
302+ };
303+ };
304+ "repeat-string-1.6.1" = {
305+ name = "repeat-string";
306+ packageName = "repeat-string";
307+ version = "1.6.1";
308+ src = fetchurl {
309+ url = "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz";
310+ sha1 = "8dcae470e1c88abc2d600fff4a776286da75e637";
311+ };
312+ };
313+ "requirejs-2.3.6" = {
314+ name = "requirejs";
315+ packageName = "requirejs";
316+ version = "2.3.6";
317+ src = fetchurl {
318+ url = "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz";
319+ sha512 = "ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==";
320+ };
321+ };
322+ "requirejs-text-2.0.16" = {
323+ name = "requirejs-text";
324+ packageName = "requirejs-text";
325+ version = "2.0.16";
326+ src = fetchurl {
327+ url = "https://registry.npmjs.org/requirejs-text/-/requirejs-text-2.0.16.tgz";
328+ sha512 = "XrzjeTb1pwzIWmkz8qnUiM20gENgiwB+66IciNuziwlaPAJsYQsQPSYyQ1kD4tGKGZxTisIfDbOHk02DpI/76Q==";
329+ };
330+ };
331+ "right-align-0.1.3" = {
332+ name = "right-align";
333+ packageName = "right-align";
334+ version = "0.1.3";
335+ src = fetchurl {
336+ url = "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz";
337+ sha1 = "61339b722fe6a3515689210d24e14c96148613ef";
338+ };
339+ };
340+ "source-map-0.1.43" = {
341+ name = "source-map";
342+ packageName = "source-map";
343+ version = "0.1.43";
344+ src = fetchurl {
345+ url = "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz";
346+ sha1 = "c24bc146ca517c1471f5dacbe2571b2b7f9e3346";
347+ };
348+ };
349+ "source-map-0.4.4" = {
350+ name = "source-map";
351+ packageName = "source-map";
352+ version = "0.4.4";
353+ src = fetchurl {
354+ url = "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz";
355+ sha1 = "eba4f5da9c0dc999de68032d8b4f76173652036b";
356+ };
357+ };
358+ "source-map-0.5.7" = {
359+ name = "source-map";
360+ packageName = "source-map";
361+ version = "0.5.7";
362+ src = fetchurl {
363+ url = "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz";
364+ sha1 = "8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc";
365+ };
366+ };
367+ "transformers-2.1.0" = {
368+ name = "transformers";
369+ packageName = "transformers";
370+ version = "2.1.0";
371+ src = fetchurl {
372+ url = "https://registry.npmjs.org/transformers/-/transformers-2.1.0.tgz";
373+ sha1 = "5d23cb35561dd85dc67fb8482309b47d53cce9a7";
374+ };
375+ };
376+ "uglify-js-2.2.5" = {
377+ name = "uglify-js";
378+ packageName = "uglify-js";
379+ version = "2.2.5";
380+ src = fetchurl {
381+ url = "https://registry.npmjs.org/uglify-js/-/uglify-js-2.2.5.tgz";
382+ sha1 = "a6e02a70d839792b9780488b7b8b184c095c99c7";
383+ };
384+ };
385+ "uglify-js-2.8.29" = {
386+ name = "uglify-js";
387+ packageName = "uglify-js";
388+ version = "2.8.29";
389+ src = fetchurl {
390+ url = "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz";
391+ sha1 = "29c5733148057bb4e1f75df35b7a9cb72e6a59dd";
392+ };
393+ };
394+ "uglify-to-browserify-1.0.2" = {
395+ name = "uglify-to-browserify";
396+ packageName = "uglify-to-browserify";
397+ version = "1.0.2";
398+ src = fetchurl {
399+ url = "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz";
400+ sha1 = "6e0924d6bda6b5afe349e39a6d632850a0f882b7";
401+ };
402+ };
403+ "void-elements-2.0.1" = {
404+ name = "void-elements";
405+ packageName = "void-elements";
406+ version = "2.0.1";
407+ src = fetchurl {
408+ url = "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz";
409+ sha1 = "c066afb582bb1cb4128d60ea92392e94d5e9dbec";
410+ };
411+ };
412+ "window-size-0.1.0" = {
413+ name = "window-size";
414+ packageName = "window-size";
415+ version = "0.1.0";
416+ src = fetchurl {
417+ url = "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz";
418+ sha1 = "5438cd2ea93b202efa3a19fe8887aee7c94f9c9d";
419+ };
420+ };
421+ "with-4.0.3" = {
422+ name = "with";
423+ packageName = "with";
424+ version = "4.0.3";
425+ src = fetchurl {
426+ url = "https://registry.npmjs.org/with/-/with-4.0.3.tgz";
427+ sha1 = "eefd154e9e79d2c8d3417b647a8f14d9fecce14e";
428+ };
429+ };
430+ "wordwrap-0.0.2" = {
431+ name = "wordwrap";
432+ packageName = "wordwrap";
433+ version = "0.0.2";
434+ src = fetchurl {
435+ url = "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz";
436+ sha1 = "b79669bb42ecb409f83d583cad52ca17eaa1643f";
437+ };
438+ };
439+ "wordwrap-0.0.3" = {
440+ name = "wordwrap";
441+ packageName = "wordwrap";
442+ version = "0.0.3";
443+ src = fetchurl {
444+ url = "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz";
445+ sha1 = "a3d5da6cd5c0bc0008d37234bbaf1bed63059107";
446+ };
447+ };
448+ "yargs-3.10.0" = {
449+ name = "yargs";
450+ packageName = "yargs";
451+ version = "3.10.0";
452+ src = fetchurl {
453+ url = "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz";
454+ sha1 = "f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1";
455+ };
456+ };
457+ };
458+ args = {
459+ name = "isso";
460+ packageName = "isso";
461+ version = "latest";
462+ src = ./.;
463+ dependencies = [
464+ sources."acorn-2.7.0"
465+ sources."acorn-globals-1.0.9"
466+ sources."align-text-0.1.4"
467+ sources."almond-0.3.3"
468+ sources."amdefine-1.0.1"
469+ sources."asap-1.0.0"
470+ sources."camelcase-1.2.1"
471+ sources."center-align-0.1.3"
472+ sources."character-parser-1.2.1"
473+ (sources."clean-css-3.4.28" // {
474+ dependencies = [
475+ sources."commander-2.8.1"
476+ ];
477+ })
478+ (sources."cliui-2.1.0" // {
479+ dependencies = [
480+ sources."wordwrap-0.0.2"
481+ ];
482+ })
483+ sources."commander-2.6.0"
484+ sources."constantinople-3.0.2"
485+ sources."css-1.0.8"
486+ sources."css-parse-1.0.4"
487+ sources."css-stringify-1.0.5"
488+ sources."decamelize-1.2.0"
489+ sources."graceful-readlink-1.0.1"
490+ sources."is-buffer-1.1.6"
491+ sources."is-promise-2.2.2"
492+ sources."jade-1.11.0"
493+ sources."jstransformer-0.0.2"
494+ sources."kind-of-3.2.2"
495+ sources."lazy-cache-1.0.4"
496+ sources."longest-1.0.1"
497+ sources."minimist-1.2.5"
498+ sources."mkdirp-0.5.5"
499+ sources."optimist-0.3.7"
500+ sources."promise-6.1.0"
501+ sources."repeat-string-1.6.1"
502+ sources."requirejs-2.3.6"
503+ sources."requirejs-text-2.0.16"
504+ sources."right-align-0.1.3"
505+ sources."source-map-0.4.4"
506+ (sources."transformers-2.1.0" // {
507+ dependencies = [
508+ sources."is-promise-1.0.1"
509+ sources."promise-2.0.0"
510+ sources."source-map-0.1.43"
511+ sources."uglify-js-2.2.5"
512+ ];
513+ })
514+ (sources."uglify-js-2.8.29" // {
515+ dependencies = [
516+ sources."source-map-0.5.7"
517+ ];
518+ })
519+ sources."uglify-to-browserify-1.0.2"
520+ sources."void-elements-2.0.1"
521+ sources."window-size-0.1.0"
522+ (sources."with-4.0.3" // {
523+ dependencies = [
524+ sources."acorn-1.2.2"
525+ ];
526+ })
527+ sources."wordwrap-0.0.3"
528+ sources."yargs-3.10.0"
529+ ];
530+ buildInputs = globalBuildInputs;
531+ meta = {
532+ description = "lightweight Disquis alternative";
533+ license = "MIT";
534+ };
535+ production = false;
536+ bypassCache = true;
537+ reconstructLock = true;
538+ };
539+in
540+{
541+ args = args;
542+ sources = sources;
543+ tarball = nodeEnv.buildNodeSourceDist args;
544+ package = nodeEnv.buildNodePackage args;
545+ shell = nodeEnv.buildNodeShell args;
546+ nodeDependencies = nodeEnv.buildNodeDependencies (lib.overrideExisting args {
547+ src = stdenv.mkDerivation {
548+ name = args.name + "-package-json";
549+ src = nix-gitignore.gitignoreSourcePure [
550+ "*"
551+ "!package.json"
552+ "!package-lock.json"
553+ ] args.src;
554+ dontBuild = true;
555+ installPhase = "mkdir -p $out; cp -r ./* $out;";
556+ };
557+ });
558+}
pkgs/servers/isso/package.jsonnew file+15
@@ -0,0 +1,15 @@
1+{
2+ "name": "isso",
3+ "version": "latest",
4+ "author": "Martin Zimmermann",
5+ "description": "lightweight Disquis alternative",
6+ "license": "MIT",
7+ "repository": "github:posativ/isso",
8+ "dependencies": {},
9+ "devDependencies": {
10+ "almond": "^0.3.3",
11+ "jade": "^1.5.0",
12+ "requirejs": "^2.3.6",
13+ "requirejs-text": "^2.0.15"
14+ }
15+}