From 49273031e4b248399670673955210e43d04b1b45 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Mon, 20 Nov 2023 14:32:37 +0100 Subject: [PATCH] Rust: cargo-release config --- modules/hm/development/rust.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/hm/development/rust.nix b/modules/hm/development/rust.nix index 1101c12..a5140b9 100644 --- a/modules/hm/development/rust.nix +++ b/modules/hm/development/rust.nix @@ -1,8 +1,6 @@ -{ pkgs, lib, config, ... }: { - home.file.".cargo/config".text = '' - [build] - rustc-wrapper = "${pkgs.sccache}/bin/sccache" - ''; +{ pkgs, lib, config, ... }: +let tomlGenerate = (pkgs.formats.toml { }).generate; in +{ home.packages = (builtins.attrValues { inherit (pkgs) bacon cargo cargo-audit cargo-criterion cargo-deadlinks cargo-expand @@ -18,4 +16,14 @@ }) ++ lib.optionals config.programs.helix.enable (builtins.attrValues { inherit (pkgs) lldb rust-analyzer; }) ++ lib.optionals config.programs.kakoune.enable (builtins.attrValues { inherit (pkgs) rust-analyzer; }); + + home.file.".cargo/config".source = tomlGenerate "cargo-config" { + build.rustc-wrapper = "${pkgs.sccache}/bin/sccache"; + }; + + xdg.configFile."cargo-release/release.toml".source = tomlGenerate "release.toml" { + sign-commit = true; + sign-tag = true; + publish = false; + }; }