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

feature/treefmt - integrate treefmt-nix #1679

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

Conversation

jmuchovej
Copy link

attempting to continue the work from #1317.

@@ -3,11 +3,12 @@
let
__DEVENV_VARS__
in {
treefmt-nix.url = "github:numtide/treefmt-nix";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not add it by default, not many will use it so it should be optional.

@@ -50,6 +50,9 @@ Running ``devenv init`` generates ``devenv.nix``:
# https://devenv.sh/git-hooks/
git-hooks.hooks.shellcheck.enable = true;

# https://devenv.sh/treefmt/
treefmt.programs.nixpkgs-fmt.enable = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, not that important feature to be in the README

@jmuchovej
Copy link
Author

👋 @domenkozar thanks for already taking a peek! 😮
so, i've been trying to emulate the integration of git-hooks and it's been failing. (lol. perhaps due to my noviceness with Nix.)

essentially, in integrations/git-hooks.nix, you access git-hooks via inputs. when i attempt to mimic this behavior, i'm consistently getting an error stating that inputs.treefmt-nix doesn't exist.

git-hooks-module =
inputs.git-hooks
or inputs.pre-commit-hooks
or (throw "git-hooks or pre-commit-hooks input required");

@use-the-fork
Copy link
Contributor

Just so you know, the way this integration needs to be done has changed based on the treefmt package.

I got it working in my own library here:
https://github.com/use-the-fork/snow-blower/blob/main/modules/integrations/treefmt/default.nix

I hope that helps you guys!

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.

3 participants