From 63fa9e508b9629dde9e26ee66e7f7774bd16801d Mon Sep 17 00:00:00 2001 From: Aiden Schembri Date: Thu, 22 Oct 2026 10:15:52 +0200 Subject: [PATCH] nixos/dux-calendar: add module --- nixos/modules/module-list.nix | 1 + nixos/modules/programs/dux-calendar.nix | 54 +++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 nixos/modules/programs/dux-calendar.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 06dafe409f6b..8c13f34c8250 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -210,6 +210,7 @@ ./programs/dmrconfig.nix ./programs/droidcam.nix ./programs/dublin-traceroute.nix + ./programs/dux-calendar.nix ./programs/dux-search.nix ./programs/ente-auth.nix ./programs/environment.nix diff --git a/nixos/modules/programs/dux-calendar.nix b/nixos/modules/programs/dux-calendar.nix new file mode 100644 index 000000000000..6f309798491b --- /dev/null +++ b/nixos/modules/programs/dux-calendar.nix @@ -0,0 +1,54 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.programs.dux-calendar; +in +{ + options.programs.dux-calendar = { + enable = lib.mkEnableOption "Dux Calendar, a standalone calendar application"; + + package = lib.mkPackageOption pkgs "dux-calendar" { }; + + quickshell.package = lib.mkPackageOption pkgs "quickshell" { + extraDescription = "The Quickshell package used to run the calendar interface."; + }; + + systemd = { + enable = lib.mkEnableOption "starting Dux Calendar with the graphical session"; + + target = lib.mkOption { + type = lib.types.str; + default = "graphical-session.target"; + example = "wayland-session.target"; + description = "The systemd user target that starts Dux Calendar."; + }; + + restartIfChanged = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Whether to restart the Dux Calendar user service when its package or configuration changes."; + }; + }; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = [ + cfg.package + cfg.quickshell.package + ]; + + systemd.packages = lib.mkIf cfg.systemd.enable [ cfg.package ]; + systemd.user.services.dcal = lib.mkIf cfg.systemd.enable { + wantedBy = [ cfg.systemd.target ]; + restartIfChanged = cfg.systemd.restartIfChanged; + path = [ cfg.quickshell.package ]; + }; + }; + + meta.teams = [ lib.teams.duxlabs ]; +}