Compare commits
3 commits
d7ea157761
...
6b2163c050
Author | SHA1 | Date | |
---|---|---|---|
|
6b2163c050 | ||
|
86cf517738 | ||
|
7854100358 |
|
@ -5,25 +5,53 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.local.apps.browsers;
|
cfg = config.local.apps.firefox;
|
||||||
in {
|
in {
|
||||||
options.local.apps.browsers = {
|
options.local.apps.firefox = {
|
||||||
enable = mkEnableOption "firefox settings";
|
enable = mkEnableOption "firefox settings";
|
||||||
|
|
||||||
workspace = mkOption {
|
workspace = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
Workspace in which Firefox should open. If not set, Firefox will not open at startup.
|
i3 Workspace in which Firefox should open. If not set, Firefox will not open at startup
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
makeDefaultBrowser = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Take a guess
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable (mkMerge [
|
||||||
programs.firefox.enable = true;
|
{
|
||||||
|
programs.firefox.enable = true;
|
||||||
|
|
||||||
xsession.windowManager.i3.config.startup = optional (cfg.workspace != null) {
|
xsession.windowManager.i3.config.startup = optional (cfg.workspace != null) {
|
||||||
command = "${lib.getExe pkgs.i3-gaps} 'workspace ${cfg.workspace}; exec ${lib.getExe pkgs.firefox}'";
|
command = "${lib.getExe pkgs.i3-gaps} 'workspace ${cfg.workspace}; exec ${lib.getExe pkgs.firefox}'";
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
|
(mkIf cfg.makeDefaultBrowser {
|
||||||
|
xdg = {
|
||||||
|
mimeApps = {
|
||||||
|
enable = true;
|
||||||
|
defaultApplications = {
|
||||||
|
"text/html" = ["firefox"];
|
||||||
|
"text/uri-list" = ["firefox"];
|
||||||
|
"x-scheme-handler/http" = ["firefox"];
|
||||||
|
"x-scheme-handler/https" = ["firefox"];
|
||||||
|
"x-scheme-handler/about" = ["firefox"];
|
||||||
|
"x-scheme-handler/unknown" = ["firefox"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
home.sessionVariables.DEFAULT_BROWSER = mkIf cfg.makeDefaultBrowser "${lib.getExe pkgs.firefox}";
|
||||||
|
})
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,6 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultApplications = {
|
defaultApplications = {
|
||||||
"application/pdf" = with pkgs; ["qpdfview"];
|
"application/pdf" = with pkgs; ["qpdfview"];
|
||||||
"text/uri-list" = with pkgs; ["firefox"];
|
|
||||||
"x-scheme-handler/file" = with pkgs; ["kitty"];
|
"x-scheme-handler/file" = with pkgs; ["kitty"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
defaultDesktopPack.enable = true;
|
defaultDesktopPack.enable = true;
|
||||||
firefox = {
|
firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
workspace = 1;
|
workspace = "1"; #make this an int later
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
fail2ban = {
|
fail2ban = {
|
||||||
enable = true;
|
enable = true;
|
||||||
bantime = "10m";
|
bantime = "10m";
|
||||||
|
|
Loading…
Reference in a new issue