feat: remove CGO dependencies and disable

Not required

Signed-off-by: Brian McGee <brian@bmcgee.ie>
This commit is contained in:
Brian McGee 2024-06-30 12:20:49 +01:00
parent 986f020c3d
commit aea75cdeb1
No known key found for this signature in database
GPG Key ID: D49016E76AD1E8C0
2 changed files with 57 additions and 67 deletions

View File

@ -2,72 +2,62 @@
pkgs, pkgs,
perSystem, perSystem,
... ...
}: let }:
inherit (pkgs) lib; perSystem.devshell.mkShell {
inherit (pkgs.stdenv) isLinux isDarwin; env = [
in {
perSystem.devshell.mkShell { name = "GOROOT";
env = [ value = pkgs.go + "/share/go";
{ }
name = "GOROOT"; ];
value = pkgs.go + "/share/go";
}
{
name = "LD_LIBRARY_PATH";
value = "$DEVSHELL_DIR/lib";
}
];
packages = lib.mkMerge [ packages = pkgs.lib.mkMerge [
(with pkgs; [ (with pkgs; [
# golang # golang
go go
goreleaser goreleaser
golangci-lint golangci-lint
delve delve
pprof pprof
graphviz graphviz
# docs # docs
nodejs nodejs
]) ])
# platform dependent CGO dependencies # include formatters for development and testing
(lib.mkIf isLinux [pkgs.gcc]) (import ./packages/treefmt/formatters.nix pkgs)
(lib.mkIf isDarwin [pkgs.darwin.cctools]) ];
# include formatters for development and testing
(import ./packages/treefmt/formatters.nix pkgs)
];
commands = [ commands = [
{package = perSystem.gomod2nix.default;} {package = perSystem.gomod2nix.default;}
{ {
name = "docs:dev"; name = "docs:dev";
help = "serve docs for local development"; help = "serve docs for local development";
command = "cd $PRJ_ROOT/docs && npm ci && npm run dev"; command = "cd $PRJ_ROOT/docs && npm ci && npm run dev";
} }
{ {
name = "docs:build"; name = "docs:build";
help = "create a production build of docs"; help = "create a production build of docs";
command = "cd $PRJ_ROOT/docs && npm ci && npm run build"; command = "cd $PRJ_ROOT/docs && npm ci && npm run build";
} }
{ {
name = "docs:preview"; name = "docs:preview";
help = "preview a production build of docs"; help = "preview a production build of docs";
command = "cd $PRJ_ROOT/docs && npm ci && npm run preview"; command = "cd $PRJ_ROOT/docs && npm ci && npm run preview";
} }
{ {
help = "generate terminal gifs"; help = "generate terminal gifs";
package = pkgs.writeShellApplication { package = pkgs.writeShellApplication {
name = "vhs"; name = "vhs";
runtimeInputs = runtimeInputs =
[ [
perSystem.self.treefmt perSystem.self.treefmt
pkgs.rsync pkgs.rsync
pkgs.vhs pkgs.vhs
] ]
++ (import ./packages/treefmt/formatters.nix pkgs); ++ (import ./packages/treefmt/formatters.nix pkgs);
text = ''vhs "$@"''; text = ''vhs "$@"'';
}; };
} }
]; ];
} }

View File

@ -37,7 +37,7 @@ in
modules = ./gomod2nix.toml; modules = ./gomod2nix.toml;
CGO_ENABLED = 1; CGO_ENABLED = 0;
ldflags = [ ldflags = [
"-s" "-s"