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