feat(home-manager): add nixgl

This commit is contained in:
Yorick Barbanneau 2024-08-30 21:22:02 +02:00
parent cf8a838191
commit 3d36ef0261
4 changed files with 76 additions and 16 deletions

View file

@ -8,10 +8,10 @@ in
options.modules.web.firefox = {
enable = mkEnableOption "enable Firefox web browser";
installPackage = mkOption {
enableNixGL = mkOption {
type = types.bool;
default = true;
description = "install Package, if false relies on distribution packages";
default = false;
description = "Use NixGL to start Firefox";
};
};
config = mkIf cfg.enable {
@ -26,18 +26,34 @@ in
"x-scheme-handler/about" = "firefox.desktop";
"x-scheme-handler/unknown" = "firefox.desktop";
};
xdg.desktopEntries."firefox" = if cfg.enableNixGL then {
name = "Firefox NixGL Powered";
exec = "${pkgs.nixgl.nixGLMesa}/bin/nixGLMesa firefox %U";
icon = "firefox";
terminal = false;
type = "Application";
startupNotify = true;
actions = {
"new-private-window" = {
exec = "${pkgs.nixgl.nixGLMesa}/bin/nixGLMesa firefox --private-window %U";
name = "New Private Window";
};
"new-window" = {
exec = "${pkgs.nixgl.nixGLMesa}/bin/nixGLMesa firefox --new-window %U";
name = "New Window";
};
};
}
else {};
programs.firefox = {
enable = true;
package =
if cfg.installPackage
then pkgs.wrapFirefox pkgs.firefox-unwrapped {
nativeMessagingHosts = [
# Tridactyl native connector
pkgs.tridactyl-native
pkgs.browserpass
];
}
else null;
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
nativeMessagingHosts = [
# Tridactyl native connector
pkgs.tridactyl-native
pkgs.browserpass
];
};
profiles.ephase = {
id = 0;
name = "ephase";