Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
description = "Flake for Marmot Development Kit (MDK) Rust project";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
rust = pkgs.rust-bin.stable.latest.default;
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
rust
cargo
openssl
pkg-config
sqlite
just
];
Comment on lines +21 to +28
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove redundant cargo from buildInputs.

The rust-bin.stable.latest.default toolchain from rust-overlay already includes cargo, making the explicit cargo entry on line 23 redundant.

Apply this diff:

         buildInputs = with pkgs; [
           rust
-          cargo
           openssl
           pkg-config
           sqlite
           just
         ];
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
buildInputs = with pkgs; [
rust
cargo
openssl
pkg-config
sqlite
just
];
buildInputs = with pkgs; [
rust
openssl
pkg-config
sqlite
just
];
🤖 Prompt for AI Agents
In flake.nix around lines 21 to 28, the buildInputs list redundantly includes
cargo even though the rust-bin.stable.latest.default toolchain from the
rust-overlay already provides cargo; remove the explicit cargo entry from the
buildInputs array (leave rust, openssl, pkg-config, sqlite, just) so the list no
longer contains cargo.


shellHook = ''
echo "✅ MDK dev shell loaded. Use 'cargo build', 'cargo test', or 'just' for development."
'';
};
}
);
}
Comment on lines +1 to +36
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify flake.lock is committed.

Ensure that flake.lock is committed to the repository for reproducible builds. The lock file pins exact versions of all inputs.

Run this script to check if flake.lock exists and is tracked:


🏁 Script executed:

#!/bin/bash
# Check if flake.lock exists and is tracked by git

if [ -f "flake.lock" ]; then
  echo "✓ flake.lock exists"
  git ls-files --error-unmatch flake.lock 2>/dev/null
  if [ $? -eq 0 ]; then
    echo "✓ flake.lock is tracked by git"
  else
    echo "✗ flake.lock exists but is not tracked by git"
  fi
else
  echo "✗ flake.lock does not exist - run 'nix flake lock' to generate it"
fi

Length of output: 65


Add and commit flake.lock
Run nix flake lock to generate the lock file and commit it for reproducible builds.

🤖 Prompt for AI Agents
In flake.nix around lines 1 to 36, the review notes that the repository is
missing the generated flake.lock file which is required for reproducible builds;
run `nix flake lock` at the repository root to generate flake.lock, add and
commit that new file to the repo (ensure your .gitignore does not exclude
flake.lock), and push the commit so CI and collaborators use the locked input
versions.