-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
57 lines (48 loc) · 1.75 KB
/
Copy pathflake.nix
File metadata and controls
57 lines (48 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# SPDX-License-Identifier: GPL-3.0-or-later
# Nix flake for Anvil — pure-Rust SSH stack for Git tooling.
#
# Anvil is a library; this flake exposes a development shell. Consumers
# depend on the published `anvil-ssh` crate from crates.io.
#
# Usage:
# nix develop # enter the development shell
{
description = "Pure-Rust SSH stack for Git tooling: transport, keys, signing, agent";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
name = "anvil-dev";
nativeBuildInputs = with pkgs; [
# Rust toolchain via rustup so developers can pin versions freely
# (rust-toolchain.toml pins the channel).
rustup
# Required by aws-lc-rs for assembly pre-processing. Non-FIPS
# builds do NOT require cmake or go.
perl
# C toolchain for linking.
gcc
# Optional: strip release artefacts.
binutils
git
];
# Override NixOS-injected CFLAGS that break aws-lc-rs's C build:
# the stdenv injects `-flto=auto`, which produces GCC LTO IR objects
# the Rust linker can't resolve. RUSTFLAGS is left to flow through
# from the ambient environment so host-level CPU targeting takes
# effect.
CFLAGS = "-march=native -O2 -pipe";
shellHook = ''
echo "anvil dev shell ready. Run: cargo build --release"
'';
};
}
);
}