From a6baea06697f6c76c695dc4198099deb8ba916e0 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 6 Jun 2025 15:45:11 +0200 Subject: feat(treewide): Prepare for first release This commit contains many changes, as they were developed alongside `git-bug-rs` and unfortunately not separately committed. A toplevel summary would include: - Appropriate redirects, - The templating moved to `vy` (as this works with rustfmt formatting), - Search support (via `git-bug-rs`), - And better layout in the link section. --- treefmt.nix | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'treefmt.nix') diff --git a/treefmt.nix b/treefmt.nix index ebe4157..1768b65 100644 --- a/treefmt.nix +++ b/treefmt.nix @@ -11,7 +11,6 @@ { treefmt-nix, pkgs, - rustfmt, }: treefmt-nix.lib.evalModule pkgs ( {pkgs, ...}: { @@ -22,7 +21,6 @@ treefmt-nix.lib.evalModule pkgs ( alejandra.enable = true; rustfmt = { enable = true; - package = rustfmt; edition = "2024"; }; clang-format.enable = true; @@ -76,8 +74,23 @@ treefmt-nix.lib.evalModule pkgs ( clang-format = { options = ["--style" "GNU"]; }; - rustfmt = { - options = ["--config-path" "${./rustfmt.toml}"]; + rustfmt = let + config = builtins.fromTOML (builtins.readFile ./rustfmt_config.toml); + toValue = value: + if builtins.isString value + then value + else if builtins.isInt value + then builtins.toString value + else if builtins.isBool value + then + if value + then "true" + else "false" + else builtins.throw "Unknown value: ${value}"; + options = pkgs.lib.mapAttrsToList (name: value: "--config=${name}=${toValue value}") config; + in { + inherit options; + excludes = ["vendored/*"]; }; shfmt = { includes = ["*.bash"]; -- cgit 1.4.1