improve firefox module

This commit is contained in:
Fabian Montero 2025-01-28 12:28:28 -06:00
parent d7f1c06f40
commit 48d230a108
Signed by untrusted user: fabian
GPG key ID: 1FFAC35E1798174F
5 changed files with 35 additions and 28 deletions

29
home/modules/firefox.nix Normal file
View file

@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.local.apps.browsers;
in {
options.local.apps.browsers = {
enable = mkEnableOption "firefox settings";
workspace = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
Workspace in which Firefox should open. If not set, Firefox will not open at startup.
'';
};
};
config = mkIf cfg.enable {
programs.firefox.enable = true;
xsession.windowManager.i3.config.startup = optional (cfg.workspace != null) {
command = "${lib.getExe pkgs.i3-gaps} 'workspace ${cfg.workspace}; exec ${lib.getExe pkgs.firefox}'";
};
};
}