Set up chromium with support for wayland and widevine.

This commit is contained in:
Tom Alexander 2024-12-22 00:48:57 -05:00
parent 69098488f6
commit 27aa2f077b
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 55 additions and 1 deletions

View File

@ -27,6 +27,7 @@
./roles/sway ./roles/sway
./roles/alacritty ./roles/alacritty
./roles/firefox ./roles/firefox
./roles/chromium
./roles/emacs ./roles/emacs
./roles/git ./roles/git
./roles/fonts ./roles/fonts

View File

@ -0,0 +1,51 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
environment.systemPackages = with pkgs; [
(chromium.override { enableWideVine = true; })
];
nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"chromium"
"chromium-unwrapped"
"widevine-cdm"
];
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
hideMounts = true;
users.talexander = {
directories = [
{
directory = ".config/chromium";
user = "talexander";
group = "talexander";
mode = "0700";
}
];
};
};
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
hideMounts = true;
users.talexander = {
directories = [
{
directory = ".cache/chromium";
user = "talexander";
group = "talexander";
mode = "0700";
}
];
};
};
nixpkgs.config.chromium.commandLineArgs = "--enable-features=Vulkan";
}

View File

@ -297,11 +297,13 @@ in
programs.sway.extraSessionCommands = programs.sway.extraSessionCommands =
if config.me.buildingIso then if config.me.buildingIso then
'' ''
export WLR_RENDERER_ALLOW_SOFTWARE=1; export WLR_RENDERER_ALLOW_SOFTWARE=1
export NIXOS_OZONE_WL=1 # Wayland support for chromium and electron
'' ''
else else
'' ''
export WLR_RENDERER=vulkan export WLR_RENDERER=vulkan
export NIXOS_OZONE_WL=1 # Wayland support for chromium and electron
''; '';
programs.sway = { programs.sway = {