Created
July 27, 2021 09:36
-
-
Save sorki/cbc5f8870daad71d5ec4629b27894ed5 to your computer and use it in GitHub Desktop.
FirejailedFox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, lib, ... }: | |
{ | |
nixpkgs.overlays = [ | |
(self: super: { | |
firejailedFirefox = super.stdenv.mkDerivation rec { | |
name = "firejailed-firefox-desktop-item"; | |
dontBuild = true; | |
unpackPhase = "true"; | |
desktopItem = super.makeDesktopItem { | |
name = "firefox"; | |
exec = "/run/current-system/sw/bin/firefox"; | |
genericName = "Web Browser"; | |
categories = "Application;Network;WebBrowser;"; | |
desktopName = "firefox"; | |
mimeType = lib.concatStringsSep ";" [ | |
"text/html" | |
"text/xml" | |
"application/xhtml+xml" | |
"application/vnd.mozilla.xul+xml" | |
"x-scheme-handler/http" | |
"x-scheme-handler/https" | |
"x-scheme-handler/ftp" | |
]; | |
}; | |
installPhase = '' | |
mkdir -p $out/share | |
cp -r ${desktopItem}/share/applications $out/share | |
''; | |
}; | |
}) | |
]; | |
programs.firejail = { | |
enable = true; | |
wrappedBinaries.firefox = "${pkgs.lib.getBin pkgs.firefox}/bin/firefox"; | |
}; | |
# or users packages | |
environment.systemPackages = [ firejailedFirefox ]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment