Skip to content

Commit

Permalink
fix: nvidia
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan4yin committed Sep 3, 2024
1 parent 9d22e9e commit 5f78488
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 16 deletions.
8 changes: 2 additions & 6 deletions hardening/nixpaks/firefox-desktop-item.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
makeDesktopItem,
firefox,
}:
{makeDesktopItem}:
makeDesktopItem {
name = "firefox";
desktopName = "firefox";
exec = "firefox %U";
terminal = false;
# icon = "firefox";
icon = "${firefox}/share/icons/hicolor/512x512/apps/firefox.png";
icon = "firefox";
type = "Application";
categories = ["Network"];
comment = "firefox boxed";
Expand Down
46 changes: 37 additions & 9 deletions hardening/nixpaks/firefox.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,11 @@ mkNixPak {
# "io.gitlab.librewolf.*" = "own"; # librewolf
};

bubblewrap = let
envSuffix = envKey: sloth.concat' (sloth.env envKey);
in {
bubblewrap = {
bind.rw = [
(sloth.concat' sloth.homeDir "/.mozilla")
(sloth.concat' sloth.homeDir "/Downloads")

# Unsure
"/tmp/.X11-unix"
(sloth.envOr "XAUTHORITY" "/no-xauth")
(envSuffix "XDG_RUNTIME_DIR" "/dconf")

# ================ for externsions ===============================
# required by https://github.com/browserpass/browserpass-extension
(sloth.concat' sloth.homeDir "/.local/share/password-store") # pass
Expand All @@ -50,12 +43,47 @@ mkNixPak {
"/sys/bus/pci"
["${config.app.package}/lib/firefox" "/app/etc/firefox"]

# Use correct timezone
"/etc/fonts"
"/etc/machine-id"
"/etc/localtime"
"/run/opengl-driver"

# Unsure
(sloth.concat' sloth.xdgConfigHome "/dconf")
];

network = true;
sockets = {
x11 = false;
wayland = true;
pipewire = true;
};
bind.dev = [
"/dev/dri"
"/dev/shm"
"/run/dbus"

# required when using nvidia as primary gpu
"/dev/nvidia-uvm"
"/dev/nvidia-modeset"
];
tmpfs = [
"/tmp"
];

env = {
XDG_DATA_DIRS = lib.mkForce (lib.makeSearchPath "share" (with pkgs; [
adw-gtk3
tela-icon-theme
shared-mime-info
]));
XCURSOR_PATH = lib.mkForce (lib.concatStringsSep ":" (with pkgs; [
"${tela-icon-theme}/share/icons"
"${tela-icon-theme}/share/pixmaps"
"${simp1e-cursors}/share/icons"
"${simp1e-cursors}/share/pixmaps"
]));
};
};
};
}
4 changes: 3 additions & 1 deletion hardening/nixpaks/qq.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ mkNixPak {
"/dev/shm"
"/run/dbus"

"/dev/nvidia-uvm" # required when using nvidia as primary gpu
# required when using nvidia as primary gpu
"/dev/nvidia-uvm"
"/dev/nvidia-modeset"
];
tmpfs = [
"/tmp"
Expand Down

0 comments on commit 5f78488

Please sign in to comment.