···1+{ lib
2+, stdenv
3+, buildGoModule
4+, fetchFromGitHub
5+, installShellFiles
6+, lvm2
7+, pkg-config
8+}:
9+10+buildGoModule rec {
11+ pname = "fetchit";
12+ version = "0.0.1";
13+14+ src = fetchFromGitHub {
15+ owner = "containers";
16+ repo = "fetchit";
17+ rev = "v${version}";
18+ sha256 = "sha256-hxS/+/fbYOpMJ5VfvvG5l7wWKBUUR22rYn9X79DzUUk=";
19+ };
20+21+ vendorSha256 = "sha256-SyPd8P9s8R2YbGEPqFeztF98W1QyGSBumtirSdpm8VI=";
22+23+ subPackages = [ "cmd/fetchit" ];
24+25+ nativeBuildInputs = [ pkg-config installShellFiles ];
26+ buildInputs = [ lvm2 ];
27+28+ # Flags are derived from
29+ # https://github.com/containers/fetchit/blob/v0.0.1/Makefile#L20-L29
30+ ldflags = [
31+ "-X k8s.io/client-go/pkg/version.gitMajor=0"
32+ "-X k8s.io/client-go/pkg/version.gitMinor=0"
33+ "-X k8s.io/client-go/pkg/version.gitTreeState=clean"
34+ "-X k8s.io/client-go/pkg/version.gitVersion=v0.0.0"
35+ "-X k8s.io/component-base/version.gitMajor=0"
36+ "-X k8s.io/component-base/version.gitMajor=0"
37+ "-X k8s.io/component-base/version.gitMinor=0"
38+ "-X k8s.io/component-base/version.gitTreeState=clean"
39+ "-X k8s.io/component-base/version.gitVersion=v0.0.0"
40+ "-s"
41+ "-w"
42+ ];
43+44+ tags = [
45+ "containers_image_openpgp"
46+ "exclude_graphdriver_btrfs"
47+ "gssapi"
48+ "include_gcs"
49+ "include_oss"
50+ "netgo"
51+ "osusergo"
52+ "providerless"
53+ ];
54+55+ # There are no tests for cmd/fetchit.
56+ doCheck = false;
57+58+ postInstall = ''
59+ for i in bash fish zsh; do
60+ installShellCompletion --cmd fetchit \
61+ --$i <($out/bin/fetchit completion $i)
62+ done
63+ '';
64+65+ meta = with lib; {
66+ description = "A tool to manage the life cycle and configuration of Podman containers";
67+ longDescription = ''
68+ FetchIt allows for a GitOps based approach to manage containers running on
69+ a single host or multiple hosts based on a git repository. This allows for
70+ us to deploy a new host and provide the host a configuration value for
71+ FetchIt and automatically any containers defined in the git repository and
72+ branch will be deployed onto the host. This can be beneficial for
73+ environments that do not require the complexity of Kubernetes to manage
74+ the containers running on the host.
75+ '';
76+ homepage = "https://fetchit.readthedocs.io";
77+ changelog = "https://github.com/containers/fetchit/releases/tag/${src.rev}";
78+ license = licenses.agpl3Plus;
79+ maintainers = with maintainers; [ azahi ];
80+ platforms = platforms.linux;
81+ };
82+}