forked from fabian/nix_config
improve firefox module
This commit is contained in:
parent
d7f1c06f40
commit
48d230a108
5 changed files with 35 additions and 28 deletions
29
home/modules/firefox.nix
Normal file
29
home/modules/firefox.nix
Normal 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}'";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue