2023-11-12 05:38:43 +00:00
|
|
|
{
|
|
|
|
inputs,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
mkNixPak = inputs.nixpak.lib.nixpak {
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
inherit pkgs;
|
2023-11-05 12:50:08 +00:00
|
|
|
};
|
2023-11-12 05:38:43 +00:00
|
|
|
|
|
|
|
firefox = mkNixPak {
|
|
|
|
config = {
|
|
|
|
config,
|
|
|
|
sloth,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
app.package = pkgs.firefox;
|
|
|
|
flatpak.appId = "org.mozilla.firefox";
|
|
|
|
|
|
|
|
imports = [
|
|
|
|
(inputs.nixpak-pkgs + "/pkgs/modules/gui-base.nix")
|
|
|
|
(inputs.nixpak-pkgs + "/pkgs/modules/network.nix")
|
|
|
|
];
|
|
|
|
|
|
|
|
# Specified in https://github.com/schizofox/schizofox/blob/main/modules/hm/default.nix
|
|
|
|
# I really don't have any idea what am I doing, it just works™
|
2023-11-14 03:28:47 +00:00
|
|
|
dbus.policies = {
|
|
|
|
"org.mozilla.firefox.*" = "own";
|
|
|
|
#"org.mozilla.firefox_beta.*" = "own";
|
|
|
|
};
|
|
|
|
|
2023-11-12 05:38:43 +00:00
|
|
|
bubblewrap = let
|
|
|
|
envSuffix = envKey: sloth.concat' (sloth.env envKey);
|
|
|
|
in {
|
|
|
|
bind.rw = [
|
|
|
|
"/tmp/.X11-unix"
|
|
|
|
(sloth.envOr "XAUTHORITY" "/no-xauth")
|
|
|
|
(envSuffix "XDG_RUNTIME_DIR" "/dconf")
|
|
|
|
(sloth.concat' sloth.homeDir "/.mozilla")
|
|
|
|
(sloth.concat' sloth.homeDir "/Downloads")
|
|
|
|
];
|
|
|
|
bind.ro = [
|
|
|
|
"/etc/localtime"
|
|
|
|
"/sys/bus/pci"
|
|
|
|
|
2023-11-14 03:28:47 +00:00
|
|
|
["${config.app.package}/lib/firefox" "/app/etc/firefox"]
|
2023-11-12 05:38:43 +00:00
|
|
|
(sloth.concat' sloth.xdgConfigHome "/dconf")
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
home.packages = [firefox.config.env];
|
|
|
|
|
|
|
|
# TODO: does not seem to work
|
|
|
|
#programs.firefox = {
|
|
|
|
# enable = true;
|
|
|
|
# package = firefox.config.env;
|
|
|
|
#
|
|
|
|
# # TODO
|
|
|
|
# profiles."default" = {};
|
|
|
|
#};
|
2023-11-05 12:50:08 +00:00
|
|
|
}
|