Skip to content

Commit aea75cd

Browse files
committed
feat: remove CGO dependencies and disable
Not required Signed-off-by: Brian McGee <[email protected]>
1 parent 986f020 commit aea75cd

File tree

2 files changed

+57
-67
lines changed

2 files changed

+57
-67
lines changed

nix/devshell.nix

+56-66
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,62 @@
22
pkgs,
33
perSystem,
44
...
5-
}: let
6-
inherit (pkgs) lib;
7-
inherit (pkgs.stdenv) isLinux isDarwin;
8-
in
9-
perSystem.devshell.mkShell {
10-
env = [
11-
{
12-
name = "GOROOT";
13-
value = pkgs.go + "/share/go";
14-
}
15-
{
16-
name = "LD_LIBRARY_PATH";
17-
value = "$DEVSHELL_DIR/lib";
18-
}
19-
];
5+
}:
6+
perSystem.devshell.mkShell {
7+
env = [
8+
{
9+
name = "GOROOT";
10+
value = pkgs.go + "/share/go";
11+
}
12+
];
2013

21-
packages = lib.mkMerge [
22-
(with pkgs; [
23-
# golang
24-
go
25-
goreleaser
26-
golangci-lint
27-
delve
28-
pprof
29-
graphviz
14+
packages = pkgs.lib.mkMerge [
15+
(with pkgs; [
16+
# golang
17+
go
18+
goreleaser
19+
golangci-lint
20+
delve
21+
pprof
22+
graphviz
3023

31-
# docs
32-
nodejs
33-
])
34-
# platform dependent CGO dependencies
35-
(lib.mkIf isLinux [pkgs.gcc])
36-
(lib.mkIf isDarwin [pkgs.darwin.cctools])
37-
# include formatters for development and testing
38-
(import ./packages/treefmt/formatters.nix pkgs)
39-
];
24+
# docs
25+
nodejs
26+
])
27+
# include formatters for development and testing
28+
(import ./packages/treefmt/formatters.nix pkgs)
29+
];
4030

41-
commands = [
42-
{package = perSystem.gomod2nix.default;}
43-
{
44-
name = "docs:dev";
45-
help = "serve docs for local development";
46-
command = "cd $PRJ_ROOT/docs && npm ci && npm run dev";
47-
}
48-
{
49-
name = "docs:build";
50-
help = "create a production build of docs";
51-
command = "cd $PRJ_ROOT/docs && npm ci && npm run build";
52-
}
53-
{
54-
name = "docs:preview";
55-
help = "preview a production build of docs";
56-
command = "cd $PRJ_ROOT/docs && npm ci && npm run preview";
57-
}
58-
{
59-
help = "generate terminal gifs";
60-
package = pkgs.writeShellApplication {
61-
name = "vhs";
62-
runtimeInputs =
63-
[
64-
perSystem.self.treefmt
65-
pkgs.rsync
66-
pkgs.vhs
67-
]
68-
++ (import ./packages/treefmt/formatters.nix pkgs);
69-
text = ''vhs "$@"'';
70-
};
71-
}
72-
];
73-
}
31+
commands = [
32+
{package = perSystem.gomod2nix.default;}
33+
{
34+
name = "docs:dev";
35+
help = "serve docs for local development";
36+
command = "cd $PRJ_ROOT/docs && npm ci && npm run dev";
37+
}
38+
{
39+
name = "docs:build";
40+
help = "create a production build of docs";
41+
command = "cd $PRJ_ROOT/docs && npm ci && npm run build";
42+
}
43+
{
44+
name = "docs:preview";
45+
help = "preview a production build of docs";
46+
command = "cd $PRJ_ROOT/docs && npm ci && npm run preview";
47+
}
48+
{
49+
help = "generate terminal gifs";
50+
package = pkgs.writeShellApplication {
51+
name = "vhs";
52+
runtimeInputs =
53+
[
54+
perSystem.self.treefmt
55+
pkgs.rsync
56+
pkgs.vhs
57+
]
58+
++ (import ./packages/treefmt/formatters.nix pkgs);
59+
text = ''vhs "$@"'';
60+
};
61+
}
62+
];
63+
}

nix/packages/treefmt/default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ in
3737

3838
modules = ./gomod2nix.toml;
3939

40-
CGO_ENABLED = 1;
40+
CGO_ENABLED = 0;
4141

4242
ldflags = [
4343
"-s"

0 commit comments

Comments
 (0)