Skip to content

Commit

Permalink
home: limit firefox memory footprint with systemd-run
Browse files Browse the repository at this point in the history
  • Loading branch information
LEXUGE committed Dec 19, 2024
1 parent 2419266 commit e435116
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions modules/home/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,30 @@ in
# Allow fonts to be discovered
fonts.fontconfig.enable = true;

xdg.desktopEntries = {
# customized firefox desktop entry
# per https://github.com/nix-community/home-manager/blob/master/modules/misc/xdg-desktop-entries.nix, our entry will _override_ the existing entry
firefox = {
name = "Firefox";
genericName = "Web Browser";
exec = "systemd-run --user --scope -p MemoryLimit=4G firefox --name firefox %U";
terminal = false;
icon = "${pkgs.firefox-wayland}/share/icons/hicolor/128x128/apps/firefox.png";
categories = [
"Network"
"WebBrowser"
];
mimeType = [
"text/html"
"text/xml"
"application/xhtml+xml"
"application/vnd.mozilla.xul+xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
];
};
};

# Package settings
programs = {
# Per directory auto env loading
Expand Down

0 comments on commit e435116

Please sign in to comment.