Skip to content

Commit 63cc3c4

Browse files
authored
feat: Port the tool to Rust while keeping the existing implementation (#17)
* feat: Add devenv configuration for Rust project Initialize Devenv configuration for the Rust project, including: - `.envrc` for direnv integration. - `.gitignore` for Devenv and related files. - `devenv.lock` for locking input dependencies. - `devenv.nix` to enable Rust language support and set environment variables. - `devenv.yaml` to define Devenv inputs and secretspec configuration. - `secretspec.toml` to define project secrets. - Update the root `secretspec.toml` to include the development profile for the Rust project. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:1.798355375s ExecutionTime:1.814192458s} * feat: Add basic rust project structure This commit initializes a new Rust project with the following changes: - Added a `.gitignore` file to exclude build artifacts and local development configurations. - Created `Cargo.lock` and `Cargo.toml` files to manage project dependencies and metadata. - Added a minimal `main.rs` file with a "Hello, world!" function. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:1.648558125s ExecutionTime:1.664979458s} * feat: Add OpenAI-compatible API client Introduces an initial client for interacting with OpenAI-compatible APIs, specifically targeting Gemini's endpoint. Configures `reqwest`, `tokio`, `anyhow`, and `serde` for API requests and response handling. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash ResponseTime:6.514066542s ExecutionTime:6.529697667s} * feat: Add chat completion functionality This commit introduces the `create_chat_completion` method to the `OpenAIClient` struct, enabling the client to send chat completion requests. The method now accepts a `Foo` struct as a parameter, which will be serialized into the request body. The `Foo` struct and its nested `Choice` struct have been defined to represent the structure of the request payload. The `main` function has been updated to call the new `create_chat_completion` method with an instance of `Foo`. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:1.695582667s ExecutionTime:1.71103625s} * refactor: Update structs for chat completion API Updated the `Completion` and `Choice` structs to correctly reflect the structure expected by the chat completion API. Also renamed the `Foo` struct to `Chat` to better represent its purpose. Added a `Message` struct to handle the nested structure within `Choice`. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:1.687067541s ExecutionTime:1.7018995s} * feat: Add chat completion functionality - Define Chat and ChatMessage structs for chat completion requests. - Implement `create_chat_completion` method in OpenAIClient. - Update `main` function to use the new chat completion functionality. - Add Gemini API key environment variable loading. - Modify `OpenAIClient::build` to accept base_url before token. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:1.678606375s ExecutionTime:1.693654292s} * feat: Add Gemini integration for commit message generation Integrates Gemini API to generate commit messages based on staged git diff. - Add `log` dependency for improved logging capabilities. - Update `Cargo.toml` and `Cargo.lock` to include the new dependency. - Modify `main.rs` to: - Fetch the staged git diff using `git diff --cached`. - Construct a chat completion request to the Gemini API. - Use a more specific Gemini model (`gemini-2.5-flash-lite`). - Print the generated commit message content. - Adjust API endpoint URL for clarity. - Make struct fields public where necessary for serialization/deserialization. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:1.967163917s ExecutionTime:1.983286333s} * refactor: Make struct fields private The struct fields were public when they did not need to be. Making them private improves encapsulation. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:807.657917ms ExecutionTime:821.622583ms} * refactor: Rename Message to ChoiceMessage and add role field The `Message` struct was renamed to `ChoiceMessage` to better reflect its usage within the `Choice` struct. A `role` field was added to `ChoiceMessage` to differentiate between different message roles, specifically for filtering assistant messages in the main function. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:1.5132025s ExecutionTime:1.527390708s} * feat: add git diff analysis and gemini integration This commit introduces the integration of Git diff analysis with the Gemini API. The changes include: - Retrieving the cached Git diff using `git diff --cached`. - Sending the diff content to the Gemini API for processing. - Displaying the generated response from the Gemini API. - Added necessary imports for `std::env`. - Updated error handling for message retrieval. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:1.484356667s ExecutionTime:1.500370833s} * refactor: Switch to blocking reqwest client and remove unused dependencies The `reqwest` client has been switched from asynchronous to blocking to simplify the code and remove the need for `tokio`. The `log` dependency was also removed as it was no longer used. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:1.249735042s ExecutionTime:1.265960208s} * ci: update rust overlay and channel Adds rust-overlay to the inputs and sets the rust channel to stable. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:1.30176825s ExecutionTime:1.319224709s} * feat: Add timing to measure response and execution time This commit introduces timing mechanisms to measure the duration of API responses and the overall execution time of the program. - **Response Time Measurement**: A `Instant` is used to capture the time before and after the `create_chat_completion` call, allowing for precise measurement of how long the API call takes. - **Execution Time Measurement**: Another `Instant` is used at the beginning and end of the `main` function to calculate the total execution time of the program. - **Output**: Both measured times are printed to the console for analysis. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:1.713551375s ExecutionTime:1.72909625s} * feat: Add trace and duration structs for timing and serialization This commit introduces the `Trace` and `TraceDuration` structs to capture and serialize performance metrics for API calls. Key changes include: - Added `serde_json` dependency to `Cargo.toml` and `Cargo.lock`. - Implemented `Serialize` for `Trace` and `TraceDuration` to allow JSON serialization. - Modified `main.rs` to: - Measure execution and response times using `Instant`. - Serialize trace information including model name, response time, and execution time. - Append the serialized trace information to the generated commit message. - Write the commit message to a file if a filename argument is provided, otherwise print to stdout. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:2.040582375s ExecutionTime:2.056008459s} * refactor: Wrap Trace in TraceWrapper for serialization This commit introduces a `TraceWrapper` struct to encapsulate the `Trace` struct. This change modifies the serialization logic to include the `Trace` struct under the key "auto-commit-msg" within the serialized output. This allows for a more structured and potentially extensible way to include trace information in the commit message. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:1.95217025s ExecutionTime:1.968310541s} * feat: Add rust implementation for auto-commit-msg - Introduce a new Rust implementation for auto-commit-msg. - Configure the flake to build and expose the Rust binary. - Update the default package to point to the new Rust implementation. - Fix a placeholder error message in the Rust code. auto-commit-msg{Version:0.4.0-dev Model:gemini-2.5-flash-lite ResponseTime:1.61042675s ExecutionTime:1.625084042s} * fix: update auto-commit-msg hook to use correct package The `auto-commit-msg` hook was incorrectly referencing `./default.nix`. This commit updates it to point to the correct `./rust/default.nix` package. --- {"auto-commit-msg":{"model":"gemini-2.5-flash-lite","response_time":1.4488205,"execution_time":1.463233333}} * feat: add toml configuration and gemini support The commit introduces the ability to configure the tool using a `.auto-commit-msg.toml` file. This allows for customization of the Gemini API base URL, API key, and the short model used for generating commit messages. Additionally, the commit adds support for the Gemini API as a provider for generating commit messages. The tool now reads configuration from the TOML file to specify the Gemini API details. The `toml` crate has been added as a dependency to handle TOML parsing. Trace information, including response and execution times, is now conditionally included based on the `trace` setting in the configuration file. --- {"auto-commit-msg":{"model":"gemini-2.5-flash-lite","response_time":2.000485334,"execution_time":2.014071583}} * feat: Add configuration file support This commit introduces support for a `.auto-commit-msg.toml` configuration file. The configuration file allows users to customize various aspects of the tool's behavior, including: - `trace`: Enable or disable trace logging. - `provider`: Configure the language model provider, including its base URL and API key. - `diff`: Specify the model to use for generating short commit messages. Default values are provided for all configuration options if the file is not present or if specific options are missing. This ensures backward compatibility and a smooth transition for existing users. --- {"auto-commit-msg":{"model":"gemini-2.5-flash-lite","response_time":1.935330584,"execution_time":1.9495163340000001}} * refactor: Improve variable scoping in main function The `main` function has been refactored to improve variable scoping. The `provider` and `model` variables are now declared and assigned earlier, reducing the need for repeated access to `config.provider` and `config.diff.short_model`. This change also introduces TODO comments for potential future improvements, such as avoiding the use of `.clone()` on the `model` variable. --- {"auto-commit-msg":{"model":"gemini-2.5-flash-lite","response_time":1.2777031669999999,"execution_time":1.294729875}} * feat: Add language field to Trace and commit message The `language` field has been added to the `Trace` struct and is now included in the commit message generation. This allows for better tracking and identification of the language used in traces. --- {"auto-commit-msg":{"model":"gemini-2.5-flash-lite","response_time":1.518691167,"execution_time":1.532768}} * feat: refactor flake.nix to simplify package definitions This commit refactors the `flake.nix` file to simplify the package definitions. The `auto-commit-msg` package is now the default, and the `rust` package is defined separately. This change improves the organization and maintainability of the flake. --- {"auto-commit-msg":{"model":"gemini-2.5-flash-lite","response_time":1.454091042,"execution_time":1.4677864999999999}} * build(rust): Filter src for rust package This commit filters the source directory for the rust package to only include necessary files. This improves build times and reduces the size of the resulting package. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.323544625,"execution_time":1.334184917}} * feat: Add logging and config for diff models This commit introduces the `log` crate for logging and enhances the configuration options for diff generation. Key changes: - Added `log` as a dependency in `Cargo.toml` and `Cargo.lock`. - Implemented `Default` trait for `ProviderConfig` and `DiffConfig` structs to simplify configuration loading. - Introduced `long_model` and `threshold` fields to `DiffConfig`. - Added logic to select between `short_model` and `long_model` based on the diff size and the configured `threshold`. - Added `info!` logging when the long model is used. - Removed unnecessary `.clone()` calls for `model`. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.761495083,"execution_time":1.774834}} * feat: Add regex dependency and use it to determine git diff model This commit introduces the `regex` crate as a dependency and utilizes it to parse the output of `git diff --cached --shortstat`. This allows the program to dynamically select between short and long models based on the number of insertions and deletions in the cached diff. The `git diff --cached` command was also updated to use `args` for better readability. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.272532708,"execution_time":1.293021709}} * feat: Add logging and configure OpenAI model based on changes Integrates `env_logger` for logging and sets up the OpenAI model selection logic. The model is now chosen based on the number of changes compared to a configurable threshold. Logs the selected model and the number of changes. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.62356725,"execution_time":1.646503375}} * feat: Add check for empty git diff This commit adds a check to ensure that `git diff --cached` is not empty before proceeding. If the diff is empty, a `bail!` error is returned with the message "`git diff --cached` is empty". This prevents potential issues or unexpected behavior when no changes are staged for commit. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.327100209,"execution_time":1.347855375}} * fix: improve error message and add todo comment The error message when `git diff --cached` is empty has been updated to be more descriptive. A TODO comment has been added to remind the developer to fix the regex for parsing the git diff statistics. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":0.966037167,"execution_time":0.986599959}} * fix: Improve diff parsing and logging The previous regex for parsing diff statistics was incorrect and could lead to errors. This commit refactors the regex to correctly capture insertions and deletions independently. Additionally, the logging message has been updated for clarity. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.67797225,"execution_time":1.704895166}} * refactor: Improve commit message generation logic This commit refactors the commit message generation logic to handle tracing information more effectively. It introduces a `config.trace` flag to conditionally include tracing details. Key changes include: - Renaming the `foo` variable to `duration` for better clarity. - Separating the commit message content from the tracing information. - Conditionally appending tracing details to the commit message file or printing them to the console based on the `config.trace` flag. - Adding explicit error handling for cases where `response_time` is expected but not found. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.670024875,"execution_time":1.690569042}} * feat: improve commit message generation and tracing This commit refactors the commit message generation process to handle both file output and stdout more gracefully. It also enhances the tracing functionality by allowing users to enable it via configuration and provides more accurate timing information. Key changes include: - Introduced `std::io::Write` to abstract over file and stdout writing. - Made `execution_duration` optional and conditional based on the `trace` config. - Added error handling for missing response time and execution duration in trace data. - Ensured that trace information is appended correctly when writing to a file or stdout. - Improved the clarity of variable names and removed unnecessary clones. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.6341527500000002,"execution_time":1.6640204170000001}} * fix: reorder trace info push in commit message The trace information is currently appended *after* the horizontal rule. This commit moves the horizontal rule append *before* the trace information, ensuring the trace information is correctly formatted within the commit message. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.352746625,"execution_time":1.376621125}} * feat: add write permission to commit message file Ensure that the commit message file has write permission enabled when opened. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.133999541,"execution_time":1.159417375}} * build: update nix dependencies --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.180521084,"execution_time":1.198849334}} * refactor: simplify trace duration serialization The `TraceDuration` struct and its `Serialize` implementation have been removed. The `response_time` and `execution_time` fields in the `Trace` struct now directly store `f64` values representing seconds, simplifying the serialization process. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.217100708,"execution_time":1.24075025}} * feat: Add clap for argument parsing This commit introduces the `clap` crate to handle command-line arguments, specifically for specifying the configuration file path. The `Args` struct is defined to parse arguments, and the default configuration file name is now configurable via a command-line flag. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.286821125,"execution_time":1.311766625}} * fix: Add TODOs for response and execution time precision Adds comments to the `Trace` struct indicating that the `response_time` and `execution_time` fields should be truncated to two decimal places. This is a reminder for future work to improve the precision of these metrics. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.257042166,"execution_time":1.280027542}} * feat: Add option to specify commit message file The commit message can now be written to a file specified by the user. This allows for more control over the commit message output. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.462450333,"execution_time":1.484237}} * refactor: Simplify execution duration tracking The `execution_duration` is now initialized at the beginning of the `main` function, removing the need for conditional initialization and `Option` handling. This streamlines the code and makes the duration tracking more straightforward. The `trace` configuration option is no longer directly involved in the timing logic, as the duration is always measured. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.5289844160000001,"execution_time":1.5522350839999999}} * feat: Truncate response and execution times in trace to 2 decimals The response and execution times in the trace output are now truncated to two decimal places. This improves the readability of the trace information. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.432887042,"execution_time":1.4565451249999999}} * fix: Remove unused variable from git stats parsing The `insertions` variable was declared but never used before being reassigned. This commit removes the unused variable declaration to clean up the code. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.03,"execution_time":1.05}} * ci: build with nix packages This commit modifies the build workflow to build specific nix packages using a matrix strategy. This allows for building both the default package and the rust package separately. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.3,"execution_time":1.32}} * fix(ci): Remove unnecessary period in nix build command --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.39,"execution_time":1.41}} * feat: add pkg-config to nativeBuildInputs The pkg-config dependency was missing, which is required for compiling C dependencies. This commit adds it to the nativeBuildInputs. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.39,"execution_time":1.41}} * ci: add macos build and remove pkg-config The build workflow now includes macOS builds by specifying a matrix for the `os` key. The `pkg-config` dependency has been removed from `rust/default.nix` as it's no longer needed. The `openssl` dependency has been added instead. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.56,"execution_time":1.58}} * feat: add version flag to rust binary The version flag will be used to display the version of the rust binary. This will be useful for debugging and for tracking the version of the binary that is being used. Also, the CI will now test the version flag. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.43,"execution_time":1.46}} * build: disable template job and add pkg-config The template job in the GitHub Actions workflow was disabled as it was not being used. In the rust package definition, `pkg-config` was moved from `buildInputs` to `nativeBuildInputs`, and `openssl` was moved from `nativeBuildInputs` to `buildInputs`. This change reflects the correct usage of these build dependencies in the Nix build system. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.4,"execution_time":1.42}} * build: enable fail-fast and include default package --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.28,"execution_time":1.31}} * fix(ci): Remove unused template job from build workflow --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.0,"execution_time":1.03}} * feat: add trace functionality to auto-commit-msg This commit introduces a new feature that allows users to trace the execution of the auto-commit-msg tool. The trace information includes the model used, response time, and execution time. This information is appended to the commit message in a JSON format. The `TraceInfo` struct has been updated to include `Language`, `Model`, `ResponseTime`, and `ExecutionTime`. A new `TraceWrapper` struct has been added to encapsulate the trace information. The trace information is now marshaled into JSON format before being appended to the commit message. The `cobra.CheckErr` function has been used to handle potential errors during JSON marshaling. The response and execution times are now rounded to two decimal places. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.75,"execution_time":1.78}} * refactor: Rename TraceInfo to Trace Renames the `TraceInfo` struct to `Trace` for better clarity and consistency. This change is purely a refactoring effort and does not alter the functionality of the code. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.19,"execution_time":1.22}} * feat: Add version to trace data Adds the version of the application to the trace data. This will allow for better tracking and debugging of issues across different versions. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":0.76,"execution_time":0.79}} * feat: Add version to trace information Adds the `version` field to the `Trace` struct and populates it with the current package version using `env!("CARGO_PKG_VERSION")`. This allows for tracking the version of the application that generated the trace data. --- {"auto-commit-msg":{"language":"rust","model":"gemini-2.5-flash-lite","response_time":1.43,"execution_time":1.47}}
1 parent 101792e commit 63cc3c4

16 files changed

Lines changed: 2394 additions & 26 deletions

.github/workflows/build.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ concurrency:
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-latest
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os:
15+
- macos-latest
16+
- ubuntu-latest
17+
package:
18+
- default
19+
- rust
20+
fail-fast: true
1221
steps:
1322
- uses: actions/checkout@v5
1423
- uses: cachix/install-nix-action@v31
@@ -17,7 +26,8 @@ jobs:
1726
name: sestrella
1827
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
1928
skipPush: ${{ github.ref_name != 'main' }}
20-
- run: nix build
29+
- run: nix build .#${{ matrix.package }}
30+
- run: nix run .#${{ matrix.package }} -- --version
2131

2232
template:
2333
runs-on: ubuntu-latest

cmd/root.go

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package cmd
22

33
import (
4+
"encoding/json"
45
"fmt"
56
"log"
7+
"math"
68
"os"
79
"os/exec"
810
"regexp"
@@ -32,11 +34,16 @@ type DiffConfig struct {
3234
Threshold int `mapstructure:"threshold"`
3335
}
3436

35-
type TraceInfo struct {
36-
Version string
37-
Model string
38-
ResponseTime time.Duration
39-
ExecutionTime time.Duration
37+
type Trace struct {
38+
Language string `json:"language"`
39+
Model string `json:"model"`
40+
Version string `json:"version"`
41+
ResponseTime float64 `json:"response_time"`
42+
ExecutionTime float64 `json:"execution_time"`
43+
}
44+
45+
type TraceWrapper struct {
46+
Trace Trace `json:"auto-commit-msg"`
4047
}
4148

4249
var configFile string
@@ -161,12 +168,21 @@ var rootCmd = &cobra.Command{
161168
commitMsg := res.Choices[0].Message.Content
162169
if config.Trace {
163170
executionDuration := time.Since(executionTime)
164-
commitMsg = fmt.Sprintf("%s\n\nauto-commit-msg%+v", commitMsg, TraceInfo{
165-
Version: strings.TrimSpace(cmd.Version),
171+
trace := Trace{
172+
Language: "go",
166173
Model: model,
167-
ResponseTime: responseDuration,
168-
ExecutionTime: executionDuration,
169-
})
174+
Version: strings.TrimSpace(cmd.Version),
175+
ResponseTime: math.Round(responseDuration.Seconds()*100) / 100,
176+
ExecutionTime: math.Round(executionDuration.Seconds()*100) / 100,
177+
}
178+
traceWrapper := TraceWrapper{Trace: trace}
179+
180+
traceJSON, err := json.Marshal(traceWrapper)
181+
if err != nil {
182+
cobra.CheckErr(err)
183+
}
184+
185+
commitMsg = fmt.Sprintf("%s\n---\n%s", commitMsg, traceJSON)
170186
}
171187

172188
if commitMsgFile == "" {

devenv.lock

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"devenv": {
44
"locked": {
55
"dir": "src/modules",
6-
"lastModified": 1758758270,
6+
"lastModified": 1762537545,
77
"owner": "cachix",
88
"repo": "devenv",
9-
"rev": "bcd30a9f7f70375a684c29c019e5a5c224c10718",
9+
"rev": "45f9f5b334c7224b32214324686cda87a9c07889",
1010
"type": "github"
1111
},
1212
"original": {
@@ -19,10 +19,10 @@
1919
"flake-compat": {
2020
"flake": false,
2121
"locked": {
22-
"lastModified": 1747046372,
22+
"lastModified": 1761588595,
2323
"owner": "edolstra",
2424
"repo": "flake-compat",
25-
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
25+
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
2626
"type": "github"
2727
},
2828
"original": {
@@ -57,10 +57,10 @@
5757
]
5858
},
5959
"locked": {
60-
"lastModified": 1758108966,
60+
"lastModified": 1762441963,
6161
"owner": "cachix",
6262
"repo": "git-hooks.nix",
63-
"rev": "54df955a695a84cd47d4a43e08e1feaf90b1fd9b",
63+
"rev": "8e7576e79b88c16d7ee3bbd112c8d90070832885",
6464
"type": "github"
6565
},
6666
"original": {
@@ -95,10 +95,10 @@
9595
"nixpkgs": "nixpkgs"
9696
},
9797
"locked": {
98-
"lastModified": 1756047880,
98+
"lastModified": 1759991118,
9999
"owner": "nix-community",
100100
"repo": "gomod2nix",
101-
"rev": "47d628dc3b506bd28632e47280c6b89d3496909d",
101+
"rev": "7f8d7438f5870eb167abaf2c39eea3d2302019d1",
102102
"type": "github"
103103
},
104104
"original": {
@@ -123,10 +123,10 @@
123123
},
124124
"nixpkgs": {
125125
"locked": {
126-
"lastModified": 1758776601,
126+
"lastModified": 1762572687,
127127
"owner": "NixOS",
128128
"repo": "nixpkgs",
129-
"rev": "cf13c81c3b5d022311c98a41a35f6270d45edfc4",
129+
"rev": "5082a6ff9afb880bec2d1e915d5614f07a2aaf0a",
130130
"type": "github"
131131
},
132132
"original": {
@@ -138,10 +138,10 @@
138138
},
139139
"nixpkgs_2": {
140140
"locked": {
141-
"lastModified": 1758532697,
141+
"lastModified": 1761313199,
142142
"owner": "cachix",
143143
"repo": "devenv-nixpkgs",
144-
"rev": "207a4cb0e1253c7658c6736becc6eb9cace1f25f",
144+
"rev": "d1c30452ebecfc55185ae6d1c983c09da0c274ff",
145145
"type": "github"
146146
},
147147
"original": {

devenv.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
git-hooks.hooks.auto-commit-msg = {
2323
enable = true;
24-
entry = lib.getExe (pkgs.callPackage ./default.nix { });
24+
entry = lib.getExe (pkgs.callPackage ./rust/default.nix { });
2525
stages = [ "prepare-commit-msg" ];
2626
verbose = true;
2727
};

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
in
3636
{
3737
default = pkgs.callPackage ./default.nix { };
38+
rust = pkgs.callPackage ./rust/default.nix { };
3839
}
3940
);
4041

rust/.envrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
export DIRENV_WARN_TIMEOUT=20s
4+
5+
eval "$(devenv direnvrc)"
6+
7+
# `use devenv` supports the same options as the `devenv shell` command.
8+
#
9+
# To silence all output, use `--quiet`.
10+
#
11+
# Example usage: use devenv --quiet --impure --option services.postgres.enable:bool true
12+
use devenv

rust/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Devenv
2+
.devenv*
3+
devenv.local.nix
4+
devenv.local.yaml
5+
6+
# direnv
7+
.direnv
8+
9+
# pre-commit
10+
.pre-commit-config.yaml
11+
12+
# Project specific
13+
target/

0 commit comments

Comments
 (0)