hostnames and user settings

This commit is contained in:
Noah Masur
2025-02-08 12:58:06 -05:00
parent 9c5de4c54f
commit 61b1ceffd9
45 changed files with 253 additions and 275 deletions

View File

@ -0,0 +1,49 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.nmasur.presets.programs.calendar;
in
{
options.nmasur.presets.programs.calendar = {
enable = lib.mkEnableOption "Calendar application";
username = lib.mkOption {
type = lib.types.str;
description = "Username for the calendar service backend";
default = config.nmasur.settings.username;
};
hostname = lib.mkOption {
type = lib.types.str;
description = "Hostname for the calendar service backend";
};
url = lib.mkOption {
type = lib.types.str;
description = "Username for the calendar service backend";
default = "https://${cfg.hostname}/remote.php/dav/principals/users/${cfg.username}";
};
};
config = lib.mkIf cfg.enable {
accounts.calendar.accounts.default = {
basePath = "other/calendars"; # Where to save calendars in ~ directory
name = "personal";
local.type = "filesystem";
primary = true;
remote = {
passwordCommand = [ "" ];
type = "caldav";
url = cfg.url;
userName = cfg.username;
};
};
home.packages = [ pkgs.gnome-calendar ];
};
}