diff --git a/home/NixOs.nix b/home/NixOs.nix index 5e8ae89..b34b5ab 100644 --- a/home/NixOs.nix +++ b/home/NixOs.nix @@ -11,7 +11,7 @@ let cfg = config.home.nixos; env = import ./env args; file = import ./file args; - programs = import ./program args; + program = import ./program args; in { imports = (util.ls ); @@ -34,6 +34,10 @@ in acc // { ${user.username} = { + accounts = import ./account args; + dconf.settings = util.catSet (util.ls ./file/dconf) args; + programs = with program; core // desktop; + xdg = import ./xdg { inherit (user) homeDirectory; }; home = { inherit (config.const) stateVersion; inherit (env) sessionVariables; @@ -43,9 +47,6 @@ in # ISSUE: https://github.com/nix-community/home-manager/issues/5589 extraActivationPath = with pkgs; [ openssh ]; }; - xdg = import ./xdg { inherit (user) homeDirectory; }; - programs = with programs; core // desktop; - dconf.settings = util.catSet (util.ls ./file/dconf) args; }; } ) { } cfg.users; diff --git a/home/account/default.nix b/home/account/default.nix new file mode 100644 index 0000000..faf884e --- /dev/null +++ b/home/account/default.nix @@ -0,0 +1,88 @@ +{ ... }: +let + mkMail = cfg: cfg // { thunderbird.enable = true; }; + + mkHomeMail = + cfg: + mkMail ( + cfg + // { + imap = { + host = "mail.voronind.com"; + port = 993; + tls.enable = true; + }; + smtp = { + host = "mail.voronind.com"; + port = 465; + tls.enable = true; + }; + } + ); + + mkHomeCalendar = { + remote = { + type = "caldav"; + url = "https://dav.voronind.com"; + userName = "voronind"; + }; + }; + + realName = "Dmitry Voronin"; +in +{ + email.accounts = { + Account = mkHomeMail { + inherit realName; + primary = true; + address = "account@voronind.com"; + userName = "account@voronind.com"; + }; + Personal = mkHomeMail { + inherit realName; + address = "hi@voronind.com"; + userName = "hi@voronind.com"; + }; + Admin = mkHomeMail { + inherit realName; + address = "admin@voronind.com"; + userName = "admin@voronind.com"; + }; + Job = mkHomeMail { + inherit realName; + address = "job@voronind.com"; + userName = "job@voronind.com"; + }; + Trash = mkHomeMail { + inherit realName; + address = "trash@voronind.com"; + userName = "trash@voronind.com"; + }; + }; + + # ISSUE: https://github.com/nix-community/home-manager/issues/5775 + calendar.accounts = { + default = mkHomeCalendar // { + primary = true; + }; + family = mkHomeCalendar; + health = mkHomeCalendar; + high = mkHomeCalendar; + holiday = mkHomeCalendar; + low = mkHomeCalendar; + medium = mkHomeCalendar; + payment = mkHomeCalendar; + work = mkHomeCalendar; + }; + + # ISSUE: https://github.com/nix-community/home-manager/issues/5933 + contact.accounts = { + Home = { + remote = { + type = "carddav"; + url = "https://dav.voronind.com"; + userName = "voronind"; + }; + }; + }; +} diff --git a/home/program/default.nix b/home/program/default.nix index 0c81a7b..bea7907 100644 --- a/home/program/default.nix +++ b/home/program/default.nix @@ -30,5 +30,6 @@ in desktop = { chromium = import ./chromium args; firefox = import ./firefox args; + thunderbird = import ./thunderbird args; }; } diff --git a/home/program/firefox/default.nix b/home/program/firefox/default.nix index c57e8d0..186a6fe 100644 --- a/home/program/firefox/default.nix +++ b/home/program/firefox/default.nix @@ -69,6 +69,14 @@ let # (mkExtension "queryamoid@kaply.com" "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi") ]; + darkModeIgnore = [ + "cloud.voronind.com" + "git.voronind.com" + "github.com" + "home.voronind.com" + "dav.voronind.com" + ]; + prefs = [ # WARN: Remove when Dark Reader policies gets merged. (mkLockedPref "xpinstall.signatures.required" false) @@ -111,35 +119,35 @@ let ]; userChrome = '' - * { - font-family: "${config.module.style.font.serif.name}" !important; - font-size: ${toString config.module.style.font.size.application}pt !important; - } - ''; + * { + font-family: "${config.module.style.font.serif.name}" !important; + font-size: ${toString config.module.style.font.size.application}pt !important; + } + ''; userContent = '' - @-moz-document url(about:home), url(about:newtab), url(about:privatebrowsing), url(about:blank) { - .click-target-container *, .top-sites-list * { - color: #fff !important ; - text-shadow: 2px 2px 2px #222 !important ; - } - body::before { - content: "" ; - z-index: -1 ; - position: fixed ; - top: 0 ; - left: 0 ; - background: #f9a no-repeat url("${config.module.wallpaper.path}?raw=true") center ; - background-color: #222; - background-size: cover ; - /* filter: blur(4px) ; */ - width: 100vw ; - height: 100vh ; - } - /* .logo { background-image: url("{repo}/logo.png?raw=true") !important; } */ - /* .logo { background-image: none !important; } */ - } - ''; + @-moz-document url(about:home), url(about:newtab), url(about:privatebrowsing), url(about:blank) { + .click-target-container *, .top-sites-list * { + color: #fff !important ; + text-shadow: 2px 2px 2px #222 !important ; + } + body::before { + content: "" ; + z-index: -1 ; + position: fixed ; + top: 0 ; + left: 0 ; + background: #f9a no-repeat url("${config.module.wallpaper.path}?raw=true") center ; + background-color: #222; + background-size: cover ; + /* filter: blur(4px) ; */ + width: 100vw ; + height: 100vh ; + } + /* .logo { background-image: url("{repo}/logo.png?raw=true") !important; } */ + /* .logo { background-image: none !important; } */ + } + ''; mkExtension = id: install_url: { ${id} = { @@ -294,12 +302,7 @@ in previewNewDesign = true; syncSettings = true; syncSitesFixes = false; - disabledFor = [ - "cloud.voronind.com" - "git.voronind.com" - "github.com" - "home.voronind.com" - ]; + disabledFor = darkModeIgnore; theme = { brightness = 100; contrast = 100; diff --git a/home/program/thunderbird/default.nix b/home/program/thunderbird/default.nix new file mode 100644 index 0000000..cb19c3b --- /dev/null +++ b/home/program/thunderbird/default.nix @@ -0,0 +1,46 @@ +{ config, lib, ... }: +{ + enable = true; + profiles.default = { + isDefault = true; + withExternalGnupg = true; + }; + + # ISSUE: https://github.com/nix-community/home-manager/issues/5775 + # ISSUE: https://github.com/nix-community/home-manager/issues/5933 + # settings = + # let + # safeName = builtins.replaceStrings [ "." ] [ "-" ]; + # + # calendarAccounts = lib.mapAttrsToList (n: v: { n = v; }) config.home-manager.users.voronind.accounts.calendar.accounts; + # calendars = lib.foldAttrs ( + # item: acc: + # let + # calendarAccountSafeName = safeName item.name; + # in + # acc + # // { + # "calendar.registry.${calendarAccountSafeName}.cache.enabled" = true; + # "calendar.registry.${calendarAccountSafeName}.calendar-main-default" = item.primary; + # "calendar.registry.${calendarAccountSafeName}.calendar-main-in-composite" = item.primary; + # "calendar.registry.${calendarAccountSafeName}.name" = item.name; + # "calendar.registry.${calendarAccountSafeName}.type" = "caldav"; + # "calendar.registry.${calendarAccountSafeName}.uri" = item.remote.url; + # "calendar.registry.${calendarAccountSafeName}.username" = item.remote.userName; + # } + # ) { } calendarAccounts; + # + # contactsAccount = config.home-manager.users.voronind.accounts.contact.accounts.Home; + # contactsAccountSafeName = safeName contactsAccount.name; + # addressBookFilename = "abook-${contactsAccountSafeName}.sqlite"; + # in + # calendars + # // { + # "ldap_2.servers.${contactsAccountSafeName}.carddav.url" = contactsAccount.remote.url; + # "ldap_2.servers.${contactsAccountSafeName}.carddav.username" = contactsAccount.remote.userName; + # "ldap_2.servers.${contactsAccountSafeName}.description" = contactsAccount.name; + # "ldap_2.servers.${contactsAccountSafeName}.dirType" = 102; + # "ldap_2.servers.${contactsAccountSafeName}.filename" = addressBookFilename; + # "mail.collect_addressbook" = "jscarddav://${addressBookFilename}"; + # }; +}