Skip to content
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

WIP: Create a working flake.nix #9952

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

WIP: Create a working flake.nix #9952

wants to merge 4 commits into from

Conversation

srid
Copy link

@srid srid commented Jul 4, 2024

  • Bootstrap flake.nix based on haskell-flake, overriding dependencies
  • nix build to work
  • devShell (nix develop) to work
  • HLS to work
  • Upstream skylighting Nix
  • How should Nix package deal with cabal flags?

srid added 4 commits July 4, 2024 19:32
The (limited) haskell-flake parser expects the first line to be just "packages:"
Also ignore Nix and direnv things in gitignore
`nix-shell` will basically now be an alias for `nix develop`
@srid
Copy link
Author

srid commented Jul 4, 2024

Got all the dependencies building, as well as the pandoc sources to build, but the installPhase is failing:

$ nix build -L
...
pandoc> Running phase: installPhase
pandoc> Installing internal library xml-light in /nix/store/6hj2lf84wl10hqmymp8xz9m772g6hdw6-pandoc-3.2.1/lib/ghc-9.6.5/lib/aarch64-osx-ghc-9.6.5/pandoc-3.2.1-5gNPAzSbfOpCcG9wr5Jih8-xml-light
pandoc> Installing library in /nix/store/6hj2lf84wl10hqmymp8xz9m772g6hdw6-pandoc-3.2.1/lib/ghc-9.6.5/lib/aarch64-osx-ghc-9.6.5/pandoc-3.2.1-Cyanjkwa9raImcHGQJDkHy
pandoc> mv: missing destination file operand after '/nix/store/6hj2lf84wl10hqmymp8xz9m772g6hdw6-pandoc-3.2.1/share/man/man1/'
pandoc> Try 'mv --help' for more information.
pandoc> /nix/store/ashgigyp2dkvfi1spyl9nsnirvbk67vh-stdenv-darwin/setup: line 140: pop_var_context: head of shell_variables not a function context

@alerque
Copy link
Contributor

alerque commented Jul 23, 2024

This feel closer to the goal than where it started, but without a working installPhase even nix run isn't usable on the flake. It looks like the trouble is with moving the man page to the right destination. Where is that command coming from?

@srid
Copy link
Author

srid commented Jul 23, 2024

It is probably something to do with this:

-- data-files:
extra-source-files:
man/pandoc.1
man/pandoc-lua.1
man/pandoc-server.1

And how https://github.com/NixOS/cabal2nix (which haskell-flake, via nixpkgs, uses) handles it.

@alerque
Copy link
Contributor

alerque commented Jul 23, 2024

Perhaps use one of the early (postUnpack?) stages to patch that out of the sources and see what happens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants