-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
42 lines (39 loc) · 1.61 KB
/
Copy pathflake.nix
File metadata and controls
42 lines (39 loc) · 1.61 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
{
description = "Development shell with Zig and the local-backend release-gate runtime";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
zig-overlay.url = "github:mitchellh/zig-overlay";
};
outputs = { self, nixpkgs, flake-utils, zig-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = [
zig-overlay.packages.${system}.master
pkgs.cmake
pkgs.curl
pkgs.ninja
pkgs.python3
pkgs.mypy
];
# Dev-shell convenience: make sure OPENAI_API_KEY is exported — the dev
# override for foreground runs (#33; the installed daemon reads the login
# keychain instead). A legacy ~/.config/type-wave/env file is still sourced
# if present so old setups keep working — but do not count on it: the
# installed daemon now *removes* that file once the keychain provably holds
# the key (#282), so a machine that has run the daemon exports the key some
# other way.
shellHook = ''
if [ -z "''${OPENAI_API_KEY:-}" ] && [ -f "$HOME/.config/type-wave/env" ]; then
. "$HOME/.config/type-wave/env"
fi
if [ -z "''${OPENAI_API_KEY:-}" ]; then
echo "type-wave: OPENAI_API_KEY not exported - foreground runs need it (the installed daemon uses the keychain, issue #33)" >&2
fi
'';
};
});
}