2023-07-09 07:18:15 +00:00
|
|
|
# Tangram is a GTK/webkit browser
|
|
|
|
# it views each tab as a distinct application, persisted, and where the 'home' button action is specific to each tab.
|
|
|
|
# it supports ephemeral tabs, but UX is heavily geared to GCing those as early as possible.
|
|
|
|
|
2023-07-11 10:04:03 +00:00
|
|
|
{ pkgs, ... }:
|
2023-07-11 10:02:47 +00:00
|
|
|
let
|
|
|
|
dconfProfile = pkgs.writeTextFile {
|
|
|
|
name = "dconf-tangram-profile";
|
|
|
|
destination = "/etc/dconf/profile/tangram";
|
|
|
|
text = ''
|
|
|
|
user-db:tangram
|
|
|
|
system-db:site
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
2023-07-09 07:18:15 +00:00
|
|
|
{
|
|
|
|
sane.programs.tangram = {
|
2023-07-11 10:02:47 +00:00
|
|
|
# XXX(2023/07/08): running on moby without disabling the webkit sandbox fails, with:
|
2023-07-09 11:16:08 +00:00
|
|
|
# - `bwrap: Can't make symlink at /var/run: File exists`
|
|
|
|
# see epiphany.nix for more info
|
2024-01-20 11:11:12 +00:00
|
|
|
packageUnwrapped = pkgs.tangram.overrideAttrs (upstream: {
|
2023-07-10 06:49:27 +00:00
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(
|
|
|
|
--set WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS "1"
|
2023-07-11 10:02:47 +00:00
|
|
|
--set DCONF_PROFILE "${dconfProfile}/etc/dconf/profile/tangram"
|
2023-07-10 06:49:27 +00:00
|
|
|
);
|
|
|
|
'' + (upstream.preFixup or "");
|
|
|
|
});
|
2023-07-11 10:02:47 +00:00
|
|
|
|
2023-11-18 22:06:08 +00:00
|
|
|
slowToBuild = true; # only true for cross-compiled tangram
|
|
|
|
|
2024-02-18 06:27:40 +00:00
|
|
|
sandbox.method = "bwrap";
|
|
|
|
sandbox.net = "clearnet";
|
|
|
|
sandbox.whitelistAudio = true;
|
|
|
|
sandbox.whitelistDri = true;
|
|
|
|
sandbox.whitelistWayland = true;
|
|
|
|
|
2023-11-08 15:32:50 +00:00
|
|
|
persist.byStore.private = [
|
2023-07-09 07:18:15 +00:00
|
|
|
".cache/Tangram"
|
|
|
|
".local/share/Tangram"
|
2023-07-11 10:02:47 +00:00
|
|
|
# dconf achieves atomic writes via `mv`, so a symlink doesn't work
|
|
|
|
# moreover, i have to persist the *whole* directory:
|
|
|
|
# - `user-db:tangram/user` causes a schema failure
|
2024-02-23 06:07:44 +00:00
|
|
|
# - bind-mounting `~/.config/dconf/tangram` causes dconf to try a cross-fs `mv`, which fails
|
2023-07-11 10:02:47 +00:00
|
|
|
# - dconf provides no way to specify an alternate ~/.config/dconf dir, except by overriding XDG_CONFIG_HOME
|
|
|
|
# { type = "file"; path = ".config/dconf/tangram"; method = "bind"; }
|
2024-02-20 23:39:27 +00:00
|
|
|
# ".config/dconf"
|
2023-07-09 07:18:15 +00:00
|
|
|
];
|
2024-02-20 23:39:27 +00:00
|
|
|
suggestedPrograms = [ "dconf" ];
|
2023-07-09 07:18:15 +00:00
|
|
|
};
|
|
|
|
}
|