-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
draupnir: init at 2.0.0-beta.6 #342893
base: master
Are you sure you want to change the base?
draupnir: init at 2.0.0-beta.6 #342893
Conversation
|
||
# TODO: move to preNpmRebuild | ||
preBuild = '' | ||
rm -r node_modules/better-sqlite3/{build,deps/common.gypi,deps/sqlite3.gyp,deps/sqlite3} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Remove things we know we don't need that just increase closure size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that still needed for sqlite?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the removed files are all only used by the better-sqlite3
package to build it's own vendored sqlite. better-sqlite3-dynamic-link.patch
replaces that with just linking against the nixpkgs sqlite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
nativeBuildInputs = [ pkg-config ]; | ||
buildInputs = [ sqlite ]; | ||
|
||
# TODO: move to preNpmRebuild |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure yet if I'd like to do this in this PR (would decrease build time by a bit), but we'll see after it gets tested.
uses across an entire homeserver. | ||
''; | ||
license = licenses.afl3; | ||
maintainers = with maintainers; [ winter ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TheArcaneBrony Do let me know if you'd like to be added as a maintainer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, sounds good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC vendored package-lock.json was why the Draupnir package was rewritten from scratch
Using this package directly with the mjolnir module isn't quite drop-in because the mjolnir module doesn't have a
The mjolnir default config is compatible with draupnir, so we ended up just doing systemd.services.mjolnir.serviceConfig.ExecStart = lib.mkForce ''${pkgs.draupnir}/bin/draupnir --draupnir-config ./config/default.yaml''; With this hack, we're running the package on @scd31's infrastructure. It appears to be working so far. Will see if anything breaks and come back with more details. |
Thank you! |
I may try to write a proper NixOS test for this some time this weekend for the hell of it. |
nvm this looks suspiciously not possible. but maybe it can still be done by other means?? |
we could but i think it'd be way too fragile dependency tree resolving wise (e.g. yarn may produce a diff. tree that npm would need to call out to the internet to fix etc.) |
ideally we could convince npm to just accept that it got a different solution than it would have dreamt up itself, but yeah it is a little sketchy. relatable problems with dealing with flakes so i get it. just wish there was a better way somehow. |
dynamic drvs will save us all :( |
Worst case you can use the draupnir module from my package and specify the |
Description of changes
This supersedes the package portion of #274052, as discussed in Matrix, by packaging Draupnir in a way that is:
mkYarnPackage
, thus requires slightly less work, like no manual wrapping being required).However, this has the caveat that it requires a vendored
package-lock.json
. Sorry!This needs testers! I'm not sure if I can just drop in the Mjölnir module and test it or not, though I guess someone can just test it with the module from #274052.
Thanks to @TheArcaneBrony for creating the original PRs and the module, which will continue to be worked on in that PR.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.