nixpkgs/pkgs/by-name/k2/k2tf/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

35 lines
964 B
Nix

{ lib, buildGoModule, fetchFromGitHub, fetchpatch }:
buildGoModule rec {
pname = "k2tf";
version = "0.7.0";
src = fetchFromGitHub {
owner = "sl1pm4t";
repo = pname;
rev = "v${version}";
sha256 = "sha256-zkkRzCTZCvbwBj4oIhTo5d3PvqLMJPzT3zV9jU3PEJs=";
};
patches = [
# update dependencies
# https://github.com/sl1pm4t/k2tf/pull/111
(fetchpatch {
url = "https://github.com/sl1pm4t/k2tf/commit/7e7b778eeb80400cb0dadb1cdea4e617b5738147.patch";
hash = "sha256-ZGQUuH7u3aNLml6rvOzOxVwSTlbhZLknXbHKeY4lp00=";
})
];
vendorHash = "sha256-yGuoE1bgwVHk3ym382OC93me9HPlVoNgGo/3JROVC2E=";
ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.commit=v${version}" ];
meta = with lib; {
description = "Kubernetes YAML to Terraform HCL converter";
mainProgram = "k2tf";
homepage = "https://github.com/sl1pm4t/k2tf";
license = licenses.mpl20;
maintainers = [ maintainers.flokli ];
};
}