2023-10-18 09:25:53 +00:00
|
|
|
# Fractal: GTK4 instant messenger client for the Matrix protocol
|
|
|
|
#
|
|
|
|
# very susceptible to state corruption during hard power-cycles.
|
|
|
|
# if it stalls while launching, especially with a brief message at bottom
|
|
|
|
# "unable to open store"
|
|
|
|
# then:
|
2023-10-22 23:21:35 +00:00
|
|
|
# - remove ~/.local/share/stable/*
|
2023-10-18 09:25:53 +00:00
|
|
|
# - this might give I/O error, in which case remove the corresponding path under
|
|
|
|
# /nix/persist/home/colin/private (which can be found by correlating timestamps/sizes with that in ~/private/.local/share/stable).
|
|
|
|
# - reboot (maybe necessary).
|
2023-10-22 23:21:35 +00:00
|
|
|
# - now you can send messages, and read messages in unencrypted rooms, but not read messages from encrypted rooms.
|
|
|
|
# to fix encrypted message receipt:
|
|
|
|
# - start from above (fractal closed, no ~/.local/share/stable/*)
|
|
|
|
# - in ~/.local/share/keyrings/Default_keyring.keyring:
|
|
|
|
# - find the entry that says "display-name=Fractal: Matrix credentials for <mxid>"
|
|
|
|
# - remove that entry and all associated entries (i.e. ones with same number but different :attributeN)
|
|
|
|
# - REBOOT. otherwise keyring stuff seems to stay cached in RAM
|
|
|
|
# - login to Fractal. give an hour to sync.
|
|
|
|
# - it'll kick you back to a page asking you to cross-sign. open FluffyChat and do the emoji compare. success!
|
2023-10-02 06:12:24 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.sane.programs.fractal;
|
|
|
|
in
|
2023-07-30 01:42:24 +00:00
|
|
|
{
|
|
|
|
sane.programs.fractal = {
|
2024-01-20 11:11:12 +00:00
|
|
|
packageUnwrapped = pkgs.fractal-nixified.optimized;
|
2024-05-19 21:16:06 +00:00
|
|
|
# packageUnwrapped = pkgs.fractal;
|
2023-07-30 01:42:24 +00:00
|
|
|
|
2024-01-23 14:13:09 +00:00
|
|
|
sandbox.method = "bwrap";
|
2024-02-08 21:51:32 +00:00
|
|
|
sandbox.net = "clearnet";
|
2024-02-13 11:14:38 +00:00
|
|
|
sandbox.whitelistAudio = true;
|
2024-02-13 11:58:12 +00:00
|
|
|
sandbox.whitelistDbus = [ "user" ]; # notifications
|
2024-02-02 17:19:35 +00:00
|
|
|
sandbox.whitelistDri = true; # otherwise video playback buuuuurns CPU
|
2024-02-14 01:49:49 +00:00
|
|
|
sandbox.whitelistWayland = true;
|
2024-02-15 00:49:24 +00:00
|
|
|
sandbox.extraHomePaths = [
|
2024-02-16 05:49:56 +00:00
|
|
|
# still needs these paths despite it using the portal's file-chooser :?
|
2024-02-15 00:49:24 +00:00
|
|
|
"Music"
|
2024-02-27 21:36:18 +00:00
|
|
|
"Pictures/albums"
|
|
|
|
"Pictures/cat"
|
|
|
|
"Pictures/from"
|
|
|
|
"Pictures/Photos"
|
|
|
|
"Pictures/Screenshots"
|
2024-02-15 00:49:24 +00:00
|
|
|
"Pictures/servo-macros"
|
2024-02-27 21:36:18 +00:00
|
|
|
"Videos/local"
|
2024-02-15 00:49:24 +00:00
|
|
|
"Videos/servo"
|
|
|
|
"tmp"
|
|
|
|
];
|
2024-01-22 09:21:30 +00:00
|
|
|
|
2023-10-02 06:12:24 +00:00
|
|
|
configOption = with lib; mkOption {
|
|
|
|
default = {};
|
|
|
|
type = types.submodule {
|
|
|
|
options.autostart = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-11-08 15:32:50 +00:00
|
|
|
persist.byStore.private = [
|
2023-09-29 22:08:13 +00:00
|
|
|
# XXX by default fractal stores its state in ~/.local/share/<build-profile>/<UUID>.
|
2024-03-16 12:00:53 +00:00
|
|
|
# ".local/share/hack" # for debug-like builds
|
|
|
|
# ".local/share/stable" # for normal releases
|
|
|
|
".local/share/fractal" # for version 5+
|
2023-09-29 22:08:13 +00:00
|
|
|
];
|
2023-08-02 07:40:57 +00:00
|
|
|
|
|
|
|
suggestedPrograms = [ "gnome-keyring" ];
|
2023-10-02 06:12:24 +00:00
|
|
|
|
|
|
|
services.fractal = {
|
2024-02-19 12:57:44 +00:00
|
|
|
description = "fractal Matrix client";
|
2024-03-21 16:02:06 +00:00
|
|
|
partOf = lib.mkIf cfg.config.autostart [ "graphical-session" ];
|
2024-02-19 12:57:44 +00:00
|
|
|
|
2024-03-21 05:13:48 +00:00
|
|
|
# env "G_MESSAGES_DEBUG=all"
|
2024-03-21 15:05:23 +00:00
|
|
|
command = "fractal";
|
2023-10-02 06:12:24 +00:00
|
|
|
};
|
2023-07-30 01:42:24 +00:00
|
|
|
};
|
|
|
|
}
|