about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/fetchit
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2022-07-04 00:40:10 +0300
committerAzat Bahawi <azat@bahawi.net>2022-07-04 00:40:10 +0300
commit1c153a860df313079e19cbedfe6624a5273623fc (patch)
tree09ef77e7b9d0e6cca75e60cb9417445ff2477cb9 /pkgs/applications/networking/cluster/fetchit
parent468d2bdcf11b4e166286f92ce67a45d0f64eb248 (diff)
fetchit: init at 0.0.1
Fixes: #172601
Diffstat (limited to 'pkgs/applications/networking/cluster/fetchit')
-rw-r--r--pkgs/applications/networking/cluster/fetchit/default.nix82
1 files changed, 82 insertions, 0 deletions
diff --git a/pkgs/applications/networking/cluster/fetchit/default.nix b/pkgs/applications/networking/cluster/fetchit/default.nix
new file mode 100644
index 0000000000000..b4e7e66d7dcee
--- /dev/null
+++ b/pkgs/applications/networking/cluster/fetchit/default.nix
@@ -0,0 +1,82 @@
+{ lib
+, stdenv
+, buildGoModule
+, fetchFromGitHub
+, installShellFiles
+, lvm2
+, pkg-config
+}:
+
+buildGoModule rec {
+  pname = "fetchit";
+  version = "0.0.1";
+
+  src = fetchFromGitHub {
+    owner = "containers";
+    repo = "fetchit";
+    rev = "v${version}";
+    sha256 = "sha256-hxS/+/fbYOpMJ5VfvvG5l7wWKBUUR22rYn9X79DzUUk=";
+  };
+
+  vendorSha256 = "sha256-SyPd8P9s8R2YbGEPqFeztF98W1QyGSBumtirSdpm8VI=";
+
+  subPackages = [ "cmd/fetchit" ];
+
+  nativeBuildInputs = [ pkg-config installShellFiles ];
+  buildInputs = [ lvm2 ];
+
+  # Flags are derived from
+  # https://github.com/containers/fetchit/blob/v0.0.1/Makefile#L20-L29
+  ldflags = [
+    "-X k8s.io/client-go/pkg/version.gitMajor=0"
+    "-X k8s.io/client-go/pkg/version.gitMinor=0"
+    "-X k8s.io/client-go/pkg/version.gitTreeState=clean"
+    "-X k8s.io/client-go/pkg/version.gitVersion=v0.0.0"
+    "-X k8s.io/component-base/version.gitMajor=0"
+    "-X k8s.io/component-base/version.gitMajor=0"
+    "-X k8s.io/component-base/version.gitMinor=0"
+    "-X k8s.io/component-base/version.gitTreeState=clean"
+    "-X k8s.io/component-base/version.gitVersion=v0.0.0"
+    "-s"
+    "-w"
+  ];
+
+  tags = [
+    "containers_image_openpgp"
+    "exclude_graphdriver_btrfs"
+    "gssapi"
+    "include_gcs"
+    "include_oss"
+    "netgo"
+    "osusergo"
+    "providerless"
+  ];
+
+  # There are no tests for cmd/fetchit.
+  doCheck = false;
+
+  postInstall = ''
+    for i in bash fish zsh; do
+      installShellCompletion --cmd fetchit \
+        --$i <($out/bin/fetchit completion $i)
+    done
+  '';
+
+  meta = with lib; {
+    description = "A tool to manage the life cycle and configuration of Podman containers";
+    longDescription = ''
+      FetchIt allows for a GitOps based approach to manage containers running on
+      a single host or multiple hosts based on a git repository. This allows for
+      us to deploy a new host and provide the host a configuration value for
+      FetchIt and automatically any containers defined in the git repository and
+      branch will be deployed onto the host. This can be beneficial for
+      environments that do not require the complexity of Kubernetes to manage
+      the containers running on the host.
+    '';
+    homepage = "https://fetchit.readthedocs.io";
+    changelog = "https://github.com/containers/fetchit/releases/tag/${src.rev}";
+    license = licenses.agpl3Plus;
+    maintainers = with maintainers; [ azahi ];
+    platforms = platforms.linux;
+  };
+}