Hi!
I’m working on a project that needs its binary to be built constantly. That binary (a language server) is included as a dependency in my shell buildInputs because I want to test it without leaving my shell of my tmux session from that shell. I can build that dependency with nix-build --expr '(import <nixpkgs> {}).callPackage ./lspbuilder.nix {} my issue is that my shell doesn’t point (if that’s the right word) to this new version but stays with the one I started my shell with.
My current solution to this problem is to leave the shell and enter again but this is an impractical workflow that will become annoying after a while. My projects needs frequent builds and this workflow won’t be helpful.
Is there a way buildInputs points to my build most recent version? Should I run a flag for nix-shell that accomplishes that?
shell.nix
{pkgs ? import <nixpkgs>{}}:
pkgs.mkShell {
packages = with pkgs; [
go gopls golangci-lint delve gotools
];
buildInputs = with pkgs; [ (callPackage ./lspbuilder.nix {})];
hardeningDisable = ["fortify"];
shellHook = ''nu'';
}
lspbuilder.nix
{buildGoModule}:
buildGoModule(finalAttrs: {
pname = "cslsp";
version = "0.1";
src = ./.;
vendorHash = null;
})