flake/dev: make treefmt-nix optional

as this isn't used by consumers, they should be able to remove this
input via `inputs.nixvim.inputs.treefmt-nix.follows = ""`
This commit is contained in:
seth 2024-07-07 15:23:09 -04:00
parent 432a513ccd
commit 5feeb4eef8
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86

View file

@ -1,9 +1,9 @@
{ lib, inputs, ... }:
{
imports = [
inputs.treefmt-nix.flakeModule
./devshell.nix
] ++ lib.optional (inputs.git-hooks ? flakeModule) inputs.git-hooks.flakeModule;
imports =
[ ./devshell.nix ]
++ lib.optional (inputs.git-hooks ? flakeModule) inputs.git-hooks.flakeModule
++ lib.optional (inputs.treefmt-nix ? flakeModule) inputs.treefmt-nix.flakeModule;
perSystem =
{
@ -15,7 +15,7 @@
let
fmt = pkgs.nixfmt-rfc-style;
in
{
lib.optionalAttrs (inputs.treefmt-nix ? flakeModule) {
treefmt.config = {
projectRootFile = "flake.nix";