From 9c4822421b230e7e76f75a15454b899fdc975fdb Mon Sep 17 00:00:00 2001
From: Philip Wilk
Date: Wed, 29 Jan 2025 14:58:04 +0000
Subject: [PATCH] autotier: init at 1.2.0
---
pkgs/by-name/au/autotier/package.nix | 88 ++++++++++++++++++++++++++++
1 file changed, 88 insertions(+)
create mode 100644 pkgs/by-name/au/autotier/package.nix
diff --git a/pkgs/by-name/au/autotier/package.nix b/pkgs/by-name/au/autotier/package.nix
new file mode 100644
index 000000000000..a6d8836eed35
--- /dev/null
+++ b/pkgs/by-name/au/autotier/package.nix
@@ -0,0 +1,88 @@
+{
+ stdenv,
+ lib,
+ fetchFromGitHub,
+ fetchpatch,
+ pkg-config,
+ rocksdb,
+ boost,
+ fuse3,
+ lib45d,
+ tbb_2021_11,
+ liburing,
+ installShellFiles,
+}:
+stdenv.mkDerivation (finalAttrs: {
+ name = "autotier";
+ version = "1.2.0";
+ src = fetchFromGitHub {
+ owner = "45Drives";
+ repo = "autotier";
+ tag = "v${finalAttrs.version}";
+ hash = "sha256-Pf1baDJsyt0ScASWrrgMu8+X5eZPGJSu0/LDQNHe1Ok=";
+ };
+
+ patches = [
+ # https://github.com/45Drives/autotier/pull/70
+ # fix "error: 'uintmax_t' has not been declared" build failure until next release
+ (fetchpatch {
+ url = "https://github.com/45Drives/autotier/commit/d447929dc4262f607d87cbc8ad40a54d64f5011a.patch";
+ hash = "sha256-0ab8YBgdJMxBHfOgUsgPpyUE1GyhAU3+WCYjYA2pjqo=";
+ })
+ # Unvendor rocksdb (nixpkgs already applies RTTI and PORTABLE flags) and use pkg-config for flags
+ (fetchpatch {
+ url = "https://github.com/45Drives/autotier/commit/fa282f5079ff17c144a7303d64dad0e44681b87f.patch";
+ hash = "sha256-+W3RwSe8zJKgZIXOaawHuI6xRzedYIcZundPC8eHuwM=";
+ })
+ # Add missing list import to src/incl/config.hpp
+ (fetchpatch {
+ url = "https://github.com/45Drives/autotier/commit/1f97703f4dfbfe093f5c18c4ee01dcc1c8fe04f3.patch";
+ hash = "sha256-3+KOh7JvbujCMbMqnZ5SGopAuOKHitKq6XV6a/jkcog=";
+ })
+ ];
+
+ buildInputs = [
+ rocksdb
+ boost
+ fuse3
+ lib45d
+ tbb_2021_11
+ liburing
+ ];
+
+ nativeBuildInputs = [
+ pkg-config
+ installShellFiles
+ ];
+
+ installPhase = ''
+ runHook preInstall
+
+ # binaries
+ installBin dist/from_source/*
+
+ # docs
+ installManPage doc/man/autotier.8
+
+ # Completions
+ installShellCompletion --bash doc/completion/autotier.bash-completion
+ installShellCompletion --bash doc/completion/autotierfs.bash-completion
+
+ # Scripts
+ installBin script/autotier-init-dirs
+
+ # Default config
+ install -Dm755 -t $out/etc/autotier.conf doc/autotier.conf.template
+
+ runHook postInstall
+ '';
+
+ meta = {
+ homepage = "https://github.com/45Drives/autotier";
+ description = "Passthrough FUSE filesystem that intelligently moves files between storage tiers based on frequency of use, file age, and tier fullness";
+ license = lib.licenses.gpl3;
+ maintainers = with lib.maintainers; [ philipwilk ];
+ mainProgram = "autotier"; # cli, for file system use autotierfs
+ platforms = lib.platforms.linux; # uses io_uring so only available on linux not unix
+ };
+})