feat: add pimalaya profile
This commit is contained in:
parent
6913bb4ee3
commit
d2a4ec7f03
9 changed files with 638 additions and 29 deletions
106
modules/profiles/pimalaya.nix
Normal file
106
modules/profiles/pimalaya.nix
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.profiles.pimalaya;
|
||||
in
|
||||
|
||||
{
|
||||
options.my.profiles.pimalaya.enable = mkEnableOption "Pimalaya email stuff";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
my = {
|
||||
services.mirador = {
|
||||
enable = true;
|
||||
package = inputs.mirador.packages.${pkgs.system}.default.overrideAttrs (old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.installShellFiles ];
|
||||
postInstall = old.postInstall + ''
|
||||
installShellCompletion --cmd mirador \
|
||||
--bash <($out/bin/mirador completion bash) \
|
||||
--fish <($out/bin/mirador completion fish) \
|
||||
--zsh <($out/bin/mirador completion zsh)
|
||||
'';
|
||||
});
|
||||
settings.accounts.personal = {
|
||||
default = true;
|
||||
folder = "INBOX";
|
||||
backend.type = "imap";
|
||||
backend.host = "mail.your-server.de";
|
||||
backend.port = 993;
|
||||
backend.encryption = "tls";
|
||||
backend.login = "mail@moritzboeh.me";
|
||||
backend.auth.type = "password";
|
||||
backend.auth.command = "cat /run/agenix/email";
|
||||
on-message-added.cmd = "systemctl start --user neverest.service";
|
||||
on-message-added.notify.summary = "📫 New message from {sender}";
|
||||
on-message-added.notify.body = "{subject}";
|
||||
};
|
||||
};
|
||||
services.neverest = {
|
||||
enable = true;
|
||||
package = inputs.neverest.packages.${pkgs.system}.default.overrideAttrs (old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.installShellFiles ];
|
||||
postInstall = old.postInstall + ''
|
||||
installShellCompletion --cmd neverest \
|
||||
--bash <($out/bin/neverest completion bash) \
|
||||
--fish <($out/bin/neverest completion fish) \
|
||||
--zsh <($out/bin/neverest completion zsh)
|
||||
'';
|
||||
});
|
||||
settings.accounts.personal = {
|
||||
default = true;
|
||||
left.backend.type = "imap";
|
||||
left.backend.host = "mail.your-server.de";
|
||||
left.backend.port = 993;
|
||||
left.backend.encryption = "tls";
|
||||
left.backend.login = "mail@moritzboeh.me";
|
||||
left.backend.auth.type = "password";
|
||||
left.backend.auth.command = "cat /run/agenix/email";
|
||||
right.backend.type = "maildir";
|
||||
right.backend.root-dir = "/home/moritz/Documents/Mail/personal";
|
||||
right.backend.maildirpp = false;
|
||||
right.folder.aliases.inbox = "INBOX";
|
||||
right.folder.aliases.sent = "Sent";
|
||||
right.folder.aliases.drafts = "Drafts";
|
||||
right.folder.aliases.trash = "Trash";
|
||||
};
|
||||
};
|
||||
programs.himalaya = {
|
||||
enable = true;
|
||||
package = inputs.himalaya.packages.${pkgs.system}.default.overrideAttrs (old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.installShellFiles ];
|
||||
postInstall = old.postInstall + ''
|
||||
installShellCompletion --cmd himalaya \
|
||||
--bash <($out/bin/himalaya completion bash) \
|
||||
--fish <($out/bin/himalaya completion fish) \
|
||||
--zsh <($out/bin/himalaya completion zsh)
|
||||
'';
|
||||
});
|
||||
settings.accounts.personal = {
|
||||
default = true;
|
||||
email = "mail@moritzboeh.me";
|
||||
display-name = "Moritz Böhme";
|
||||
downloads-dir = "/home/moritz/Downloads";
|
||||
backend.type = "maildir";
|
||||
backend.root-dir = "/home/moritz/Documents/Mail/personal";
|
||||
backend.maildirpp = false;
|
||||
folder.aliases.inbox = "INBOX";
|
||||
folder.aliases.sent = "Sent";
|
||||
folder.aliases.drafts = "Drafts";
|
||||
folder.aliases.trash = "Trash";
|
||||
message.send.backend.type = "smtp";
|
||||
message.send.backend.host = "mail.your-server.de";
|
||||
message.send.backend.port = 465;
|
||||
message.send.backend.login = "mail@moritzboeh.me";
|
||||
message.send.backend.encryption.type = "tls";
|
||||
message.send.backend.auth.type = "password";
|
||||
message.send.backend.auth.command = "cat /run/agenix/email";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
30
modules/programs/himalaya.nix
Normal file
30
modules/programs/himalaya.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.himalaya;
|
||||
toml = pkgs.formats.toml { };
|
||||
in
|
||||
{
|
||||
options.my.programs.himalaya.enable = mkEnableOption "himalaya";
|
||||
options.my.programs.himalaya.package = mkPackageOption pkgs "himalaya" { };
|
||||
options.my.programs.himalaya.settings = mkOption {
|
||||
inherit (toml) type;
|
||||
default = { };
|
||||
apply = toml.generate "config.toml";
|
||||
};
|
||||
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz.xdg.configFile."himalaya/config.toml".source = cfg.settings;
|
||||
home-manager.users.moritz.home.packages = [ cfg.package ];
|
||||
age.secrets.email = {
|
||||
file = ../../secrets/email.age;
|
||||
owner = "1000";
|
||||
};
|
||||
};
|
||||
}
|
||||
23
modules/programs/nvim/new_plugins/himalaya-vim.nix
Normal file
23
modules/programs/nvim/new_plugins/himalaya-vim.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = lib.mkIf config.my.programs.himalaya.enable {
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
# himalaya-vim
|
||||
inputs.himalaya-vim.packages.${pkgs.system}.default
|
||||
];
|
||||
extraConfigLuaPost = ''
|
||||
vim.g.himalaya_folder_picker = "telescope";
|
||||
'';
|
||||
autoCmd = [
|
||||
{
|
||||
command = "set modifiable";
|
||||
event = [ "FileType" ];
|
||||
pattern = [ "himalaya-email-listing" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
50
modules/services/mirador.nix
Normal file
50
modules/services/mirador.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.services.mirador;
|
||||
toml = pkgs.formats.toml { };
|
||||
in
|
||||
{
|
||||
options.my.services.mirador = {
|
||||
enable = mkEnableOption "mirador";
|
||||
package = mkPackageOption pkgs "mirador" { };
|
||||
settings = mkOption {
|
||||
inherit (toml) type;
|
||||
default = { };
|
||||
apply = toml.generate "config.toml";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz = {
|
||||
xdg.configFile."mirador/config.toml".source = cfg.settings;
|
||||
home.packages = [ cfg.package ];
|
||||
systemd.user.services.mirador = {
|
||||
Unit = {
|
||||
Description = "CLI to watch mailbox changes";
|
||||
};
|
||||
Service = {
|
||||
# Lower CPU and I/O priority
|
||||
Nice = 19;
|
||||
IOSchedulingClass = "best-effort";
|
||||
IOSchedulingPriority = 7;
|
||||
IOWeight = 100;
|
||||
|
||||
ExecStart = ''
|
||||
${lib.getExe cfg.package} watch
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
age.secrets.email = {
|
||||
file = ../../secrets/email.age;
|
||||
owner = "1000";
|
||||
};
|
||||
};
|
||||
}
|
||||
71
modules/services/neverest.nix
Normal file
71
modules/services/neverest.nix
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.services.neverest;
|
||||
toml = pkgs.formats.toml { };
|
||||
in
|
||||
{
|
||||
options.my.services.neverest = {
|
||||
enable = mkEnableOption "neverest";
|
||||
package = mkPackageOption pkgs "neverest" { };
|
||||
frequency = mkOption {
|
||||
type = types.str;
|
||||
default = "hourly";
|
||||
description = ''
|
||||
How often to run neverest when
|
||||
`services.neverest.enable = true`.
|
||||
This value is passed to the systemd timer configuration as
|
||||
the onCalendar option. See
|
||||
{manpage}`systemd.time(7)`
|
||||
for more information about the format.
|
||||
'';
|
||||
};
|
||||
settings = mkOption {
|
||||
inherit (toml) type;
|
||||
default = { };
|
||||
apply = toml.generate "config.toml";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz = {
|
||||
xdg.configFile."neverest/config.toml".source = cfg.settings;
|
||||
home.packages = [ cfg.package ];
|
||||
systemd.user.timers.neverest = {
|
||||
Unit.Description = "Run neverest";
|
||||
Timer = {
|
||||
OnCalendar = cfg.frequency;
|
||||
Persistent = true;
|
||||
RandomizedDelaySec = "10m";
|
||||
};
|
||||
Install.WantedBy = [ "timers.target" ];
|
||||
};
|
||||
systemd.user.services.neverest = {
|
||||
Unit = {
|
||||
Description = "CLI to synchronize, backup and restore emails";
|
||||
};
|
||||
Service = {
|
||||
# Lower CPU and I/O priority
|
||||
Nice = 19;
|
||||
IOSchedulingClass = "best-effort";
|
||||
IOSchedulingPriority = 7;
|
||||
IOWeight = 100;
|
||||
|
||||
ExecStart = ''
|
||||
${lib.getExe cfg.package} synchronize
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
age.secrets.email = {
|
||||
file = ../../secrets/email.age;
|
||||
owner = "1000";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue