Add Element profiles
This commit is contained in:
parent
9fd3c86cbb
commit
63d1a68672
1 changed files with 35 additions and 0 deletions
|
|
@ -1,7 +1,42 @@
|
|||
{ nixosConfig, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
profiles = {
|
||||
"digitaler-dienst" = {
|
||||
description = "Digitaler Dienst";
|
||||
};
|
||||
"private" = {
|
||||
description = "private";
|
||||
};
|
||||
};
|
||||
in
|
||||
lib.mkIf nixosConfig.jalr.gui.enable {
|
||||
home.packages = with pkgs; [
|
||||
element-desktop
|
||||
];
|
||||
|
||||
# Create an empty directory in nix store
|
||||
# as we want to use Element only with `--profile-dir`
|
||||
xdg.configFile.Element = {
|
||||
source = pkgs.runCommand "empty-Element-directory" { } "mkdir $out";
|
||||
target = "Element";
|
||||
};
|
||||
|
||||
|
||||
xdg.desktopEntries = lib.attrsets.mapAttrs'
|
||||
(name: value: lib.attrsets.nameValuePair "element-desktop-${name}"
|
||||
{
|
||||
categories = [ "Network" "InstantMessaging" "Chat" ];
|
||||
exec = toString (pkgs.writeShellScript "element-desktop-${name}" ''
|
||||
exec element-desktop --profile-dir "$HOME/.config/element-profiles/${name}"
|
||||
'');
|
||||
genericName = "Matrix Client";
|
||||
icon = "element";
|
||||
mimeType = [ "x-scheme-handler/element" ];
|
||||
name = "Element ${value.description}";
|
||||
terminal = false;
|
||||
type = "Application";
|
||||
}
|
||||
)
|
||||
profiles;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue