arc/flake.nix
hanna 7fe99cabbd
feat: optional SSH key commit signing (phase 10)
- Add ssh-key crate dependency for SSHSIG format signing/verification
- Add signing module with sign, verify, and fingerprint functions
- Add ssh_signature field to Commit model (optional, backward-compatible)
- Integrate signing into commit flow (signs when user.key is configured)
- Show [signed] tag in log output for signed commits
- Show signature fingerprint and verification status in show output
- Gracefully degrade if key is missing/invalid (warns, commits unsigned)
- Add openssh to nix flake nativeCheckInputs for ssh-keygen in tests
- Add comprehensive signing tests covering signed/unsigned commits
2026-02-08 16:34:05 +00:00

97 lines
2.3 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
description = "arc a delta-based version control system";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
crane = {
url = "github:ipetkov/crane";
};
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem = { system, pkgs, ... }:
let
rustToolchain = inputs.fenix.packages.${system}.stable.withComponents [
"rustc"
"cargo"
"clippy"
"rustfmt"
"rust-src"
];
craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rustToolchain;
src = craneLib.cleanCargoSource ./.;
commonArgs = {
pname = "arc";
version = "0.1.0";
inherit src;
strictDeps = true;
nativeBuildInputs = [ pkgs.pkg-config pkgs.cmake pkgs.perl ];
nativeCheckInputs = [ pkgs.git pkgs.openssh ];
};
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
arc = craneLib.buildPackage (commonArgs // {
inherit cargoArtifacts;
});
in
{
packages = {
inherit arc;
default = arc;
};
apps.default = {
type = "app";
program = "${arc}/bin/arc";
};
checks = {
inherit arc;
clippy = craneLib.cargoClippy (commonArgs // {
inherit cargoArtifacts;
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
});
fmt = craneLib.cargoFmt {
inherit src;
};
test = craneLib.cargoTest (commonArgs // {
inherit cargoArtifacts;
});
};
devShells.default = pkgs.mkShell {
packages = [
rustToolchain
pkgs.git
pkgs.pkg-config
pkgs.cmake
pkgs.perl
];
RUST_BACKTRACE = "1";
};
};
};
}