Skip to content

Commit

Permalink
feat: add CGO dependencies to devshell
Browse files Browse the repository at this point in the history
Required for running tests with bench and/or race enabled.

Signed-off-by: Brian McGee <[email protected]>
  • Loading branch information
brianmcgee committed May 9, 2024
1 parent 912dcaa commit 4ffe2ca
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions nix/devshell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
];

config.perSystem = {
lib,
pkgs,
config,
...
}: {
}: let
inherit (pkgs.stdenv) isLinux isDarwin;
in {
config.devshells.default = {
env = [
{
Expand All @@ -20,17 +23,24 @@
}
];

packages = with pkgs;
[
packages = lib.mkMerge [
(with pkgs; [
# golang
go
delve
pprof
graphviz
]
++
])
# platform dependent CGO dependencies
(lib.mkIf isLinux [
pkgs.gcc
])
(lib.mkIf isDarwin [
pkgs.darwin.cctools
])
# include formatters for development and testing
(import ./formatters.nix pkgs);
(import ./formatters.nix pkgs)
];

commands = [
{
Expand Down

0 comments on commit 4ffe2ca

Please sign in to comment.