mirror of
https://github.com/srid/nixos-config.git
synced 2026-05-11 17:36:07 +08:00
Create email feature
This commit is contained in:
parent
3e47c41cdd
commit
c0f519099b
5 changed files with 30 additions and 198 deletions
6
features/email/default.nix
Normal file
6
features/email/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ pkgs, ... }: {
|
||||
imports = [
|
||||
./protonmail-bridge.nix
|
||||
./himalaya-client.nix
|
||||
];
|
||||
}
|
||||
17
features/email/himalaya-client.nix
Normal file
17
features/email/himalaya-client.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
environment.systemPackages =
|
||||
let
|
||||
# FIXME: This leads to forbidden error
|
||||
# himalaya = toString inputs.himalaya.defaultApp."${system}".program;
|
||||
# Wrap himalaya to be aware of ProtonMail's bridge cert.
|
||||
himalayaWithSslEnv =
|
||||
pkgs.writeScriptBin "h" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
export SSL_CERT_FILE=~/.config/protonmail/bridge/cert.pem
|
||||
exec nix run github:srid/himalaya/nixify $*
|
||||
'';
|
||||
in
|
||||
[
|
||||
himalayaWithSslEnv
|
||||
];
|
||||
}
|
||||
17
features/email/protonmail-bridge.nix
Normal file
17
features/email/protonmail-bridge.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ pkgs, ... }: {
|
||||
environment.systemPackages = [ pkgs.protonmail-bridge ];
|
||||
services.gnome3.gnome-keyring.enable = true;
|
||||
|
||||
# Before starting the service, use `protonmail-bridge --cli` and run 'login'
|
||||
# to configure.
|
||||
systemd.user.services.protonmail-bridge = {
|
||||
description = "Protonmail Bridge";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "default.target" ];
|
||||
path = [ pkgs.pass ];
|
||||
serviceConfig = {
|
||||
Restart = "always";
|
||||
ExecStart = "${pkgs.protonmail-bridge}/bin/protonmail-bridge --noninteractive";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue