From d5d12e79d88ca1fd4146fa1509fbf19b327b637b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Wed, 27 Mar 2024 10:07:48 +0100 Subject: [PATCH] Add pomodoro timer package --- home/packages/default.nix | 9 ++++++++- packages/open-pomodoro.nix | 40 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 packages/open-pomodoro.nix diff --git a/home/packages/default.nix b/home/packages/default.nix index ce33f23..25f4b65 100644 --- a/home/packages/default.nix +++ b/home/packages/default.nix @@ -1,5 +1,12 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +let + my-pomodoro = pkgs.callPackage ../../packages/open-pomodoro.nix { }; +in +{ home.packages = with pkgs; [ + # My own packages + my-pomodoro + # Generic tools age alacritty diff --git a/packages/open-pomodoro.nix b/packages/open-pomodoro.nix new file mode 100644 index 0000000..b2079d3 --- /dev/null +++ b/packages/open-pomodoro.nix @@ -0,0 +1,40 @@ +{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: + +buildGoModule rec { + pname = "openpomodoro-cli"; + version = "0.3.0"; + + src = fetchFromGitHub { + owner = "open-pomodoro"; + repo = "openpomodoro-cli"; + rev = "v${version}"; + hash = "sha256-h/o4yxrZ8ViHhN2JS0ZJMfvcJBPCsyZ9ZQw9OmKnOfY="; + }; + + vendorHash = "sha256-BR9d/PMQ1ZUYWSDO5ID2bkTN+A+VbaLTlz5t0vbkO60="; + + ldflags = [ "-s" "-w" ]; + + GOWORK = "off"; + + subPackages = [ "cmd/pomodoro" ]; + + nativeBuildInputs = [ installShellFiles ]; + + # postInstall = '' + # installShellCompletion --cmd talosctl \ + # --bash <($out/bin/talosctl completion bash) \ + # --fish <($out/bin/talosctl completion fish) \ + # --zsh <($out/bin/talosctl completion zsh) + # ''; + + doCheck = false; # no tests + + meta = with lib; { + description = "A command-line Pomodoro tracker which uses the Open Pomodoro Format"; + mainProgram = "pomodoro"; + homepage = "https://github.com/open-pomodoro/openpomodoro-cli"; + license = licenses.mit; + # maintainers = with maintainers; [ flokli ]; + }; +}