nixos-config/programs/desktop/ims.nix
Charlotte 🦝 Delenk 0e8bf03336
Some checks failed
Hydra packages.riscv64-linux.fish Hydra build #26231 of nixos-config:pr618:packages.riscv64-linux.fish
Hydra nixosConfigurations.rainbow-resort Hydra build #26252 of nixos-config:pr618:nixosConfigurations.rainbow-resort
Hydra packages.x86_64-linux.fish Hydra build #26232 of nixos-config:pr618:packages.x86_64-linux.fish
Hydra nixosConfigurations.not522 Hydra build #26249 of nixos-config:pr618:nixosConfigurations.not522
Hydra nixosConfigurations.not522-installer Hydra build #26250 of nixos-config:pr618:nixosConfigurations.not522-installer
Hydra nixosConfigurations.pc-installer Hydra build #26251 of nixos-config:pr618:nixosConfigurations.pc-installer
Hydra packages.aarch64-linux.fish Hydra build #26230 of nixos-config:pr618:packages.aarch64-linux.fish
Hydra nixosConfigurations.thinkrac Hydra build #26253 of nixos-config:pr618:nixosConfigurations.thinkrac
Hydra packages.riscv64-linux.package-updater Hydra build #25896 of nixos-config:pr618:packages.riscv64-linux.package-updater
create links for discord and element
2024-11-17 15:55:58 +01:00

69 lines
4.3 KiB
Nix

{
config,
pkgs,
lib,
systemConfig,
...
}:
{
home.packages = with pkgs; [
telegram-desktop
discord
element-desktop
];
home.persistence.default.directories = [
".local/share/TelegramDesktop"
".local/share/discord"
".local/share/Element"
];
systemd.user.tmpfiles.rules = lib.mkMerge [
[
"d /persistent${config.xdg.cacheHome}/TelegramDesktop/cache - - - - -"
"d /persistent${config.xdg.cacheHome}/TelegramDesktop/media_cache - - - - -"
"d /persistent${config.xdg.cacheHome}/discord - - - - -"
"d /persistent${config.xdg.cacheHome}/discord/Cache - - - - -"
"d /persistent${config.xdg.cacheHome}/discord/Code\x20Cache - - - - -"
"d /persistent${config.xdg.cacheHome}/discord/component_crx_cache - - - - -"
"d /persistent${config.xdg.cacheHome}/discord/DawnGraphiteCache - - - - -"
"d /persistent${config.xdg.cacheHome}/Element/Cache - - - - -"
"d /persistent${config.xdg.cacheHome}/Element/Code\x20Cache - - - - -"
"d /persistent${config.xdg.cacheHome}/Element/DawnGraphiteCache - - - - -"
"d /persistent${config.xdg.dataHome}/discord - - - - -"
"d /persistent${config.xdg.dataHome}/Element - - - - -"
"L /persistent${config.xdg.dataHome}/TelegramDesktop/tdata/user_data/cache - - - - ${config.xdg.cacheHome}/TelegramDesktop/cache"
"L /persistent${config.xdg.dataHome}/TelegramDesktop/tdata/user_data/media_cache - - - - ${config.xdg.cacheHome}/TelegramDesktop/media_cache"
"L /persistent${config.xdg.dataHome}/discord/Cache - - - - ${config.xdg.cacheHome}/discord/Cache"
"L /persistent${config.xdg.dataHome}/discord/Code\x20Cache - - - - ${config.xdg.cacheHome}/discord/Code\x20Cache"
"L /persistent${config.xdg.dataHome}/discord/component_crx_cache - - - - ${config.xdg.cacheHome}/discord/component_crx_cache"
"L /persistent${config.xdg.dataHome}/discord/DawnGraphiteCache - - - - ${config.xdg.cacheHome}/discord/DawnGraphiteCache"
"L /persistent${config.xdg.dataHome}/discord/userDataCache.json - - - - ${config.xdg.cacheHome}/discord/userDataCache.json"
"L /persistent${config.xdg.dataHome}/Element/Cache - - - - ${config.xdg.cacheHome}/Element/Cache"
"L /persistent${config.xdg.dataHome}/Element/Code\x20Cache - - - - ${config.xdg.cacheHome}/Element/Code\x20Cache"
"L /persistent${config.xdg.dataHome}/Element/DawnGraphiteCache - - - - ${config.xdg.cacheHome}/Element/DawnGraphiteCache"
"L ${config.xdg.configHome}/discord - - - - ${config.xdg.dataHome}/discord"
"L ${config.xdg.configHome}/Element - - - - ${config.xdg.dataHome}/Element"
]
# GPU Cache sometimes breaks for electron apps on intel, so only persist that on non-intel
(lib.mkIf (!systemConfig.isIntelGPU) [
"d /persistent${config.xdg.cacheHome}/discord/DawnWebGPUCache - - - - -"
"d /persistent${config.xdg.cacheHome}/discord/GPUCache - - - - -"
"d /persistent${config.xdg.cacheHome}/Element/DawnWebGPUCache - - - - -"
"d /persistent${config.xdg.cacheHome}/Element/GPUCache - - - - -"
"L /persistent${config.xdg.dataHome}/discord/DawnWebGPUCache - - - - ${config.xdg.cacheHome}/discord/DawnWebGPUCache"
"L /persistent${config.xdg.dataHome}/discord/GPUCache - - - - ${config.xdg.cacheHome}/discord/GPUCache"
"L /persistent${config.xdg.dataHome}/Element/DawnWebGPUCache - - - - ${config.xdg.cacheHome}/Element/DawnWebGPUCache"
"L /persistent${config.xdg.dataHome}/Element/GPUCache - - - - ${config.xdg.cacheHome}/Element/GPUCache"
])
(lib.mkIf (systemConfig.isIntelGPU) [
"d /tmp${config.xdg.cacheHome}/discord/DawnWebGPUCache - - - - -"
"d /tmp${config.xdg.cacheHome}/discord/GPUCache - - - - -"
"d /tmp${config.xdg.cacheHome}/Element/DawnWebGPUCache - - - - -"
"d /tmp${config.xdg.cacheHome}/Element/GPUCache - - - - -"
"L /persistent${config.xdg.dataHome}/discord/DawnWebGPUCache - - - - /tmp${config.xdg.cacheHome}/discord/DawnWebGPUCache"
"L /persistent${config.xdg.dataHome}/discord/GPUCache - - - - /tmp${config.xdg.cacheHome}/discord/GPUCache"
"L /persistent${config.xdg.dataHome}/Element/DawnWebGPUCache - - - - /tmp${config.xdg.cacheHome}/Element/DawnWebGPUCache"
"L /persistent${config.xdg.dataHome}/Element/GPUCache - - - - /tmp${config.xdg.cacheHome}/Element/GPUCache"
])
];
}