-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
67 lines (62 loc) · 2.3 KB
/
flake.nix
File metadata and controls
67 lines (62 loc) · 2.3 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
58
59
60
61
62
63
64
65
66
67
{
description = "Keel - Agentic SDLC management";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, rust-overlay, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
rust = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" "rust-analyzer" "llvm-tools" ];
};
isLinux = pkgs.stdenv.isLinux;
isDarwin = pkgs.stdenv.isDarwin;
keel = pkgs.callPackage ./nix/keel.nix {
rustPlatform = pkgs.makeRustPlatform {
cargo = rust;
rustc = rust;
};
};
in {
packages = {
keel = keel;
default = keel;
};
devShells.default = pkgs.mkShell {
buildInputs = [
rust
pkgs.nodejs_24
pkgs.just
pkgs.cargo-nextest
pkgs.cargo-llvm-cov
# CLI recording and video processing
pkgs.vhs
pkgs.ffmpeg
# Native build deps
pkgs.pkg-config
] ++ pkgs.lib.optionals isLinux [
# mold is a faster linker (Linux only)
pkgs.mold
];
shellHook = ''
# Shared target directory across all worktrees for faster builds
# WARNING: cargo clean will affect ALL worktrees
export CARGO_TARGET_DIR="$HOME/.cache/cargo-target/keel"
'' + pkgs.lib.optionalString isDarwin ''
# Fix TMPDIR for sccache on macOS (Nix 2.24+ issue)
# Nix sets TMPDIR to a nix-shell-specific dir that gets cleaned up
# causing "Failed to create temp dir" errors in sccache
# See: https://github.com/NixOS/nix/issues/11929
export TMPDIR=/var/tmp
'' + pkgs.lib.optionalString isLinux ''
# Use mold linker on Linux for faster linking
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-C link-arg=-fuse-ld=mold"
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-C link-arg=-fuse-ld=mold"
'';
};
});
}