nix-files/hosts/common/programs/element-desktop.nix

51 lines
1.7 KiB
Nix
Raw Normal View History

# debugging tips:
# - if element opens but does not render:
# - `element-desktop --disable-gpu --in-process-gpu`
# - <https://github.com/vector-im/element-desktop/issues/1029#issuecomment-1632688224>
# - `rm -rf ~/.config/Element/GPUCache`
# - <https://github.com/NixOS/nixpkgs/issues/244486>
{ lib, pkgs, ... }:
{
sane.programs.element-desktop = {
packageUnwrapped = (pkgs.element-desktop.override {
nixpkgs: 2024-03-13 -> 2024-03-21; others ``` • Updated input 'nixpkgs-next-unpatched': 'github:nixos/nixpkgs/4ee0840ba2ecc50458ab1677d108afcd691f4815' (2024-03-13) → 'github:nixos/nixpkgs/33cddc79aa062e243c59d3ac36b8b938f267748a' (2024-03-21) • Updated input 'nixpkgs-unpatched': 'github:nixos/nixpkgs/2dbc8f62d8af7a1ab962e4b20d12b25ddcb86ced' (2024-03-13) → 'github:nixos/nixpkgs/783b241f949bea90e3347ce516ad8af84bde3126' (2024-03-21) • Updated input 'nixpkgs-wayland': 'github:nix-community/nixpkgs-wayland/771cb198c281db6918829651f194bf4db32e342d' (2024-03-13) → 'github:nix-community/nixpkgs-wayland/7d053c33b7a130ddada43ba09b089244390b3a23' (2024-03-19) • Updated input 'nixpkgs-wayland/lib-aggregate': 'github:nix-community/lib-aggregate/45b75bf534592c0c1c881a1c447f7fdb37a87eaf' (2024-03-11) → 'github:nix-community/lib-aggregate/f890211817b941d9ed9de48d62ba8553fa2c20f3' (2024-03-17) • Updated input 'nixpkgs-wayland/lib-aggregate/nixpkgs-lib': 'github:nix-community/nixpkgs.lib/630ebdc047ca96d8126e16bb664c7730dc52f6e6' (2024-03-10) → 'github:nix-community/nixpkgs.lib/fa827dda806c5aa98f454da4c567991ab8ce422c' (2024-03-17) • Updated input 'sops-nix': 'github:Mic92/sops-nix/e52d8117b330f690382f1d16d81ae43daeb4b880' (2024-03-11) → 'github:Mic92/sops-nix/83b68a0e8c94b72cdd0a6e547a14ca7eb1c03616' (2024-03-17) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/b17375d3bb7c79ffc52f3538028b2ec06eb79ef8' (2024-03-10) → 'github:NixOS/nixpkgs/6dc11d9859d6a18ab0c5e5829a5b8e4810658de3' (2024-03-16) • Updated input 'uninsane-dot-org': 'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=bb10cd8853d05191e4d62947d93687c462e92c30' (2024-02-15) → 'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=9a3b2d74c3e6d177fd1317d03f4e3eecca7beb7b' (2024-03-19) ```
2024-03-21 17:53:15 +00:00
# use pre-built electron because otherwise it takes 4 hrs to build from source.
electron = pkgs.electron_28-bin;
}).overrideAttrs (upstream: {
# fix to use wayland instead of Xwayland:
# - replace `NIXOS_OZONE_WL` non-empty check with `WAYLAND_DISPLAY`
# - use `wayland` instead of `auto` because --ozone-platform-hint=auto still prefers X over wayland when both are available
# alternatively, set env var: `ELECTRON_OZONE_PLATFORM_HINT=wayland` and ignore all of this
installPhase = lib.replaceStrings
[ "NIXOS_OZONE_WL" "--ozone-platform-hint=auto" ]
[ "WAYLAND_DISPLAY" "--ozone-platform-hint=wayland" ]
upstream.installPhase
;
});
suggestedPrograms = [
"gnome-keyring"
];
2024-01-24 05:37:46 +00:00
sandbox.method = "bwrap";
sandbox.net = "clearnet";
sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # notifications
sandbox.whitelistDri = true;
sandbox.whitelistWayland = true;
sandbox.extraHomePaths = [
"Music"
"Pictures/albums"
"Pictures/cat"
"Pictures/from"
"Pictures/Photos"
"Pictures/Screenshots"
"Pictures/servo-macros"
"Videos/local"
"Videos/servo"
"tmp"
];
# creds/session keys, etc
persist.byStore.private = [ ".config/Element" ];
};
}