So I used my free time this morning to finally take the first 7 nix pills.
This was finally enough to really understand the basics of nix and how it manages software and not just blindly editing lines inside some text files.
With https://github.com/svanderburg/node2nix/pull/78 closed I started from a clean slate (not needing the forked node2nix) with this as my nixpkglist.json (as described in node2nix readme)
cat > nixpkglist.json << EOF
[
"git-ssb",
"patchbay",
"scuttlebot"
]
EOF
cat > nixpkglist-supplement.json <<EOF
[
"node-gyp-build"
]
EOF
node2nix -8 -i nixpkglist.json --supplement-input nixpkglist-supplement.json
I also want patchfoo in there but for that I need to add --registry http://some.registry
to the node2nix
call. And the version I have on another host gave me the integrity error. I will update it once I can bootstrap a sbot with this. I also did not dare to test node@10 yet, might try later once this works.
With the generated expressions and resolved packages at hand, I tried to install the three packages. I attached them largely for historical purposes.
nix-env -f default.nix -iA scuttlebot
seemd to work (installed something) but gives me this error when running sbot server
:
scuttlebot 11.3.0 /home/cryptix/.ssb logging.level:notice
my key ID: p13zSAiOpguI9nsawkGijsnMfWmFd5rlUNpzekEE+vI=.ed25519
/nix/store/57mfqpar90p9jhs8fck1pzmsq01c71lq-node-scuttlebot-11.3.0/lib/node_modules/scuttlebot/node_modules/levelup/lib/levelup.js:76
throw error
^
InitializationError: Must provide a location for the database
at new LevelUP (/nix/store/57mfqpar90p9jhs8fck1pzmsq01c71lq-node-scuttlebot-11.3.0/lib/node_modules/scuttlebot/node_modules/levelup/lib/levelup.js:69:13)
at LevelUP (/nix/store/57mfqpar90p9jhs8fck1pzmsq01c71lq-node-scuttlebot-11.3.0/lib/node_modules/scuttlebot/node_modules/levelup/lib/levelup.js:46:12)
at Level (/nix/store/57mfqpar90p9jhs8fck1pzmsq01c71lq-node-scuttlebot-11.3.0/lib/node_modules/scuttlebot/node_modules/level-packager/level-packager.js:13:12)
at module.exports (/nix/store/57mfqpar90p9jhs8fck1pzmsq01c71lq-node-scuttlebot-11.3.0/lib/node_modules/scuttlebot/node_modules/secure-scuttlebutt/create.js:10:14)
at Object.init (/nix/store/57mfqpar90p9jhs8fck1pzmsq01c71lq-node-scuttlebot-11.3.0/lib/node_modules/scuttlebot/index.js:48:15)
at /nix/store/57mfqpar90p9jhs8fck1pzmsq01c71lq-node-scuttlebot-11.3.0/lib/node_modules/scuttlebot/node_modules/secret-stack/api.js:38:28
at Array.forEach (<anonymous>)
at create (/nix/store/57mfqpar90p9jhs8fck1pzmsq01c71lq-node-scuttlebot-11.3.0/lib/node_modules/scuttlebot/node_modules/secret-stack/api.js:37:20)
at Object.<anonymous> (/nix/store/57mfqpar90p9jhs8fck1pzmsq01c71lq-node-scuttlebot-11.3.0/lib/node_modules/scuttlebot/bin.js:61:16)
at Module._compile (module.js:652:30)
nix-env -f default.nix -iA git-ssb
also installed something but I couldn't use it really. git ssb web
starts but leaves me with a undefined
user and an endless blocking git ssb named ..
... :-/
Patchbay errored out during building it's level and leveldown deps
nix-env -f default.nix -iA patchbay
[...] # download snip
> level@3.0.1 postinstall /nix/store/z5qf3dw2bh1zm4cdgl9akj0py1m1z8pl-node-patchbay-7.13.0/lib/node_modules/patchbay/node_modules/scuttlebot/node_modules/level
> opencollective postinstall || exit 0
sh: opencollective: command not found
> leveldown@3.0.2 install /nix/store/z5qf3dw2bh1zm4cdgl9akj0py1m1z8pl-node-patchbay-7.13.0/lib/node_modules/patchbay/node_modules/scuttlebot/node_modules/leveldown
> prebuild-install || node-gyp rebuild
sh: prebuild-install: command not found
make: Entering directory '/nix/store/z5qf3dw2bh1zm4cdgl9akj0py1m1z8pl-node-patchbay-7.13.0/lib/node_modules/patchbay/node_modules/scuttlebot/node_modules/leveldown/build'
[ ... ] # CXX build snip
make: *** [leveldown.target.mk:113: Release/obj.target/leveldown/src/batch.o] Error 1
make: Leaving directory '/nix/store/z5qf3dw2bh1zm4cdgl9akj0py1m1z8pl-node-patchbay-7.13.0/lib/node_modules/patchbay/node_modules/scuttlebot/node_modules/leveldown/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/nix/store/nsv34vfz4ygd06ws8kz04flf7mlv2bsf-nodejs-8.11.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.14.38
gyp ERR! command "/nix/store/nsv34vfz4ygd06ws8kz04flf7mlv2bsf-nodejs-8.11.1/bin/node" "/nix/store/nsv34vfz4ygd06ws8kz04flf7mlv2bsf-nodejs-8.11.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /nix/store/z5qf3dw2bh1zm4cdgl9akj0py1m1z8pl-node-patchbay-7.13.0/lib/node_modules/patchbay/node_modules/scuttlebot/node_modules/leveldown
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! leveldown@3.0.2 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the leveldown@3.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /build/.npm/_logs/2018-05-21T14_46_45_844Z-debug.log
builder for '/nix/store/4r7d9rkk4lh4cd5zm429jrx15h7a1ddw-node-patchbay-7.13.0.drv' failed with exit code 1
which also happened during sbots build but I just didn't notice it.. bad npm!...
I'll now try to cycle back through clakes ssb4nix to find a hint of what to try next. Maybe an older sbot? but the version in patchbay@7 also errored out.. :-/
Trying Next: adding opencollective as supplement and tools like make to build level..
I'd much prefer to have these as inputs to this derivation, just like electron could/should be a dep, not prebuild binary fetched..