nvim-neorg / tree-sitter-norg

A TreeSitter parser for the Neorg File Format
MIT License
99 stars 14 forks source link

Define outputs for each system #39

Closed pschyska closed 1 year ago

pschyska commented 1 year ago

Follow-up from https://github.com/nvim-neorg/nixpkgs-neorg-overlay/issues/1#issuecomment-1266974818.

I realized it basically undoes https://github.com/nvim-neorg/tree-sitter-norg/commit/ed37d4c571104c64e233a319fc366ede75ee56d4. By merging in defaultPackage again, it would remove e.g. defaultPackage.x86_64-linux which is what is blocking me. What was the reasoning for that change? I don't think, in flakes parlance, there can't be a "generic" package as the result is system-dependant.

That said, users shouldn't have too much exposure to the system -- nix build ., nix develop ., etc. should "just work" unless you intend to cross compile, or compile with emulation[^1].

If that's alright, I have corresponding changes for tree-sitter-norg-{meta,table}.

[^1] What I'm doing for aarch64-linux is having the following nixos config...

  boot.binfmt.emulatedSystems = [ "aarch64-linux" ];

...so that I can say:

  $ nix build .#packages.aarch64-linux.tree-sitter-norg
  $ file result/parser
  result/parser: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, stripped
pschyska commented 1 year ago

Thanks for merging! I'll send similar PRs for the other repos, and one optional for the overlay repo with a suggestion of restructuring the vimPlugin.

vhyrro commented 1 year ago

This is really nice! Just a quick FYI you can ignore the table parser as it won't be used anymore :)

pschyska commented 1 year ago

This is really nice! Just a quick FYI you can ignore the table parser as it won't be used anymore :)

Alright, disregard that PR then ;)