it has to work eventually

This commit is contained in:
caem 2025-01-24 17:17:19 +01:00
parent f01b7ee1a7
commit fdf9f78888
Signed by: caem
GPG key ID: 69A830D03203405F

View file

@ -1,78 +1,76 @@
# Shamelessly stolen most parts from https://github.com/schizofox/schizofox # Shamelessly stolen most parts from https://github.com/schizofox/schizofox
{ pkgs, inputs, lib, ... }: final: prev: let { pkgs, ... }: final: prev: {
mkNixPak = inputs.nixpak.lib.nixpak { firefox-esr = let
inherit (pkgs) lib; sandboxed-firefox-esr = pkgs.mkNixPak {
inherit pkgs; config = { sloth, ... }: {
}; app.package = pkgs.firefox-esr;
in { flatpak.appId = "org.mozilla.firefox";
firefox-esr = mkNixPak { dbus.policies = {
config = { sloth, ... }: { "org.mozilla.Firefox" = "own";
app.package = pkgs.firefox-esr; "org.mozilla.Firefox.*" = "own";
flatpak.appId = "org.mozilla.firefox"; "org.a11y.Bus" = "talk";
dbus.policies = { "org.gnome.SessionManager" = "talk";
"org.mozilla.Firefox" = "own"; "org.freedesktop.ScreenSaver" = "talk";
"org.mozilla.Firefox.*" = "own"; "org.gtk.vfs.*" = "talk";
"org.a11y.Bus" = "talk"; "org.gtk.vfs" = "talk";
"org.gnome.SessionManager" = "talk"; "org.freedesktop.Notifications" = "talk";
"org.freedesktop.ScreenSaver" = "talk"; "org.freedesktop.portal.FileChooser" = "talk";
"org.gtk.vfs.*" = "talk"; "org.freedesktop.portal.Settings" = "talk";
"org.gtk.vfs" = "talk"; "org.mpris.MediaPlayer2.firefox.*" = "own";
"org.freedesktop.Notifications" = "talk"; "org.mozilla.firefox.*" = "own";
"org.freedesktop.portal.FileChooser" = "talk"; "org.mozilla.firefox_beta.*" = "own";
"org.freedesktop.portal.Settings" = "talk"; "org.freedesktop.DBus" = "talk";
"org.mpris.MediaPlayer2.firefox.*" = "own"; "org.freedesktop.DBus.*" = "talk";
"org.mozilla.firefox.*" = "own"; "ca.desrt.dconf" = "talk";
"org.mozilla.firefox_beta.*" = "own"; "org.freedesktop.portal.*" = "talk";
"org.freedesktop.DBus" = "talk"; "org.freedesktop.NetworkManager" = "talk";
"org.freedesktop.DBus.*" = "talk"; "org.freedesktop.FileManager1" = "talk";
"ca.desrt.dconf" = "talk"; };
"org.freedesktop.portal.*" = "talk";
"org.freedesktop.NetworkManager" = "talk";
"org.freedesktop.FileManager1" = "talk";
};
gpu.enable = true; gpu.enable = true;
gpu.provider = "bundle"; gpu.provider = "bundle";
fonts.enable = true; fonts.enable = true;
locale.enable = true; locale.enable = true;
etc.sslCertificates.enable = true; etc.sslCertificates.enable = true;
bubblewrap = let bubblewrap = let
envSuffix = envKey: sloth.concat' (sloth.env envKey); envSuffix = envKey: sloth.concat' (sloth.env envKey);
in { in {
network = true; network = true;
bind.rw = [ bind.rw = [
(sloth.concat' sloth.xdgCacheHome "/fontconfig") (sloth.concat' sloth.xdgCacheHome "/fontconfig")
(sloth.concat' sloth.xdgCacheHome "/mesa_shader_cache") (sloth.concat' sloth.xdgCacheHome "/mesa_shader_cache")
(sloth.concat [ (sloth.concat [
(sloth.env "XDG_RUNTIME_DIR") (sloth.env "XDG_RUNTIME_DIR")
"/" "/"
(sloth.envOr "WAYLAND_DISPLAY" "no") (sloth.envOr "WAYLAND_DISPLAY" "no")
]) ])
"/tmp/.X11-unix" "/tmp/.X11-unix"
(sloth.envOr "XAUTHORITY" "/no-xauth") (sloth.envOr "XAUTHORITY" "/no-xauth")
(envSuffix "XDG_RUNTIME_DIR" "/at-spi/bus") (envSuffix "XDG_RUNTIME_DIR" "/at-spi/bus")
(envSuffix "XDG_RUNTIME_DIR" "/gvfsd") (envSuffix "XDG_RUNTIME_DIR" "/gvfsd")
(envSuffix "XDG_RUNTIME_DIR" "/pulse") (envSuffix "XDG_RUNTIME_DIR" "/pulse")
(envSuffix "XDG_RUNTIME_DIR" "/doc") (envSuffix "XDG_RUNTIME_DIR" "/doc")
(envSuffix "XDG_RUNTIME_DIR" "/dconf") (envSuffix "XDG_RUNTIME_DIR" "/dconf")
(sloth.concat [sloth.xdgConfigHome "/.mozilla"]) (sloth.concat [sloth.xdgConfigHome "/.mozilla"])
]; ];
bind.ro = [ bind.ro = [
"/etc/resolv.conf" "/etc/resolv.conf"
(sloth.concat' sloth.xdgConfigHome "/gtk-2.0") (sloth.concat' sloth.xdgConfigHome "/gtk-2.0")
(sloth.concat' sloth.xdgConfigHome "/gtk-3.0") (sloth.concat' sloth.xdgConfigHome "/gtk-3.0")
(sloth.concat' sloth.xdgConfigHome "/gtk-4.0") (sloth.concat' sloth.xdgConfigHome "/gtk-4.0")
(sloth.concat' sloth.xdgConfigHome "/dconf") (sloth.concat' sloth.xdgConfigHome "/dconf")
"/etc/localtime" "/etc/localtime"
"/sys/bus/pci" "/sys/bus/pci"
]; ];
};
}; };
}; };
}.config.script; in
sandboxed-firefox-esr.config.env;
} }