You are reading content from Scuttlebutt
@cryptix %bXON0NojKlo8v/vkzJLfadwY08o20m/jNUPfTdL82XE=.sha256

re %aBIa4Vh...:

I'm having a falling out with qubes. Maybe I shouldn't be so picky but the rc4 test left quite a scar. Maybe my definition of release candidate is different but that felt more like a beta test and even though some issues are closed it still feels flaky and I don't have time to also be beta-tester for them right now..

Sooo I'm trying nixos on my laptop again. I really like having zfs back since I can use my snapshot based backup system onto my nas again. The qubes backup tarballs were massive... I also like the build environments a lot. It's a much more fine-grained system of what get's installed than the still rather monolithic (or redundant) templates and also without all the VM overhead. Ofc it's a less secure system (I do consider the browser with the same access right to everything as your primary user a high risk) but I consider it a better stop-gap until I a better trial/beta version of subgraph os is released. I'm eager to see how easy it will be to bundle apps with citadel (warning:twitter) but that's still very new and more shiny than promising next week solution.

I will try to get scuttlebot and git-ssb into into nixpkgs and maybe also patchcore friends if it goes smoothly. I'll nag @baldo some more about it for the nix-foo, he made us a nix-shell for tale:net which I was able to copy&pasta and strip a little to make sbot, patchbay and -foo compile. Now I need to compare and cleanup with how the other nodejs packages are built... I'm pretty new and making these pkgs but so far I grok most of the concepts and the manuals for OS and nixpkgs are really good.

@cryptix %1WVo9HuLG8BJMaOf/AdPbdGX6qFDYvwo0nErmJ9Q8Zw=.sha256

cc @musicmatze you were also a heavy #nixos user, right?

@cryptix %bk8X7//l2qP5dxCcnq813186lfr7rHr/TjvI0nfAkBQ=.sha256

Here is the shell.nix I am using for scuttlebot and git-ssb so far. It's basically the one from t:n with all the electron stuff removed.

Next step: exposing/installing the binary helpers (sbot, git-remote-ssb) so I can include them in other shells.

I also have updated the .nix files on my dotcryptix repo. Moving away from one big systemPackages towards more little shells.

User has chosen not to be hosted publicly
@xj9 %FZTbirqF0yEO95z+olUGDQfDYdSSVGjgrWT95cZrBqc=.sha256

@cryptix i think @clacke is also working on ssb/nix things might want to hit him up on IRC

@cryptix %GWsUFvHbbTEPBAjMEPNcBgwk7rxvzdGE+yjMrJdWepw=.sha256

alan: nice! that is a way I intend to use them as well.

xj9: thanks! good to know!

User has not chosen to be hosted publicly
@cryptix %P2DEPhSNmUVA/+UqVa6Oz9+QNYOyX3pbffQfbINfIvo=.sha256

hmm... that dependency bundling problem seems to be quite the hairy mess..

User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
User has chosen not to be hosted publicly
@cel %gqHzOMoRCrVCC4DVU6xPMhIv+xQeYdu1mWN0hRP3JMo=.sha256

Social vicinity should not be strictly necessary to see dependencies for top-level packages published with ssb-npm-registry (as of %O47FRp6...). When a package is published with ssb-npm publish or e.g. npm publish --registry=http://localhost:8043/, the npm-packages message should link, with the dependencyBranch property, recursively, to a set of npm-packages messages containing all needed dependencies for the published package, recursively. ssb-npm-registry should make use of these links when resolving dependencies, so if the dependencies' authors' feeds are not available, the necessary messages are fetched by hash. So a message hash for the top-level package publish should be sufficient to get the dependencies, assuming you have the ssb-ooo plugin and can get the necessary messages via ooo replication.

Usage with ssb-npm-registry:
Insert the URL-encoded message id after the registry base URL. Example:
npm i patchfoo --registry=http://localhost:8043/%25uweCcGdDMrMr7B07OdOHXgWz7dtarAQw5mUIPqJ5KTc%3D.sha256
More info in the readme for ssb-npm-registry, under heading "Message scope": &fMbzp6T...

User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
@cryptix %v5kYmY7wf8r6pSMOBfE2DxblCm691pdEAsGYPG4F0OI=.sha256

That's very interesting, thanks @cel! I feared of running into issue with the git-ssb deps.

Insert the URL-encoded message id after the registry base URL.

the message id is the key of the npm publish for that package (in your example case patchfoo), right?

@clacke: I saw that you posted on gnusocial that you got patchfoo running. Very nice to hear as well!

User has chosen not to be hosted publicly
User has not chosen to be hosted publicly
@cryPhone📱 %2hIwBVEObEplB/Hju7WvfK5KdB7oGCRgD50SX110154=.sha256

Hmm.. interesting. That probably needs an update to npm 5 now that node8 is the LTS?

@cryptix %HXas/EL/N6m05NuvECItmsn5zTN/3N5+PPlQ0tAZBmw=.sha256

Thanks again for that repo @clacke! It was quite educational for me as a nix-novice.

I now have a git-ssb package which I can use across my profile without having to enter nix-shell first. YEY!

Although I wondered why I only have that one pkg.. I thought all of the npm packages in the package.json should make individual packages but I might misunderstood node2nix there..

@cel %o2QMfO9OxQXNE50bVbJKINAAEL0gOfq6B/FItimRw1k=.sha256

@clacke

@cel So is ssb-ooo a mechanism for a blobs-like replication of individual messages?

Yes

Unknown integrity string: sha256-/xm5O/jeBb6n6mvwXSa6RiJirWPVAPX+Eu9bGnF14HM=

I'm not sure what to do about that... I think the string is a valid SSRI string.

but looks like you got it working in %1fxInGT... maybe?

@noffle

ssb-npm's shasum strings are compatible only with npm 5 and up.

It should work with npm < 5, as it detects those versions to give them a sha1 (by fetching the tarball to calculate the shasum on-the-fly, or using the sha1 that newer ssb-npm-registry versions include in the publish message); if not, that is a bug.

@cryptix

the message id is the key of the npm publish for that package (in your example case patchfoo), right?

Yes

User has chosen not to be hosted publicly
@cryptix %qMjAnHn1kz0MCcGBY6t5lDGGpJduqvhjIFlHLQqGYUk=.sha256

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.

i-can-write-derivations.jpg

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..

@cryptix %GfBQyGvlbtskDqZW0wrdZnQNL3gNginynP3LGynN984=.sha256

I just reran the same node2nix using v1.6.0 invocation (see above, after the two cat << EOFs, or the Makefile on the branch below) and they completed and installed an sbot that starts..!!

for git-ssb: the exec $(command node || comamnd nodejs) hashbang trick went passed nixos' path-fixer and only replaced the /bin/sh. So I had to install nodejs in my nix-env (aka user/system-wide). It wouldn't have to if the fixer saw #!/usr/bin/node or similar but I can live with that.

Still fiddling with patchbay... since there it's started with npm start from the repo root, there is no /bin in the resulting derivation.. starting it from the /lib in the drv results in electron: not found.. I think if there was a /bin script with electron as the hashbang it might get patched and just work(TM).. to be continued

I pushed my new attempted to the upstream branch of ssb4nix in %xmIvmWj...

@cryptix %WtUdtTsGo7cuZ5BwX8I2jwZGUeIsQ5hxxUcLbizALCk=.sha256

I managed to make an nixpkgs overlay with some packages that I'm working on. You can think of it like a ubuntu PPA. I'm mostly using this as a testbed before making PRs for the main nixpkgs repo. Once I figured it out totally, I think I should be able to publish it as an ssb-site, also.

@cel %vSgYQngENYGRdwF/dl0Gg8sp9WxEcJTVRVJIP98nZxM=.sha256

@clacke ah, ok, that should supercede the patch in %AgoDQbW... i think. cc @cryptix

Join Scuttlebutt now