helm/modules/desktop/browsers/firefox.nix

53 lines
1.4 KiB
Nix
Raw Normal View History

2020-03-28 22:48:43 -07:00
# modules/browser/firefox.nix --- https://www.mozilla.org/en-US/firefox
#
# Oh firefox, gateway to the interwebs, devourer of ram. Give onto me your
# infinite knowledge and shelter me from ads.
{ config, options, lib, pkgs, ... }:
with lib;
{
options.modules.desktop.browsers.firefox = {
enable = mkOption {
type = types.bool;
default = false;
};
profileName = mkOption {
type = types.str;
default = config.my.username;
};
2020-03-28 22:48:43 -07:00
};
config = mkIf config.modules.desktop.browsers.firefox.enable {
my.packages = with pkgs; [
firefox-bin
(makeDesktopItem {
name = "firefox-private";
desktopName = "Firefox (Private)";
genericName = "Open a private Firefox window";
icon = "firefox";
exec = "${firefox-bin}/bin/firefox --private-window";
categories = "Network";
})
];
2020-03-28 22:48:43 -07:00
my.env.XDG_DESKTOP_DIR = "$HOME"; # (try to) prevent ~/Desktop
# Use a stable profile name so we can target it in themes
my.home.home.file =
let cfg = config.modules.desktop.browsers.firefox; in
{
".mozilla/firefox/profiles.ini".text = ''
[Profile0]
Name=default
IsRelative=1
Path=${cfg.profileName}.default
Default=1
[General]
StartWithLastProfile=1
Version=2
'';
};
2020-03-28 22:48:43 -07:00
};
}