···11+{ lib
22+, stdenv
33+, buildGoModule
44+, fetchFromGitHub
55+, installShellFiles
66+, lvm2
77+, pkg-config
88+}:
99+1010+buildGoModule rec {
1111+ pname = "fetchit";
1212+ version = "0.0.1";
1313+1414+ src = fetchFromGitHub {
1515+ owner = "containers";
1616+ repo = "fetchit";
1717+ rev = "v${version}";
1818+ sha256 = "sha256-hxS/+/fbYOpMJ5VfvvG5l7wWKBUUR22rYn9X79DzUUk=";
1919+ };
2020+2121+ vendorSha256 = "sha256-SyPd8P9s8R2YbGEPqFeztF98W1QyGSBumtirSdpm8VI=";
2222+2323+ subPackages = [ "cmd/fetchit" ];
2424+2525+ nativeBuildInputs = [ pkg-config installShellFiles ];
2626+ buildInputs = [ lvm2 ];
2727+2828+ # Flags are derived from
2929+ # https://github.com/containers/fetchit/blob/v0.0.1/Makefile#L20-L29
3030+ ldflags = [
3131+ "-X k8s.io/client-go/pkg/version.gitMajor=0"
3232+ "-X k8s.io/client-go/pkg/version.gitMinor=0"
3333+ "-X k8s.io/client-go/pkg/version.gitTreeState=clean"
3434+ "-X k8s.io/client-go/pkg/version.gitVersion=v0.0.0"
3535+ "-X k8s.io/component-base/version.gitMajor=0"
3636+ "-X k8s.io/component-base/version.gitMajor=0"
3737+ "-X k8s.io/component-base/version.gitMinor=0"
3838+ "-X k8s.io/component-base/version.gitTreeState=clean"
3939+ "-X k8s.io/component-base/version.gitVersion=v0.0.0"
4040+ "-s"
4141+ "-w"
4242+ ];
4343+4444+ tags = [
4545+ "containers_image_openpgp"
4646+ "exclude_graphdriver_btrfs"
4747+ "gssapi"
4848+ "include_gcs"
4949+ "include_oss"
5050+ "netgo"
5151+ "osusergo"
5252+ "providerless"
5353+ ];
5454+5555+ # There are no tests for cmd/fetchit.
5656+ doCheck = false;
5757+5858+ postInstall = ''
5959+ for i in bash fish zsh; do
6060+ installShellCompletion --cmd fetchit \
6161+ --$i <($out/bin/fetchit completion $i)
6262+ done
6363+ '';
6464+6565+ meta = with lib; {
6666+ description = "A tool to manage the life cycle and configuration of Podman containers";
6767+ longDescription = ''
6868+ FetchIt allows for a GitOps based approach to manage containers running on
6969+ a single host or multiple hosts based on a git repository. This allows for
7070+ us to deploy a new host and provide the host a configuration value for
7171+ FetchIt and automatically any containers defined in the git repository and
7272+ branch will be deployed onto the host. This can be beneficial for
7373+ environments that do not require the complexity of Kubernetes to manage
7474+ the containers running on the host.
7575+ '';
7676+ homepage = "https://fetchit.readthedocs.io";
7777+ changelog = "https://github.com/containers/fetchit/releases/tag/${src.rev}";
7878+ license = licenses.agpl3Plus;
7979+ maintainers = with maintainers; [ azahi ];
8080+ platforms = platforms.linux;
8181+ };
8282+}