From 715bbcd8b21c15e68efd19e5a3be65b90225d159 Mon Sep 17 00:00:00 2001 From: Rachit Kumar Verma <155641117+rachitvrma@users.noreply.github.com> Date: Tue, 28 Jul 2026 20:16:17 +0530 Subject: [PATCH] module/pomo: init A TUI Pomodoro timer with ASCII art, progress bar, desktop notifications, and productivity stats. --- flake.lock | 6 +- modules/lib/maintainers.nix | 17 ++--- .../misc/news/2026/07/2026-07-28_20-12-31.nix | 12 +++ modules/programs/pomo.nix | 74 +++++++++++++++++++ modules/programs/rizin.nix | 2 +- modules/services/linux-wallpaperengine.nix | 2 +- tests/modules/programs/pomo/default.nix | 4 + .../modules/programs/pomo/empty-settings.nix | 6 ++ .../pomo/example-settings-expected.yaml | 25 +++++++ .../programs/pomo/example-settings.nix | 45 +++++++++++ 10 files changed, 176 insertions(+), 17 deletions(-) create mode 100644 modules/misc/news/2026/07/2026-07-28_20-12-31.nix create mode 100644 modules/programs/pomo.nix create mode 100644 tests/modules/programs/pomo/default.nix create mode 100644 tests/modules/programs/pomo/empty-settings.nix create mode 100644 tests/modules/programs/pomo/example-settings-expected.yaml create mode 100644 tests/modules/programs/pomo/example-settings.nix diff --git a/flake.lock b/flake.lock index 8072661fc58b..cbc90502fb8b 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1783604885, - "narHash": "sha256-tzMgSkV7kljEkqIjlgV6F+n+xD+/a35Db8bs7a4BFAo=", + "lastModified": 1785141334, + "narHash": "sha256-kh35kIx7el4Jk8Ki3BH9/Pn1eZYSYLJ6LMALos0zOy0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "767b0d3ec98a143ad9ed7dfc0d5553510ac27133", + "rev": "38a4887411571457d700c51c64a6e49ead2ed5ab", "type": "github" }, "original": { diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index a52409ba95ea..a62a1945d0b0 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -103,12 +103,6 @@ github = "CarlosLoboxyz"; githubId = 86011416; }; - ckgxrg = { - name = "ckgxrg"; - email = "ckgxrg@ckgxrg.io"; - github = "ckgxrg-salt"; - githubId = 165614491; - }; csanthiago = { name = "csanthiago"; email = "git@csanthiago.dev"; @@ -499,6 +493,11 @@ github = "prescientmoon"; githubId = 39400800; }; + rachitvrma = { + name = "Rachit Kumar Verma"; + github = "rachitvrma"; + githubId = 155641117; + }; rasmus-kirk = { name = "Rasmus Kirk"; email = "mail@rasmuskirk.com"; @@ -529,12 +528,6 @@ github = "Rosuavio"; githubId = 7164552; }; - rsahwe = { - name = "rsahwe"; - email = "rsahwe@gmx.net"; - github = "rsahwe"; - githubId = 201613730; - }; rszamszur = { name = "RadosΕ‚aw Szamszur"; email = "radoslawszamszur@gmail.com"; diff --git a/modules/misc/news/2026/07/2026-07-28_20-12-31.nix b/modules/misc/news/2026/07/2026-07-28_20-12-31.nix new file mode 100644 index 000000000000..4ec8696b29d3 --- /dev/null +++ b/modules/misc/news/2026/07/2026-07-28_20-12-31.nix @@ -0,0 +1,12 @@ +{ + time = "2026-07-28T14:42:31+00:00"; + condition = true; + message = '' + A new module is available: 'programs.pomo' + + Customizable TUI Pomodoro timer with ASCII art, progress bar, + desktop notifications, and productivity statistics. + + See for more details. + ''; +} diff --git a/modules/programs/pomo.nix b/modules/programs/pomo.nix new file mode 100644 index 000000000000..3c41ba2f1f02 --- /dev/null +++ b/modules/programs/pomo.nix @@ -0,0 +1,74 @@ +{ + config, + lib, + pkgs, + ... +}: +let + inherit (lib) + mkIf + mkEnableOption + mkOption + mkPackageOption + ; + cfg = config.programs.pomo; + yamlFormat = pkgs.formats.yaml { }; +in +{ + meta.maintainers = with lib.hm.maintainers; [ + rachitvrma + ]; + + options.programs.pomo = { + enable = mkEnableOption '' + pomo, a TUI Pomodoro timer with ASCII Art, progress bar, + desktop notifications, and productivity stats. + ''; + + package = mkPackageOption pkgs "pomo" { nullable = true; }; + + settings = mkOption { + inherit (yamlFormat) type; + + default = { }; + defaultText = lib.literalExpression "{ }"; + + example = lib.literalExpression '' + { + onSessionEnd = "ask"; + + asciiArt = { + enabled = true; + font = "mono12"; + color = "#5A56E0"; + }; + + work = { + duration = "25m"; + title = "work session"; + notification = { + enabled = true; + urgent = false; + title = "work finished πŸŽ‰"; + message = "time to take a break"; + }; + }; + } + ''; + + description = '' + Configuration written to + {file}`$XDG_CONFIG_HOME/pomo/pomo.yml` + See + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = mkIf (cfg.package != null) [ cfg.package ]; + + xdg.configFile."pomo/pomo.yaml" = mkIf (cfg.settings != { }) { + source = yamlFormat.generate "hm_pomo.yaml" cfg.settings; + }; + }; +} diff --git a/modules/programs/rizin.nix b/modules/programs/rizin.nix index b9be4c96227d..7ee2d9e43b7e 100644 --- a/modules/programs/rizin.nix +++ b/modules/programs/rizin.nix @@ -9,7 +9,7 @@ let in { meta.maintainers = [ - lib.hm.maintainers.rsahwe + lib.maintainers.rsahwe ]; options = { diff --git a/modules/services/linux-wallpaperengine.nix b/modules/services/linux-wallpaperengine.nix index 1b2a5f32d231..139242a15fc2 100644 --- a/modules/services/linux-wallpaperengine.nix +++ b/modules/services/linux-wallpaperengine.nix @@ -10,7 +10,7 @@ let cfg = config.services.linux-wallpaperengine; in { - meta.maintainers = [ lib.hm.maintainers.ckgxrg ]; + meta.maintainers = [ lib.maintainers.ckgxrg ]; options.services.linux-wallpaperengine = { enable = lib.mkEnableOption "linux-wallpaperengine, an implementation of Wallpaper Engine functionality"; diff --git a/tests/modules/programs/pomo/default.nix b/tests/modules/programs/pomo/default.nix new file mode 100644 index 000000000000..03bbd034db15 --- /dev/null +++ b/tests/modules/programs/pomo/default.nix @@ -0,0 +1,4 @@ +{ + pomo-empty-settings = ./empty-settings.nix; + pomo-example-settings = ./example-settings.nix; +} diff --git a/tests/modules/programs/pomo/empty-settings.nix b/tests/modules/programs/pomo/empty-settings.nix new file mode 100644 index 000000000000..d5c61a6b4a07 --- /dev/null +++ b/tests/modules/programs/pomo/empty-settings.nix @@ -0,0 +1,6 @@ +{ + programs.pomo.enable = true; + nmt.script = '' + assertPathNotExists home-files/.config/pomo + ''; +} diff --git a/tests/modules/programs/pomo/example-settings-expected.yaml b/tests/modules/programs/pomo/example-settings-expected.yaml new file mode 100644 index 000000000000..3d814b0ecbf5 --- /dev/null +++ b/tests/modules/programs/pomo/example-settings-expected.yaml @@ -0,0 +1,25 @@ +asciiArt: + color: '#5A56E0' + enabled: true + font: mono12 +break: + duration: 5m + notification: + enabled: true + message: back to work! + title: break over 😴 + urgent: false + title: break session +longBreak: + after: 4 + duration: 20m + enabled: true +onSessionEnd: ask +work: + duration: 25m + notification: + enabled: true + message: time to take a break + title: work finished πŸŽ‰ + urgent: false + title: work session diff --git a/tests/modules/programs/pomo/example-settings.nix b/tests/modules/programs/pomo/example-settings.nix new file mode 100644 index 000000000000..16adae7a0a51 --- /dev/null +++ b/tests/modules/programs/pomo/example-settings.nix @@ -0,0 +1,45 @@ +{ config, ... }: { + programs.pomo = { + enable = true; + package = config.lib.test.mkStubPackage { }; + settings = { + onSessionEnd = "ask"; + asciiArt = { + enabled = true; + font = "mono12"; + color = "#5A56E0"; + }; + work = { + duration = "25m"; + title = "work session"; + notification = { + enabled = true; + urgent = false; + title = "work finished πŸŽ‰"; + message = "time to take a break"; + }; + }; + break = { + duration = "5m"; + title = "break session"; + notification = { + enabled = true; + urgent = false; + title = "break over 😴"; + message = "back to work!"; + }; + }; + longBreak = { + enabled = true; + after = 4; + duration = "20m"; + }; + }; + }; + nmt.script = '' + local configFile=home-files/.config/pomo/pomo.yaml + + assertFileExists $configFile + assertFileContent $configFile ${./example-settings-expected.yaml} + ''; +}