mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 13:39:46 +01:00
himalaya: add xdg desktop entry
This commit is contained in:
parent
ed33f985da
commit
357c1fdbd9
1 changed files with 36 additions and 24 deletions
|
@ -154,7 +154,8 @@ in {
|
||||||
config = lib.mkIf himalaya.enable {
|
config = lib.mkIf himalaya.enable {
|
||||||
home.packages = [ himalaya.package ];
|
home.packages = [ himalaya.package ];
|
||||||
|
|
||||||
xdg.configFile."himalaya/config.toml".source = let
|
xdg = {
|
||||||
|
configFile."himalaya/config.toml".source = let
|
||||||
enabledAccounts = lib.filterAttrs (_: account: account.himalaya.enable)
|
enabledAccounts = lib.filterAttrs (_: account: account.himalaya.enable)
|
||||||
config.accounts.email.accounts;
|
config.accounts.email.accounts;
|
||||||
accountsConfig = lib.mapAttrs mkAccountConfig enabledAccounts;
|
accountsConfig = lib.mapAttrs mkAccountConfig enabledAccounts;
|
||||||
|
@ -162,10 +163,22 @@ in {
|
||||||
allConfig = globalConfig // { accounts = accountsConfig; };
|
allConfig = globalConfig // { accounts = accountsConfig; };
|
||||||
in tomlFormat.generate "himalaya-config.toml" allConfig;
|
in tomlFormat.generate "himalaya-config.toml" allConfig;
|
||||||
|
|
||||||
systemd.user.services =
|
desktopEntries.himalaya = lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
|
||||||
|
type = "Application";
|
||||||
|
name = "himalaya";
|
||||||
|
genericName = "Email Client";
|
||||||
|
comment = "CLI to manage emails";
|
||||||
|
terminal = true;
|
||||||
|
exec = "himalaya %u";
|
||||||
|
categories = [ "Network" ];
|
||||||
|
mimeType = [ "x-scheme-handler/mailto" "message/rfc822" ];
|
||||||
|
settings = { Keywords = "email"; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services."himalaya-watch@" =
|
||||||
let inherit (config.services.himalaya-watch) enable environment;
|
let inherit (config.services.himalaya-watch) enable environment;
|
||||||
in {
|
in lib.mkIf enable {
|
||||||
"himalaya-watch@" = lib.mkIf enable {
|
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Email client Himalaya CLI envelopes watcher service";
|
Description = "Email client Himalaya CLI envelopes watcher service";
|
||||||
After = [ "network.target" ];
|
After = [ "network.target" ];
|
||||||
|
@ -182,5 +195,4 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue