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 ];
};
}

View File

@ -20,7 +20,7 @@ in
accounts.email.accounts.home.himalaya = {
enable = true;
settings = {
downloads-dir = config.userDirs.download;
downloads-dir = config.xdg.userDirs.download;
smtp-insecure = true;
};
};

View File

@ -26,9 +26,10 @@ in
];
programs.gh-dash.enable = true;
programs.gh-dash.enable = lib.mkDefault true;
programs.helix.enable = lib.mkDefault true;
programs.zed-editor.enable = lib.mkDefault true;
programs.himalaya.enable = lib.mkDefault true;
};

View File

@ -16,14 +16,14 @@ in
config = lib.mkIf cfg.enable {
# Allow Nix to manage the default applications list
mimeApps.enable = lib.mkDefault true;
xdg.mimeApps.enable = lib.mkDefault true;
# Set directories for application defaults
userDirs = {
xdg.userDirs = {
enable = lib.mkDefault true;
createDirectories = lib.mkDefault true;
documents = lib.mkDefault "$HOME/documents";
download = lib.mkDefault config.userDirs.download;
download = lib.mkDefault "$HOME/downloads";
music = lib.mkDefault "$HOME/media/music";
pictures = lib.mkDefault "$HOME/media/images";
videos = lib.mkDefault "$HOME/media/videos";