raceless go is a nicer go

This commit is contained in:
2025-11-26 09:13:03 +00:00
parent 8aaa536a2a
commit cc2c9b948b
4 changed files with 11 additions and 6 deletions

View File

@@ -99,7 +99,7 @@
# }; # };
# deploy-rs-pkg = null; # deploy-rs-pkg = null;
#}) #})
(_: super: { (_: super: rec {
gamja = super.callPackage ./pkgs/gamja.nix { }; gamja = super.callPackage ./pkgs/gamja.nix { };
weather = super.callPackage ./pkgs/weather { }; weather = super.callPackage ./pkgs/weather { };
nicer = super.callPackage ./pkgs/nicer.nix { }; nicer = super.callPackage ./pkgs/nicer.nix { };
@@ -108,7 +108,7 @@
chronoctl = super.callPackage ./pkgs/chronoctl.nix { }; chronoctl = super.callPackage ./pkgs/chronoctl.nix { };
vanta-agent = super.callPackage ./pkgs/vanta-agent.nix { }; vanta-agent = super.callPackage ./pkgs/vanta-agent.nix { };
gcloud-wrapped = super.callPackage ./pkgs/gcloud-wrapped { }; gcloud-wrapped = super.callPackage ./pkgs/gcloud-wrapped { };
go-raceless = super.callPackage ./pkgs/go-raceless { }; go-raceless = super.callPackage ./pkgs/go-raceless { inherit (nicer) ; };
pkgs-unstable = import nixpkgs-unstable { pkgs-unstable = import nixpkgs-unstable {
inherit (super) system; inherit (super) system;

View File

@@ -1,4 +1,8 @@
{ pkgs, go }: {
pkgs,
go,
nicer,
}:
let let
go-script = pkgs.writeShellScript "go-raceless" '' go-script = pkgs.writeShellScript "go-raceless" ''
args=("$@") args=("$@")
@@ -22,11 +26,11 @@ let
done done
if [[ "$found_race" == "true" ]]; then if [[ "$found_race" == "true" ]]; then
exec ${go}/bin/go "''${new_args[@]}" exec ${nicer}/bin/nicer ${go}/bin/go "''${new_args[@]}"
fi fi
fi fi
exec ${go}/bin/go "$@" exec ${nicer}/bin/nicer ${go}/bin/go "$@"
''; '';
preservedAttrs = pkgs.lib.attrsets.getAttrs [ preservedAttrs = pkgs.lib.attrsets.getAttrs [

View File

@@ -134,6 +134,7 @@ in
builtins.readFile builtins.readFile
(pkgs.replaceVars ./dev.lua { (pkgs.replaceVars ./dev.lua {
inherit (pkgs) ripgrep; inherit (pkgs) ripgrep;
inherit (pkgs.pkgs-unstable) gopls;
}).outPath; }).outPath;
}) })
]; ];

View File

@@ -3,7 +3,7 @@ require'lspconfig'.clangd.setup{
} }
require'lspconfig'.gopls.setup{ require'lspconfig'.gopls.setup{
cmd = { "nicer", "gopls" } cmd = { "nicer", "@gopls@/bin/gopls" }
} }
vim.api.nvim_exec([[ vim.api.nvim_exec([[