feat: Add protonmail

This commit is contained in:
Kyle Brown 2023-11-17 12:52:51 -08:00
parent 6977732f76
commit eecbfec0ce
5 changed files with 73 additions and 6 deletions

View file

@ -10,6 +10,7 @@
./tmux.nix
./vim.nix
./zsh
../../modules/home-manager
];
nixpkgs.config.allowUnfree = true;

View file

@ -4,13 +4,8 @@
pkgs,
...
}: {
# gtk = {
# enable = true;
# theme = {
# name = "FlatColor";
# };
# };
home.packages = with pkgs; [
thunderbird
betterdiscordctl
gimp
gparted
@ -19,4 +14,9 @@
schildichat-desktop-wayland
sublime-music
];
services.protonmail-bridge = {
enable = true;
nonInteractive = true;
};
}

View file

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }:
{
imports = [
./protonmail.nix
];
}

View file

@ -0,0 +1,54 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.protonmail-bridge;
#Still need to integrate more closely with the email management capabilities of home-manager
in
{
##### interface
options = {
services.protonmail-bridge = {
enable = mkOption {
type = types.bool;
default = false;
description = "Whether to enable the Bridge.";
};
nonInteractive = mkOption {
type = types.bool;
default = false;
description = "Start Bridge entirely noninteractively";
};
logLevel = mkOption {
type = types.enum [ "panic" "fatal" "error" "warn" "info" "debug" "debug-client" "debug-server" ];
default = "info";
description = "The log level";
};
};
};
##### implementation
config = mkIf cfg.enable {
home.packages = [ pkgs.protonmail-bridge ];
systemd.user.services.protonmail-bridge = {
Unit = {
Description = "Protonmail Bridge";
After = [ "network.target" ];
};
Service = {
Restart = "always";
ExecStart = "${pkgs.protonmail-bridge}/bin/protonmail-bridge --no-window --log-level ${cfg.logLevel}" + optionalString (cfg.nonInteractive) " --noninteractive";
};
Install = {
WantedBy = [ "default.target" ];
};
};
};
}

View file

@ -0,0 +1,5 @@
{ config, lib, pkgs, ... }:
{
}