I’m trying to add nix to a project that I’m working on and so far this is the state of the shell.nix
:
let
pkgs = import <nixpkgs> { };
kubefwd = pkgs.buildGoModule rec {
pname = "kubefwd";
owner = "txn2";
version = "1.14.7";
src = pkgs.fetchFromGitHub {
owner = "${owner}";
repo = "${pname}";
rev = "${version}";
sha256 = "1dx3m08gazmljpvwnivw1rdsd46vk55jidxs9gwc71dyzi4m77hc";
};
vendorSha256 = "1pg4sh09rndxpqn7v5f597m9k9xxmnryzag609j172dsrhzv6ppj";
buildFlags = ["--trimpath"];
subPackages = ["cmd/kubefwd"];
meta = with pkgs.lib; {
homepage = "https://github.com/${owner}/${pname}";
platforms = platforms.linux ++ platforms.darwin;
};
};
in pkgs.mkShell rec {
buildInputs = [
kubefwd
pkgs.go
pkgs.wget
pkgs.awscli
pkgs.jq
pkgs.git-secrets
];
}
I’m using nix with direnv. There is just one thing left here, I would like to execute a script during the setup, it’s possible?
The idea is to run a make target to configure the repository. The most important task of this configuration is the git-secrets
setup that needs to be executed at the git repository in order to install the git hooks.