mirror of
https://github.com/numtide/treefmt.git
synced 2024-10-03 20:18:11 +03:00
feat: remove CGO dependencies and disable
Not required Signed-off-by: Brian McGee <brian@bmcgee.ie>
This commit is contained in:
parent
986f020c3d
commit
aea75cdeb1
122
nix/devshell.nix
122
nix/devshell.nix
@ -2,72 +2,62 @@
|
||||
pkgs,
|
||||
perSystem,
|
||||
...
|
||||
}: let
|
||||
inherit (pkgs) lib;
|
||||
inherit (pkgs.stdenv) isLinux isDarwin;
|
||||
in
|
||||
perSystem.devshell.mkShell {
|
||||
env = [
|
||||
{
|
||||
name = "GOROOT";
|
||||
value = pkgs.go + "/share/go";
|
||||
}
|
||||
{
|
||||
name = "LD_LIBRARY_PATH";
|
||||
value = "$DEVSHELL_DIR/lib";
|
||||
}
|
||||
];
|
||||
}:
|
||||
perSystem.devshell.mkShell {
|
||||
env = [
|
||||
{
|
||||
name = "GOROOT";
|
||||
value = pkgs.go + "/share/go";
|
||||
}
|
||||
];
|
||||
|
||||
packages = lib.mkMerge [
|
||||
(with pkgs; [
|
||||
# golang
|
||||
go
|
||||
goreleaser
|
||||
golangci-lint
|
||||
delve
|
||||
pprof
|
||||
graphviz
|
||||
packages = pkgs.lib.mkMerge [
|
||||
(with pkgs; [
|
||||
# golang
|
||||
go
|
||||
goreleaser
|
||||
golangci-lint
|
||||
delve
|
||||
pprof
|
||||
graphviz
|
||||
|
||||
# docs
|
||||
nodejs
|
||||
])
|
||||
# platform dependent CGO dependencies
|
||||
(lib.mkIf isLinux [pkgs.gcc])
|
||||
(lib.mkIf isDarwin [pkgs.darwin.cctools])
|
||||
# include formatters for development and testing
|
||||
(import ./packages/treefmt/formatters.nix pkgs)
|
||||
];
|
||||
# docs
|
||||
nodejs
|
||||
])
|
||||
# include formatters for development and testing
|
||||
(import ./packages/treefmt/formatters.nix pkgs)
|
||||
];
|
||||
|
||||
commands = [
|
||||
{package = perSystem.gomod2nix.default;}
|
||||
{
|
||||
name = "docs:dev";
|
||||
help = "serve docs for local development";
|
||||
command = "cd $PRJ_ROOT/docs && npm ci && npm run dev";
|
||||
}
|
||||
{
|
||||
name = "docs:build";
|
||||
help = "create a production build of docs";
|
||||
command = "cd $PRJ_ROOT/docs && npm ci && npm run build";
|
||||
}
|
||||
{
|
||||
name = "docs:preview";
|
||||
help = "preview a production build of docs";
|
||||
command = "cd $PRJ_ROOT/docs && npm ci && npm run preview";
|
||||
}
|
||||
{
|
||||
help = "generate terminal gifs";
|
||||
package = pkgs.writeShellApplication {
|
||||
name = "vhs";
|
||||
runtimeInputs =
|
||||
[
|
||||
perSystem.self.treefmt
|
||||
pkgs.rsync
|
||||
pkgs.vhs
|
||||
]
|
||||
++ (import ./packages/treefmt/formatters.nix pkgs);
|
||||
text = ''vhs "$@"'';
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
commands = [
|
||||
{package = perSystem.gomod2nix.default;}
|
||||
{
|
||||
name = "docs:dev";
|
||||
help = "serve docs for local development";
|
||||
command = "cd $PRJ_ROOT/docs && npm ci && npm run dev";
|
||||
}
|
||||
{
|
||||
name = "docs:build";
|
||||
help = "create a production build of docs";
|
||||
command = "cd $PRJ_ROOT/docs && npm ci && npm run build";
|
||||
}
|
||||
{
|
||||
name = "docs:preview";
|
||||
help = "preview a production build of docs";
|
||||
command = "cd $PRJ_ROOT/docs && npm ci && npm run preview";
|
||||
}
|
||||
{
|
||||
help = "generate terminal gifs";
|
||||
package = pkgs.writeShellApplication {
|
||||
name = "vhs";
|
||||
runtimeInputs =
|
||||
[
|
||||
perSystem.self.treefmt
|
||||
pkgs.rsync
|
||||
pkgs.vhs
|
||||
]
|
||||
++ (import ./packages/treefmt/formatters.nix pkgs);
|
||||
text = ''vhs "$@"'';
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ in
|
||||
|
||||
modules = ./gomod2nix.toml;
|
||||
|
||||
CGO_ENABLED = 1;
|
||||
CGO_ENABLED = 0;
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
|
Loading…
Reference in New Issue
Block a user