mirror of
https://github.com/willemml/dotfiles.nix.git
synced 2025-04-12 11:17:17 +00:00
Enables widevine in firefox on voyager
This commit is contained in:
parent
7d2b0c8681
commit
93443c0a35
8 changed files with 100 additions and 72 deletions
|
@ -88,12 +88,7 @@
|
|||
homeconsole-vm = self.nixosConfigurations.darwin-arm-homeconsole-vm.config.system.build.vm;
|
||||
default = self.darwinConfigurations.zeus.config.system.build.toplevel;
|
||||
};
|
||||
|
||||
x86_64-linux.live-image = self.nixosConfigurations.x86_64-live.config.system.build.isoImage;
|
||||
aarch64-linux.live-image = self.nixosConfigurations.x86_64-live.config.system.build.isoImage;
|
||||
};
|
||||
|
||||
hydraJobs.x86_64-linux = packages.x86_64-linux;
|
||||
};
|
||||
|
||||
perSystem = {
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
rofi-wayland
|
||||
];
|
||||
|
||||
# required for firefox widevine
|
||||
home.sessionVariables.MOZ_GMP_PATH = "${pkgs.widevine}/gmp-widevinecdm/system-installed";
|
||||
|
||||
# notifications daemon
|
||||
services.mako.enable = true;
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
|
@ -30,14 +34,16 @@
|
|||
|
||||
settings = {
|
||||
decoration = {
|
||||
#blur = false;
|
||||
rounding = 5;
|
||||
rounding = 10;
|
||||
|
||||
# save battery
|
||||
drop_shadow = false;
|
||||
blur.enabled = false;
|
||||
};
|
||||
|
||||
general = {
|
||||
gaps_in = 3;
|
||||
gaps_out = 3;
|
||||
gaps_in = 5;
|
||||
gaps_out = 10;
|
||||
};
|
||||
|
||||
monitor = [
|
||||
|
@ -48,10 +54,13 @@
|
|||
"${pkgs.swaybg}/bin/swaybg -i ${config.stylix.image} -m fill"
|
||||
];
|
||||
exec-once = [
|
||||
"sleep 10 && ${pkgs.swayidle}/bin/swayidle -w timeout 10 'if ${pkgs.busybox}/bin/pgrep ${pkgs.swaylock-effects}/bin/swaylock; then hyprctl dispatch dpms off; fi' resume 'hyprctl dispatch dpms on' before-sleep '${pkgs.swaylock-effects}/bin/swaylock -f'"
|
||||
# Display sleep on idle
|
||||
"sleep 60 && ${pkgs.swayidle}/bin/swayidle -w timeout 60 'if ${pkgs.busybox}/bin/pgrep ${pkgs.swaylock-effects}/bin/swaylock; then hyprctl dispatch dpms off; fi' resume 'hyprctl dispatch dpms on' before-sleep '${pkgs.swaylock-effects}/bin/swaylock -f'"
|
||||
|
||||
# Enables clipboard sync
|
||||
"${pkgs.wl-clipboard}/bin/wl-paste -p | ${pkgs.wl-clipboard}/bin/wl-copy"
|
||||
"${pkgs.wl-clipboard}/bin/wl-paste | ${pkgs.wl-clipboard}/bin/wl-copy -p"
|
||||
|
||||
"${pkgs.swaynotificationcenter}/bin/swaync"
|
||||
];
|
||||
|
||||
|
@ -74,14 +83,21 @@
|
|||
"$mod, SPACE, exec, rofi -modes \"ssh,drun,window\" -show drun"
|
||||
"ALT, SPACE, exec, rofi -show window"
|
||||
|
||||
# swaylock on suspend
|
||||
",switch:Apple SMC power/lid events, exec, ${pkgs.swaylock-effects}/bin/swaylock"
|
||||
",XF86Sleep, exec, ${pkgs.swaylock-effects}/bin/swaylock"
|
||||
|
||||
"$mod, L, exec, ${pkgs.swaylock-effects}/bin/swaylock"
|
||||
"SUPER_SHIFT, 4, exec, ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp -d)\" - | ${pkgs.wl-clipboard}/bin/wl-copy"
|
||||
|
||||
# brightness controls (need to use F2/3 because XF86Brightness isnt working)
|
||||
",F2, exec, ${bright} s \"$(${bright} g | ${pkgs.busybox}/bin/awk '{ print int(($1 + .72) * 1.4) }')\""
|
||||
",F1, exec, ${bright} s \"$(${bright} g | ${pkgs.busybox}/bin/awk '{ print int($1 / 1.4) }')\""
|
||||
|
||||
# volume controls
|
||||
",XF86AudioRaiseVolume, exec, ${pkgs.ponymix}/bin/ponymix inc 2"
|
||||
",XF86AudioLowerVolume, exec, ${pkgs.ponymix}/bin/ponymix dec 2"
|
||||
|
||||
# workspace switching
|
||||
"$mod, 1, workspace, 1"
|
||||
"$mod, 2, workspace, 2"
|
||||
|
@ -94,6 +110,7 @@
|
|||
"$mod, 9, workspace, 9"
|
||||
"$mod, 0, workspace, 10"
|
||||
|
||||
# terminal
|
||||
"CONTROL, RETURN, exec, alacritty"
|
||||
|
||||
"SUPER_SHIFT, C, killactive"
|
||||
|
|
|
@ -9,10 +9,6 @@
|
|||
if osConfig.networking.hostName == "voyager"
|
||||
then "wlan0"
|
||||
else "";
|
||||
hwmon =
|
||||
if osConfig.networking.hostName == "voyager"
|
||||
then "/sys/class/hwmon/hwmon4/temp1_input"
|
||||
else "";
|
||||
colors = config.lib.stylix.colors.withHashtag;
|
||||
primaryColor = colors.base04;
|
||||
altColor = colors.base0C;
|
||||
|
@ -27,11 +23,11 @@ in {
|
|||
mainBar = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 30;
|
||||
height = 36;
|
||||
spacing = 8;
|
||||
margin = "3px 3px 0px 3px";
|
||||
margin = "0px 0px 5px 0px";
|
||||
modules-left = ["hyprland/workspaces"];
|
||||
modules-right = ["network" "cpu" "temperature" "memory" "disk" "pulseaudio" "battery" "tray" "clock"];
|
||||
modules-right = ["network" "cpu" "memory" "disk" "pulseaudio" "battery" "clock"];
|
||||
|
||||
"hyprland/workspaces" = {
|
||||
sort-by-number = true;
|
||||
|
@ -50,11 +46,8 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
"tray"."spacing" = 2;
|
||||
|
||||
"clock" = {
|
||||
"format" = "<span color='${primaryColor}'> {:%R} </span>";
|
||||
"format-alt" = "<span color='${primaryColor}'> {:%a, %b %d, %Y %R} </span>";
|
||||
"format" = "<span color='${primaryColor}'> {:%a, %b %d, %Y %R}</span>";
|
||||
"tooltip-format" = "<tt><small>{calendar}</small></tt>";
|
||||
"calendar" = {
|
||||
"mode" = "year";
|
||||
|
@ -79,80 +72,41 @@ in {
|
|||
|
||||
"cpu" = {
|
||||
"interval" = 2;
|
||||
"format" = "<span color='${altColor}'>{usage}% {avg_frequency}GHz</span>";
|
||||
"format" = "<span color='${altColor}'>CPU: {usage}% @ {avg_frequency}GHz</span>";
|
||||
"on-click" = "${pkgs.alacritty}/bin/alacritty -e ${pkgs.bottom}/bin/btm";
|
||||
};
|
||||
|
||||
"battery" = {
|
||||
"bat" = "macsmc-battery";
|
||||
"states" = {
|
||||
"good" = 95;
|
||||
"warning" = 30;
|
||||
"critical" = 15;
|
||||
};
|
||||
"format" = "<span color='${primaryColor}'>{capacity}% </span>{icon}";
|
||||
"format-full" = "";
|
||||
"format-icons" = [
|
||||
"<span color='${colors.base08}'></span>"
|
||||
"<span color='${colors.base09}'></span>"
|
||||
"<span color='${colors.base09}'></span>"
|
||||
"<span color='${primaryColor}'></span>"
|
||||
"<span color='${primaryColor}'></span>"
|
||||
];
|
||||
"format" = "<span color='${primaryColor}'>Battery: {capacity}%</span>";
|
||||
};
|
||||
|
||||
"memory" = {
|
||||
"format" = "<span color='${altColor}'>{used:0.1f}G/{total:0.1f}G </span>";
|
||||
"format" = "<span color='${altColor}'>RAM: {used:0.1f}G/{total:0.1f}G</span>";
|
||||
"on-click" = "${pkgs.alacritty}/bin/alacritty -e ${pkgs.bottom}/bin/btm";
|
||||
};
|
||||
|
||||
"disk" = {
|
||||
"format" = "<span color='${primaryColor}'>{used}/{total} </span>";
|
||||
"format" = "<span color='${primaryColor}'>Disk: {used}/{total}</span>";
|
||||
"path" = "/";
|
||||
};
|
||||
|
||||
"network" = {
|
||||
"interface" = "${networkInterface.eth}";
|
||||
"interval" = 2;
|
||||
"format-ethernet" = "<span color='${primaryColor}'>Up: {bandwidthUpBits} Down: {bandwidthDownBits} </span>";
|
||||
"tooltip-format-ethernet" = "<span color='${primaryColor}'>{ifname} </span>";
|
||||
"format-wifi" = "<span color='${primaryColor}'>Up: {bandwidthUpBits} Down: {bandwidthDownBits} ({signalStrength}%) </span>";
|
||||
"tooltip-format-wifi" = "<span color='${primaryColor}'>{ifname} {essid} ({signalStrength}%) </span>";
|
||||
"format-disconnected" = "<span color='${primaryColor}'>Disconnected ⚠</span>";
|
||||
"format-ethernet" = "<span color='${primaryColor}'>Ether: Up: {bandwidthUpBits} Down: {bandwidthDownBits} </span>";
|
||||
"tooltip-format-ethernet" = "<span color='${primaryColor}'>{ifname}</span>";
|
||||
"format-wifi" = "<span color='${primaryColor}'>WiFi: Up: {bandwidthUpBits} Down: {bandwidthDownBits} ({signalStrength}%)</span>";
|
||||
"tooltip-format-wifi" = "<span color='${primaryColor}'>{essid} ({signalStrength}%)</span>";
|
||||
"format-disconnected" = "<span color='${primaryColor}'>Disconnected</span>";
|
||||
"on-click" = "${pkgs.alacritty}/bin/alacritty -e ${pkgs.networkmanager}/bin/nmtui";
|
||||
};
|
||||
|
||||
"pulseaudio" = {
|
||||
"format" = "<span color='${altColor}'>{volume}% {icon}</span>";
|
||||
"format-bluetooth" = "<span color='${altColor}'>{volume}% {icon}</span>";
|
||||
"format-muted" = "<span color='${altColor}'></span>";
|
||||
"format-icons" = {
|
||||
"headphones" = "<span color='${altColor}'></span>";
|
||||
"handsfree" = "<span color='${altColor}'></span>";
|
||||
"headset" = "<span color='${altColor}'></span>";
|
||||
"phone" = "<span color='${altColor}'></span>";
|
||||
"portable" = "<span color='${altColor}'></span>";
|
||||
"car" = "<span color='${altColor}'></span>";
|
||||
"default" = [
|
||||
"<span color='${altColor}'></span>"
|
||||
"<span color='${altColor}'></span>"
|
||||
];
|
||||
};
|
||||
"format" = "<span color='${altColor}'>Volume: {volume}%</span>";
|
||||
"on-click" = "${pkgs.pavucontrol}/bin/pavucontrol";
|
||||
};
|
||||
|
||||
"temperature" = {
|
||||
"hwmon-path" = "${hwmon}";
|
||||
"format" = "<span color='${primaryColor}'>{}°C</span>";
|
||||
"critical-threshold" = 80;
|
||||
"on-click" = "${pkgs.alacritty}/bin/alacritty -e ${pkgs.bottom}/bin/btm";
|
||||
};
|
||||
};
|
||||
};
|
||||
style = ''
|
||||
window#waybar {
|
||||
border-radius: 5px;
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
../../modules/zerotier.nix
|
||||
inputs.nixos-apple-silicon.nixosModules.apple-silicon-support
|
||||
];
|
||||
|
||||
environment.sessionVariables.MOZ_GMP_PATH = ["${pkgs.widevine}/gmp-widevinecdm/system-installed"];
|
||||
environment.systemPackages = [pkgs.firefox];
|
||||
services.logind = {
|
||||
extraConfig = ''
|
||||
HandlePowerKey=suspend
|
||||
|
|
|
@ -10,6 +10,15 @@
|
|||
pulse.enable = true;
|
||||
};
|
||||
|
||||
services.dbus = {
|
||||
enable = true;
|
||||
packages = [pkgs.dconf];
|
||||
};
|
||||
|
||||
programs.dconf = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.printing.enable = true;
|
||||
|
||||
hardware.pulseaudio.enable = false;
|
||||
|
|
|
@ -1,2 +1,7 @@
|
|||
_final: prev: {
|
||||
final: prev: {
|
||||
widevine-installer = prev.callPackage ./widevine-installer.nix {};
|
||||
widevine = prev.callPackage ./widevine.nix {};
|
||||
firefox = prev.firefox.override (old: {
|
||||
extraPrefsFiles = ["${final.widevine-installer}/conf/gmpwidevine.js"];
|
||||
});
|
||||
}
|
||||
|
|
27
packages/widevine-installer.nix
Normal file
27
packages/widevine-installer.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{pkgs, ...}:
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
name = "widevine-installer";
|
||||
version = "7a3928fe1342fb07d96f61c2b094e3287588958b";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "AsahiLinux";
|
||||
repo = "${name}";
|
||||
rev = "${version}";
|
||||
sha256 = "sha256-XI1y4pVNpXS+jqFs0KyVMrxcULOJ5rADsgvwfLF6e0Y=";
|
||||
};
|
||||
|
||||
buildInputs = with pkgs; [which python3 squashfsTools];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out/bin"
|
||||
mkdir -p "$out/conf"
|
||||
cp widevine-installer "$out/bin/"
|
||||
cp widevine_fixup.py "$out/bin/"
|
||||
cp conf/gmpwidevine.js "$out/conf/"
|
||||
echo "$(which unsquashfs)"
|
||||
sed -e "s|unsquashfs|$(which unsquashfs)|" -i "$out/bin/widevine-installer"
|
||||
sed -e "s|python3|$(which python3)|" -i "$out/bin/widevine-installer"
|
||||
sed -e "s|read|#read|" -i "$out/bin/widevine-installer"
|
||||
sed -e 's|$(whoami)|root|' -i "$out/bin/widevine-installer"
|
||||
sed -e 's|URL=.*|URL="$DISTFILES_BASE"|' -i "$out/bin/widevine-installer"
|
||||
'';
|
||||
}
|
20
packages/widevine.nix
Normal file
20
packages/widevine.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
let
|
||||
lacrosVersion = "120.0.6098.0";
|
||||
in
|
||||
{pkgs, ...}:
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "widevine";
|
||||
version = "";
|
||||
buildInputs = with pkgs; [curl widevine-installer];
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
urls = ["https://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/chromeos-lacros-arm64-squash-zstd-${lacrosVersion}"];
|
||||
hash = "sha256-OKV8w5da9oZ1oSGbADVPCIkP9Y0MVLaQ3PXS3ZBLFXY=";
|
||||
};
|
||||
|
||||
unpackPhase = "true";
|
||||
installPhase = ''
|
||||
mkdir -p "$out/"
|
||||
COPY_CONFIGS=0 INSTALL_BASE="$out" DISTFILES_BASE="file://$src" widevine-installer
|
||||
'';
|
||||
}
|
Loading…
Add table
Reference in a new issue