Commit eef91fe0ea15
Changed files (5)
home
common
desktop
niri
services
pkgs
nextmeeting
systems
kyushu
home/common/desktop/niri/waybar.nix
@@ -1,4 +1,5 @@
-_: {
+{ lib, pkgs, ... }:
+{
programs.waybar = {
enable = true;
settings = {
@@ -8,8 +9,8 @@ _: {
"modules-left" = [
"tray"
"custom/separator"
+ "custom/agenda"
# "niri/workspaces"
- # "custom/agenda"
];
"modules-center" = [
"clock"
@@ -28,6 +29,15 @@ _: {
"interval" = "once";
"tooltip" = false;
};
+ "custom/agenda" = {
+ "format" = "{}";
+ "exec" =
+ "${lib.getExe pkgs.nextmeeting} --calendar=vdemeest@redhat.com --max-title-length 30 --waybar --notify-min-before-events 5";
+ "on-click" = "${lib.getExe pkgs.nextmeeting} --calendar=vdemeest@redhat.com --open-meet-url";
+ "interval" = 59;
+ "return-type" = "json";
+ "tooltip" = true;
+ };
"clock" = {
"format" = "{:%a %d %b %H:%M}";
"tooltip-format" = "<tt><small>{calendar}</small></tt>";
home/common/services/nextmeeting.nix
@@ -0,0 +1,77 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+
+with lib;
+
+let
+ cfg = config.services.nextmeeting;
+ tomlFormat = pkgs.formats.toml { };
+in
+{
+ options.services.nextmeeting = {
+ enable = mkEnableOption "nextmeeting calendar widget for waybar";
+
+ package = mkOption {
+ type = types.package;
+ default = pkgs.nextmeeting;
+ description = "The nextmeeting package to use";
+ };
+
+ settings = mkOption {
+ type = tomlFormat.type;
+ default = { };
+ example = literalExpression ''
+ {
+ nextmeeting = {
+ calendar = "Work";
+ max-title-length = 30;
+ today-only = true;
+ };
+ }
+ '';
+ description = "Configuration for nextmeeting in TOML format";
+ };
+
+ waybar = {
+ enable = mkOption {
+ type = types.bool;
+ default = true;
+ description = "Enable waybar integration";
+ };
+
+ maxTitleLength = mkOption {
+ type = types.int;
+ default = 30;
+ description = "Maximum title length for waybar display";
+ };
+
+ notifyMinBefore = mkOption {
+ type = types.int;
+ default = 5;
+ description = "Minutes before meeting to trigger 'soon' class";
+ };
+
+ extraArgs = mkOption {
+ type = types.listOf types.str;
+ default = [ ];
+ example = [
+ "--calendar=Work"
+ "--google-domain=example.com"
+ ];
+ description = "Extra arguments to pass to nextmeeting";
+ };
+ };
+ };
+
+ config = mkIf cfg.enable {
+ home.packages = [ cfg.package ];
+
+ xdg.configFile."nextmeeting/config.toml" = mkIf (cfg.settings != { }) {
+ source = tomlFormat.generate "nextmeeting-config" cfg.settings;
+ };
+ };
+}
pkgs/nextmeeting/default.nix
@@ -0,0 +1,40 @@
+{
+ lib,
+ buildPythonPackage,
+ fetchFromGitHub,
+ hatchling,
+ python-dateutil,
+ caldav,
+}:
+
+buildPythonPackage rec {
+ pname = "nextmeeting";
+ version = "3.0.0";
+ pyproject = true;
+
+ src = fetchFromGitHub {
+ owner = "chmouel";
+ repo = "nextmeeting";
+ rev = version;
+ hash = "sha256-lw1orSZ6Wbr9u5kr6t7B70AbWNeESnD0M+NjBg9tT5g=";
+ };
+
+ build-system = [ hatchling ];
+
+ dependencies = [
+ python-dateutil
+ caldav
+ ];
+
+ pythonImportsCheck = [ "nextmeeting" ];
+
+ # Tests require gcalcli setup
+ doCheck = false;
+
+ meta = {
+ description = "Show your Google Calendar next meeting in waybar/polybar";
+ homepage = "https://github.com/chmouel/nextmeeting";
+ license = lib.licenses.asl20;
+ mainProgram = "nextmeeting";
+ };
+}
pkgs/default.nix
@@ -43,6 +43,7 @@ in
review-tool = pkgs.callPackage ../tools/review-tool { };
beets-lidarr-fields = pkgs.python3Packages.callPackage ./beets-lidarr-fields { };
beets-filetote = pkgs.python3Packages.callPackage ./beets-filetote { };
+ nextmeeting = pkgs.python3Packages.callPackage ./nextmeeting { };
chmouzies-ai = pkgs.callPackage ./chmouzies/ai.nix { };
chmouzies-git = pkgs.callPackage ./chmouzies/git.nix { };
systems/kyushu/home.nix
@@ -34,6 +34,7 @@ in
gmailctl
gcalcli
+ nextmeeting
calibre