ArdanaLabs / dUSD

5 stars 3 forks source link

`offchain-ctl` Nix Clean Up #196

Closed epiro-ps closed 2 years ago

epiro-ps commented 2 years ago

We've been adding a lot of nix changes lately to off-chain-ctl and are finding opportunities to clean up and refactor. The purpose of this issue is to audit the nix code and fix up anything that looks like it could be improved. The branch for this task should be based off of https://github.com/ArdanaLabs/dUSD/pull/164.

An example clean up is suggested here: https://github.com/ArdanaLabs/dUSD/pull/164#discussion_r911435865

yusdacra commented 2 years ago

Working on this. I noticed that treefmt.toml doesn't contain a formatter for Nix files (there is one that uses nixpkgs-fmt but it's commented), I think it would be great to introduce https://github.com/kamadorueda/alejandra here to have consistency across the Nix files.

epiro-ps commented 2 years ago

I am all for this.

@marijanp any qualms with introducing this formatter?

marijanp commented 2 years ago

DO IT! It would be nice to automate the formatter application https://github.com/cachix/pre-commit-hooks.nix

Geometer1729 commented 2 years ago

I think we decided against pre-commit-hooks at one point. I don't remember why and don't feel strongly myself, but I figured I should mention it.

Also fourmolu doesn't seem to be respecting fourmolu.yaml for some reason.

toastal commented 2 years ago

@MatthewCroughan Have any thoughts on pre-commit hooks???