From e7f002afaa8082dc5d5e2a3c20d6cc00273b5626 Mon Sep 17 00:00:00 2001 From: Flokkq Date: Tue, 2 Dec 2025 10:53:08 +0100 Subject: [PATCH] timr-tui: initialize at 1.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Flokkq timr-tui: apply suggested fixes Signed-off-by: Flokkq Update pkgs/by-name/ti/timr-tui/package.nix Co-authored-by: Gaétan Lepage Update pkgs/by-name/ti/timr-tui/package.nix Co-authored-by: Gaétan Lepage --- pkgs/by-name/ti/timr-tui/package.nix | 66 ++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 pkgs/by-name/ti/timr-tui/package.nix diff --git a/pkgs/by-name/ti/timr-tui/package.nix b/pkgs/by-name/ti/timr-tui/package.nix new file mode 100644 index 000000000000..ec111a754fa3 --- /dev/null +++ b/pkgs/by-name/ti/timr-tui/package.nix @@ -0,0 +1,66 @@ +{ + lib, + stdenv, + rustPlatform, + fetchFromGitHub, + pkg-config, + alsa-lib-with-plugins, + alsa-plugins, + pipewire, + writableTmpDirAsHomeHook, + versionCheckHook, + nix-update-script, + enableSound ? false, +}: +rustPlatform.buildRustPackage (finalAttrs: { + pname = "timr-tui"; + version = "1.6.1"; + + src = fetchFromGitHub { + owner = "sectore"; + repo = "timr-tui"; + tag = "v${finalAttrs.version}"; + hash = "sha256-s2FnMwDq4tYBaWaT9y1GLbVGFs7zSnOmjcF5leO12JE="; + }; + + cargoHash = "sha256-9yd348QGjFxt+QmEBuYzd612mFm/PyETrZy4z5wW+nI="; + + # Enable upstream "sound" feature when requested + buildFeatures = lib.optionals enableSound [ "sound" ]; + + nativeBuildInputs = lib.optionals (enableSound && stdenv.isLinux) [ pkg-config ]; + + # Runtime/FFI deps for the sound feature (Linux) + buildInputs = lib.optionals (enableSound && stdenv.isLinux) [ + (alsa-lib-with-plugins.override { + plugins = [ + alsa-plugins + pipewire + ]; + }) + ]; + + nativeCheckInputs = [ + writableTmpDirAsHomeHook + ]; + + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = "--version"; + # Error: Operation not permitted (os error 1) + versionCheckKeepEnvironment = lib.optionals stdenv.hostPlatform.isDarwin [ "HOME" ]; + doInstallCheck = true; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "TUI to organize your time: Pomodoro, Countdown, Timer"; + homepage = "https://github.com/sectore/timr-tui"; + changelog = "https://github.com/sectore/timr-tui/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + mainProgram = "timr-tui"; + maintainers = [ lib.maintainers.flokkq ]; + platforms = lib.platforms.unix; + }; +})