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
ocamlformat: init at 0.8 #48823
ocamlformat: init at 0.8 #48823
Conversation
FTR about Emacs, I managed to make it work this way:
It's probably not very idomatic Nix, can this be adapted to be useful to everyone? |
I am not an emacs user, but if it become a nix package it could be included like other emacs plugins: https://nixos.org/nixos/manual/index.html#module-services-emacs-adding-packages |
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 just tried with emacs and the following:
(add-to-list 'load-path "~/.nix-profile/share/emacs/site-lisp")
(require 'ocamlformat)
(add-hook 'tuareg-mode-hook (lambda () (add-hook 'before-save-hook 'ocamlformat-before-save)))
This works well after globally installing ocamlformat
. The situation is similar for other tools (merlin, ocp-indent…).
sha256 = "1i7rsbs00p43362yv7z7dw0qsnv7vjf630qk676qvfg7kg422w6j"; | ||
}; | ||
|
||
nativeBuildInputs = [ |
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.
Why native ?
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.
Because the libraries were not found if there were in buildInputs
. I tried to change to nativeBuildInputs
at random.
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 cannot reproduce. Looks suspicious.
Also, the bos
library seems not needed.
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 think I took it from the opam file. But anyways, I can try to reduce the dependencies.
But this does not work in a nix-shell, right? But I suppose this is something that is acceptable. |
It will work in a nix shell provided it is also globally installed ;-) |
I don't even have |
Updated. |
@GrahamcOfBorg build ocamlformat |
Success on aarch64-linux (full log) Attempted: ocamlformat Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: ocamlformat Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: ocamlformat Partial log (click to expand)
|
Motivation for this change
Add
ocamlformat
(supported by Dune 1.4).Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)I tested the result with
dune build @fmt
but not with Emacs because I'm not quite sure how to configure Emacs to use ocamlformat.