improve firefox module

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

View file

@ -1,26 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.local.apps.browsers;
in {
options.local.apps.browsers = {
enable = mkEnableOption "Browser home settings";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
chromium
firefox
];
# create an option for this
xsession.windowManager.i3.config.startup = [
{
command = "${lib.getExe pkgs.i3-gaps} 'workspace 1; exec ${lib.getExe pkgs.firefox}'";
}
];
};
}

View file

@ -10,7 +10,7 @@
./baseline.nix ./baseline.nix
./gaming.nix ./gaming.nix
./yubikey.nix ./yubikey.nix
./browsers.nix ./firefox.nix
./gui ./gui
./zsh ./zsh
./gpg.nix ./gpg.nix

View file

@ -13,6 +13,7 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
calibre calibre
chromium
discord discord
gwenview gwenview
libreoffice-fresh libreoffice-fresh

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}'";
};
};
}

View file

@ -40,8 +40,11 @@
neovim.enable = true; neovim.enable = true;
gaming.enable = true; gaming.enable = true;
yubikey.enable = true; yubikey.enable = true;
browsers.enable = true;
defaultDesktopPack.enable = true; defaultDesktopPack.enable = true;
firefox = {
enable = true;
workspace = 1;
};
}; };
gui = { gui = {