diff --git a/platforms/home-manager/modules/nmasur/presets/programs/calendar.nix b/platforms/home-manager/modules/nmasur/presets/programs/calendar.nix index 6056a19..4979d66 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/calendar.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/calendar.nix @@ -32,7 +32,6 @@ in 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; diff --git a/platforms/home-manager/modules/nmasur/presets/programs/thunderbird/taskspass.age b/platforms/home-manager/modules/nmasur/presets/programs/thunderbird/taskspass.age new file mode 100644 index 0000000..55d81f0 --- /dev/null +++ b/platforms/home-manager/modules/nmasur/presets/programs/thunderbird/taskspass.age @@ -0,0 +1,17 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBTYTRy +elYzTGpSNDQ3UEcwTXlVeGJleUJmWWhaeDdDQTFRcGpmNlNrQlNVCjA5L2JrS3Vx +Q0cyRkk5dTBLOHJXa0xJSG9MTDFnNjV1M0F5L3F5RUlVbW8KLT4gc3NoLWVkMjU1 +MTkgWXlTVU1RIG5vNm1Xem9lN2pkS25WRi9xSlpZUjhuYmdUVDUvc2o4M0xqYURR +UmY0VGcKWVVQc2wyV0Jqbk9JR3N4bW5HOXFTZHpCa25EMC85eThQY05MdHdaeXZy +VQotPiBzc2gtZWQyNTUxOSBuanZYNUEgWXRVa3c4STZ3WmFaNThSdE1QdVpiMVR1 +cm5hYXJsckZiRGtXLzN5RzJEawpkVHBscFd2c0R1SGxnZ3lKUnNnMEZtTUxoQlB4 +dVBEbTkvUzBJSVRiV1hBCi0+IHNzaC1lZDI1NTE5IENxSU9VQSAvQjhVam1heHNU +elVrVGtvaUx1elFCeTdNTkRnN3c5NEc5MWg4dDU3NUhzCm5sUlhHclJrNldnVDhF +MTV2cGd3ZFhFdm1rM2ExWVFXbkNJYWlWY0VnUmsKLT4gc3NoLWVkMjU1MTkgejFP +Y1p3IGc1QUdkZEp0Z0xEekFjcHd4WVFVam9BZTBEQm9NR3QzQmxNS09VVXpHV2sK +c2tYSElVK2prRlF3VlFqKzlVUFRHUWU3TmFXcEdsV2FKWVhKT3pWZkxVNAotLS0g +c1cxdk5sL1c3dDZuVGp5VWJrTlBGZTByNjRxMGxTdHd0NFNHV1pyN2k5Ywr7SW9q +/FaTTUHB5QiCihA+385sNogq7Q1RvgT2Dwn9NdmMRd/ObESbokJXVSiDDEt6d39s +D/uoDY20p3PCk4julNn1 +-----END AGE ENCRYPTED FILE----- diff --git a/platforms/home-manager/modules/nmasur/presets/programs/thunderbird/thunderbird.nix b/platforms/home-manager/modules/nmasur/presets/programs/thunderbird/thunderbird.nix new file mode 100644 index 0000000..ed62728 --- /dev/null +++ b/platforms/home-manager/modules/nmasur/presets/programs/thunderbird/thunderbird.nix @@ -0,0 +1,106 @@ +{ + config, + pkgs, + lib, + ... +}: + +let + inherit (config.nmasur.settings) hostnames; + cfg = config.nmasur.presets.programs.thunderbird; +in + +{ + + options.nmasur.presets.programs.thunderbird = { + enable = lib.mkEnableOption "Thunderbird email client"; + calendar = { + username = lib.mkOption { + type = lib.types.str; + description = "Username for the calendar service backend"; + default = config.nmasur.settings.username; + }; + passwordCommand = lib.mkOption { + type = lib.types.str; + description = "Password for the calendar service backend"; + default = config.accounts.email.accounts.home.passwordCommand; + }; + hostname = lib.mkOption { + type = lib.types.str; + description = "Hostname for the calendar service backend"; + default = hostnames.content; + }; + url = lib.mkOption { + type = lib.types.str; + description = "URL for the calendar service backend"; + default = "https://${cfg.calendar.hostname}/remote.php/dav"; + }; + }; + tasks = { + username = lib.mkOption { + type = lib.types.str; + description = "Username for the tasks service backend"; + default = config.nmasur.settings.username; + }; + passwordCommand = lib.mkOption { + type = lib.types.str; + description = "Password for the tasks service backend"; + default = "${lib.getExe pkgs.age} --decrypt --identity ~/.ssh/id_ed25519 ${pkgs.writeText "taskspass.age" (builtins.readFile ./taskspass.age)}"; + }; + hostname = lib.mkOption { + type = lib.types.str; + description = "Hostname for the tasks service backend"; + default = hostnames.content; + }; + url = lib.mkOption { + type = lib.types.str; + description = "URL for the tasks service backend"; + default = "https://${cfg.tasks.hostname}/remote.php/dav"; + }; + }; + }; + + config = lib.mkIf cfg.enable { + + programs.thunderbird = { + enable = true; + profiles.default = { + isDefault = true; + }; + }; + accounts.email.accounts.home.thunderbird = { + enable = true; + profiles = [ "default" ]; + }; + accounts.calendar.basePath = "other/calendars"; # Where to save calendars in ~ directory + # accounts.calendar.accounts.home = { + # local.type = "filesystem"; + # primary = true; + # remote = { + # passwordCommand = [ cfg.calendar.passwordCommand ]; + # type = "caldav"; + # url = cfg.calendar.url; + # userName = cfg.calendar.username; + # }; + # thunderbird = { + # enable = true; + # profiles = [ "default" ]; + # }; + # }; + # accounts.calendar.accounts.tasks = { + # local.type = "filesystem"; + # primary = false; + # remote = { + # passwordCommand = [ cfg.tasks.passwordCommand ]; + # type = "caldav"; + # url = cfg.tasks.url; + # userName = cfg.tasks.username; + # }; + # thunderbird = { + # enable = true; + # profiles = [ "default" ]; + # }; + # }; + + }; +} diff --git a/platforms/home-manager/modules/nmasur/profiles/linux-gui.nix b/platforms/home-manager/modules/nmasur/profiles/linux-gui.nix index 6e545d8..5ac6af2 100644 --- a/platforms/home-manager/modules/nmasur/profiles/linux-gui.nix +++ b/platforms/home-manager/modules/nmasur/profiles/linux-gui.nix @@ -32,6 +32,7 @@ in nsxiv.enable = lib.mkDefault true; obsidian.enable = lib.mkDefault true; rofi.enable = lib.mkDefault true; + thunderbird.enable = lib.mkDefault true; xclip.enable = lib.mkDefault true; zathura.enable = lib.mkDefault true; };