Repository navigation
Labels
3.skill: sprintableA larger issue which is split into distinct actionable tasks5.scope: trackingLong-lived issue tracking long-term fixes or multiple sub-problems6.topic: nodejsNode.js is a free, open-source, cross-platform JavaScript runtime environment
Description
After #318015 will be Now that #318015 is merged, we should start deprecate the usage of mkYarnPackage, because it is too complex, and hard to maintain. It also requires to vendor into Nixpkgs a package.json file for each such package (to avoid IFD, see #296856 ).
I'm opening this issue before #318015 is ready / merged to refer to this issue in a small documentation I will perform there.
The following list was generated with:
env NIXPKGS_ALLOW_INSECURE=1 nix eval --json -L --impure --expr '
let
pkgs = (builtins.getFlake "github:nixos/nixpkgs").legacyPackages.${builtins.currentSystem};
in builtins.map (pPath: let
p = builtins.baseNameOf (builtins.dirOf pPath);
in if builtins.hasAttr p pkgs then
if builtins.hasAttr "maintainers" pkgs.${p}.meta then
"- [ ] `${p}`: ${builtins.concatStringsSep " " (builtins.map (m: "@${m.github}") pkgs.${p}.meta.maintainers)}"
else
"- [ ] `${p}`: no maintainers found"
else
"- [ ] `${p}`: did not found attribute automatically, file is `${pPath}`"
) [
'"$(git grep -l mkYarnPackage pkgs | while read p; do echo \"$p\"; done)"'
]' | jq --raw-output '.[]'-
xplorer: @dit7ya -
kuro: @LostAttractor -
zammad: @n0emis @Radvendii @NetaliDev -
powerdns-admin: @Flakebi @zhaofengli -
micropad: @rhysmdnz -
auto-changelog: @pyrox0 -
codefresh: @takac -
diagnostic-languageserver: @pyrox0 -
dotenv-cli: @pyrox0 -
element-call: @kilimnik -
get-graphql-schema: @pyrox0 -
gramma: @pyrox0 -
koodo-reader: @TomaSajt -
listmonk: @RaitoBezarius -
postlight-parser: @viraptor -
spectral-language-server: @momeemt -
treedome: @tengkuizdihar -
typst-preview: @berberman -
vim-language-server: @doronbehar -
your_spotify: @PatrickDaG -
your_spotify: @PatrickDaG -
zitadel: -
devpod: @maxbrunet -
yaml-language-server: -
prettierd: @NotAShelf @n3oney -
react-static: -
apache-airflow: @bhipple @gbpdt @ingenieroariel -
button-card: did not found attribute automatically, file ispkgs/servers/home-assistant/custom-lovelace-modules/button-card/default.nix -
multiple-entity-row: did not found attribute automatically, file ispkgs/servers/home-assistant/custom-lovelace-modules/multiple-entity-row/default.nix -
zigbee2mqtt-networkmap: did not found attribute automatically, file ispkgs/servers/home-assistant/custom-lovelace-modules/zigbee2mqtt-networkmap/default.nix -
pomerium: @lukegb @devusb -
jellyseerr: @camillemndn -
matrix-appservice-discord: @pacien matrix-appservice-discord: rewrite using yarn{Config,Build}Hooks #493048 -
matrix-appservice-slack: @beardhatcode @chvp -
matrix-hookshot: @chvp -
mjolnir: @jojosch -
grafana-image-renderer: @Ma27 -
lemmy: did not found attribute automatically, file ispkgs/servers/web-apps/lemmy/ui.nix -
meshcentral: @Ma27 ,meshcentral: cleanup #460508meshcentral: rewrite with buildNpmPackage #493026 -
pgadmin: @gador -
synapse-admin: @mkg20001 @Ma27 -
asar: @xvapx -
near-cli: @Ekleog -
v2raya: @LostAttractor -
draupnir -
awk-language-server -
sharedown(no maintainers) sharedown: switch to buildNpmPackage #493097 -
vimPlugins.markdown-preview-nvimvimPlugins.markdown-preview-nvim: use yarnConfigHook #493064
Reacted by OTABI Tomoya, Tengku Izdihar, Ievgen Pyrogov and Cathal
Metadata
Metadata
Assignees
Labels
3.skill: sprintableA larger issue which is split into distinct actionable tasks5.scope: trackingLong-lived issue tracking long-term fixes or multiple sub-problems6.topic: nodejsNode.js is a free, open-source, cross-platform JavaScript runtime environment
Projects
- StatusShow more project fieldsDone
Activity
gador commentedon Jul 3, 2024
Is there a form of migration guide to use the new hooks?
I am using some scripted hacks to get the upstream yarn file, which also needs to be converted to the older v1 file to be used in nixpkgs. There are some dirty hacks involved, specific to
pgadmin4, which would have to be used in the main derivation and not in the seperateupdate.shscript which right now will commit the fixed and ready to useyarn.lockfile.(https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/admin/pgadmin/update.sh#L8-L16)
Also
mkYarnModulesdid not work forpgadmin4which needed special treatment to build the frontend and also uses theyarn webpacker. (https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/admin/pgadmin/default.nix#L110-L122)Is there a way to not use the newly introduced hooks? Is this even desired? Or will I have to find some way to run my specially crafted
update.shandpreBuildyarn magic with the hooks?doronbehar commentedon Jul 3, 2024
Thanks for willing to cooperate @gador . Indeed this can become complex... The new hooks I added indeed usually makes things a bit simpler, but in such a complex case as you describe, you will have to play with it yourself, and there is no migration guide. However, there are many migration examples in #318015 .
The non-trivial update scripts were discussed a bit in #318015 . I believe that with the new hooks you should be able to reach a point where you don't vendor any file (neither
yarn.lockorpackage.json), and you should also be able to update your package withnix-updatewhich is capable of updating the hash of theofflineCacheby itself.gador commentedon Jul 3, 2024
Thanks for all your work @doronbehar !
I looked through your examples. AFAI can see I could rely on my update script and build script as it is now and not use the newly introduced hooks and everything should continue to work fine. I don't use
mkYarnPackageanyway. However I will look into it if there is a way to use the hooks and maybe get rid of the packagedyarn.lockfile in the future!lelgenio commentedon Jul 19, 2024
I think we'll also need a yarnInstallHook: #328544
pyrox0 commentedon Aug 14, 2024
koodoo-reader,listmonk,spectral-language-server, andtreedomewere all migrated in #318015Further,
typst-previewcan be removed from the list, as it was removed in #325275.tengkuizdihar commentedon Aug 14, 2024
thank you for migrating my package, sorry I didn't help in the migration
gcoremans commentedon Nov 10, 2024
Do yarnConfigHook and yarnBuildHook support yarn v2 and up lockfiles?
lelgenio commentedon Nov 10, 2024
No, they rely on the same
fetchYarnDepsthat was used bymkYarnPackage.Here's an issue about that: #254369
nyabinary commentedon Apr 29, 2025
#341884 Devpod is here
RossComputerGuy commentedon May 1, 2025
#403356 for mjolnir
goyalyashpal commentedon May 28, 2025
nixos-discourse commentedon Jun 20, 2025
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/trouble-packaging-mkyarnpackage-missing-dependencies-a-lot-of-warnings/65866/4
14 remaining items
matrix-appservice-discord: rewrite using yarn{Config,Build}Hooks
zammad: remove yarn2nix from passthru.updateScript derivation
awk-language-server: move to `yarn*Hook`s and stdenv.mkDerivation
zammad: remove yarn2nix from passthru.updateScript derivation
meshcentral: rewrite with buildNpmPackage
meshcentral: rewrite with buildNpmPackage
meshcentral: rewrite with buildNpmPackage
meshcentral: rewrite with buildNpmPackage
meshcentral: rewrite with buildNpmPackage
meshcentral: rewrite with buildNpmPackage
meshcentral: rewrite with buildNpmPackage