Replace Element and Telegram with Ferdium

This commit is contained in:
Jakob Lechner 2025-01-14 16:50:31 +01:00
parent 20857a4fa2
commit 935e5e367d
4 changed files with 15 additions and 63 deletions

View file

@ -2,8 +2,7 @@
{
imports = [
./element-desktop.nix
./ferdium.nix
./mumble.nix
./telegram-desktop.nix
];
}

View file

@ -1,54 +0,0 @@
{ nixosConfig, lib, pkgs, ... }:
let
profiles = {
"digitaler-dienst" = {
description = "Digitaler Dienst";
icon = pkgs.fetchurl {
url = "https://matrix.digitaler-dienst.gmbh/_matrix/media/v3/thumbnail/digitaler-dienst.gmbh/kfUmmNxpmbsLtdIRvZcxkWAh?width=256&height=256";
sha256 = "uSxx9avx3I/rDzFnwgEZUwLVktsTeZiSWcDHjPzcUtw=";
};
};
"private" = {
description = "private";
};
};
in
lib.mkIf nixosConfig.jalr.gui.enable {
# 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}" (
let
package = (
if value ? icon then
pkgs.element-desktop.overrideAttrs
(oldAttrs: {
patchPhase = oldAttrs.patchPhase or "" + ''
rm build/icons/* res/img/*
cp ${value.icon} res/img/element.png
'';
})
else pkgs.element-desktop
);
in
{
categories = [ "Network" "InstantMessaging" "Chat" ];
exec = toString (pkgs.writeShellScript "element-desktop-${name}" ''
exec "${package}/bin/element-desktop" --profile-dir "$HOME/.config/element-profiles/${name}"
'');
genericName = "Matrix Client";
icon = "${package}/share/element/img/element.png";
mimeType = [ "x-scheme-handler/element" ];
name = "Element ${value.description}";
terminal = false;
type = "Application";
}
))
profiles;
}

View file

@ -0,0 +1,14 @@
{ nixosConfig, lib, ... }:
lib.mkIf nixosConfig.jalr.gui.enable {
xdg.desktopEntries.Ferdium = {
name = "Ferdium";
exec = "flatpak run --branch=stable --arch=x86_64 --command=ferdium --file-forwarding org.ferdium.Ferdium @@u %U @@";
terminal = false;
type = "Application";
icon = "org.ferdium.Ferdium";
comment = "Desktop app bringing all your messaging services into one installable";
mimeType = [ "x-scheme-handler/ferdium" ];
categories = [ "Network" "InstantMessaging" ];
};
}

View file

@ -1,7 +0,0 @@
{ nixosConfig, lib, pkgs, ... }:
lib.mkIf nixosConfig.jalr.gui.enable {
home.packages = with pkgs; [
tdesktop
];
}