Formatting + update

This commit is contained in:
Aleksandr Lebedev 2025-07-25 22:56:40 +02:00
parent 93de64c64e
commit 9c895e9cc0
61 changed files with 2350 additions and 2100 deletions

View file

@ -4,12 +4,12 @@
inputs,
...
}: let
pkgs-master = import inputs.nixpkgs-master {
inherit (pkgs) system;
config.allowUnfree = true;
};
pkgs-master = import inputs.nixpkgs-master {
inherit (pkgs) system;
config.allowUnfree = true;
};
in {
nixpkgs = {
nixpkgs = {
overlays = [
(self: super: {
widevine-cdm = pkgs-master.widevine-cdm;
@ -23,17 +23,17 @@ nixpkgs = {
imports = [
#./apple-silicon-support
];
programs.firefox.policies.Preferences = {
"media.gmp-widevinecdm.version" = "system-installed";
"media.gmp-widevinecdm.visible" = true;
"media.gmp-widevinecdm.enabled" = true;
"media.gmp-widevinecdm.autoupdate" = false;
"media.eme.enabled" = true;
"media.eme.encrypted-media-encryption-scheme.enabled" = true;
};
programs.firefox.autoConfig = ''
// Zhu
lockPref("general.useragent.override","Mozilla/5.0 (X11; CrOS aarch64 15236.80.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.125 Safari/537.36");''; #doesn't work. You need to manually add this to about:config
programs.firefox.policies.Preferences = {
"media.gmp-widevinecdm.version" = "system-installed";
"media.gmp-widevinecdm.visible" = true;
"media.gmp-widevinecdm.enabled" = true;
"media.gmp-widevinecdm.autoupdate" = false;
"media.eme.enabled" = true;
"media.eme.encrypted-media-encryption-scheme.enabled" = true;
};
programs.firefox.autoConfig = ''
// Zhu
lockPref("general.useragent.override","Mozilla/5.0 (X11; CrOS aarch64 15236.80.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.125 Safari/537.36");''; #doesn't work. You need to manually add this to about:config
hardware.asahi = {
peripheralFirmwareDirectory = ./firmware;
useExperimentalGPUDriver = true; #deprecated

View file

@ -1,5 +1,4 @@
{pkgs, ...}:
{
{pkgs, ...}: {
programs.firefox.profiles.default.settings = {
"media.gmp-widevinecdm.version" = pkgs.widevinecdm-aarch64.version;
"media.gmp-widevinecdm.visible" = true;
@ -12,7 +11,7 @@
home.file."firefox-widevinecdm" = {
enable = true;
target = ".mozilla/firefox/default/gmp-widevinecdm";
source = pkgs.runCommandLocal "firefox-widevinecdm" { } ''
source = pkgs.runCommandLocal "firefox-widevinecdm" {} ''
out=$out/${pkgs.widevinecdm-aarch64.version}
mkdir -p $out
ln -s ${pkgs.widevinecdm-aarch64}/manifest.json $out/manifest.json
@ -20,5 +19,4 @@
'';
recursive = true;
};
}

View file

@ -1,6 +1,5 @@
prev: final:
{
widevinecdm-aarch64 = import ./widevine.nix {
inherit (final) stdenvNoCC fetchFromGitHub fetchurl python3 squashfsTools nspr;
};
prev: final: {
widevinecdm-aarch64 = import ./widevine.nix {
inherit (final) stdenvNoCC fetchFromGitHub fetchurl python3 squashfsTools nspr;
};
}

View file

@ -1,11 +1,11 @@
{ stdenvNoCC
, fetchFromGitHub
, fetchurl
, python3
, squashfsTools
, nspr
}:
let
{
stdenvNoCC,
fetchFromGitHub,
fetchurl,
python3,
squashfsTools,
nspr,
}: let
widevine-installer = fetchFromGitHub {
owner = "AsahiLinux";
repo = "widevine-installer";
@ -13,31 +13,29 @@ let
sha256 = "sha256-XI1y4pVNpXS+jqFs0KyVMrxcULOJ5rADsgvwfLF6e0Y=";
};
lacros-image = fetchurl {
url =
let
distfiles_base = "https://commondatastorage.googleapis.com/chromeos-localmirror/distfiles";
lacros_name = "chromeos-lacros-arm64-squash-zstd";
lacrosVersion = "120.0.6098.0";
in
"${distfiles_base}/${lacros_name}-${lacrosVersion}";
url = let
distfiles_base = "https://commondatastorage.googleapis.com/chromeos-localmirror/distfiles";
lacros_name = "chromeos-lacros-arm64-squash-zstd";
lacrosVersion = "120.0.6098.0";
in "${distfiles_base}/${lacros_name}-${lacrosVersion}";
hash = "sha256-OKV8w5da9oZ1oSGbADVPCIkP9Y0MVLaQ3PXS3ZBLFXY=";
};
in
stdenvNoCC.mkDerivation {
name = "widevine";
version = "4.10.2662.3";
stdenvNoCC.mkDerivation {
name = "widevine";
version = "4.10.2662.3";
dontUnpack = true;
dontBuild = true;
dontUnpack = true;
dontBuild = true;
buildInputs = [ python3 squashfsTools ];
buildInputs = [python3 squashfsTools];
installPhase = ''
mkdir $out
unsquashfs -q ${lacros-image} 'WidevineCdm/*'
python3 ${widevine-installer}/widevine_fixup.py squashfs-root/WidevineCdm/_platform_specific/cros_arm64/libwidevinecdm.so $out/libwidevinecdm.so
mv squashfs-root/WidevineCdm/manifest.json $out/
mv squashfs-root/WidevineCdm/LICENSE $out/
patchelf --add-rpath ${nspr}/lib $out/libwidevinecdm.so
'';
}
installPhase = ''
mkdir $out
unsquashfs -q ${lacros-image} 'WidevineCdm/*'
python3 ${widevine-installer}/widevine_fixup.py squashfs-root/WidevineCdm/_platform_specific/cros_arm64/libwidevinecdm.so $out/libwidevinecdm.so
mv squashfs-root/WidevineCdm/manifest.json $out/
mv squashfs-root/WidevineCdm/LICENSE $out/
patchelf --add-rpath ${nspr}/lib $out/libwidevinecdm.so
'';
}

View file

@ -1,53 +1,56 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}: {
hardware = {
graphics = {
enable = true;
extraPackages = with pkgs; [
nvidia-vaapi-driver
];
};
nvidia = {
# https://nixos.wiki/wiki/Nvidia
# Modesetting is required.
modesetting.enable = true;
graphics = {
enable = true;
extraPackages = with pkgs; [
nvidia-vaapi-driver
];
};
nvidia = {
# https://nixos.wiki/wiki/Nvidia
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;#false;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true; #false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = true;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = true;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.latest;
};
logitech.wireless.enable = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.latest;
};
logitech.wireless.enable = true;
};
services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.videoDrivers = ["nvidia"];
#hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.mkDriver { #fixes https://github.com/NixOS/nixpkgs/issues/375730 temporary
# version = "570.133.07"; # use new 570 drivers
# sha256_64bit = "sha256-LUPmTFgb5e9VTemIixqpADfvbUX1QoTT2dztwI3E3CY=";
# openSha256 = "sha256-9l8N83Spj0MccA8+8R1uqiXBS0Ag4JrLPjrU3TaXHnM=";
# settingsSha256 = "sha256-ZpuVZybW6CFN/gz9rx+UJvQ715FZnAOYfHn5jt5Z2C8=";
# usePersistenced = false;
#};
# version = "570.133.07"; # use new 570 drivers
# sha256_64bit = "sha256-LUPmTFgb5e9VTemIixqpADfvbUX1QoTT2dztwI3E3CY=";
# openSha256 = "sha256-9l8N83Spj0MccA8+8R1uqiXBS0Ag4JrLPjrU3TaXHnM=";
# settingsSha256 = "sha256-ZpuVZybW6CFN/gz9rx+UJvQ715FZnAOYfHn5jt5Z2C8=";
# usePersistenced = false;
#};
}