How to get Widevine DRM working in Firefox (Aarch64)?

I did some looking up but didn’t find a clear way to do so. I want DRM enabled by default in all Firefox profiles if possible.

from widevine-cdm: add aarch64 support by RossComputerGuy · Pull Request #343393 · NixOS/nixpkgs · GitHub :

  nixpkgs = {
    overlays = [
      (final: prev: {
        firefox = prev.firefox.overrideAttrs (old: {
          buildCommand =
            old.buildCommand
            + ''
              mkdir -p $out/gmp-widevinecdm/system-installed
              ln -s "${pkgs.widevine-cdm}/share/google/chrome/WidevineCdm/_platform_specific/linux_arm64/libwidevinecdm.so" $out/gmp-widevinecdm/system-installed/libwidevinecdm.so
              ln -s "${pkgs.widevine-cdm}/share/google/chrome/WidevineCdm/manifest.json" $out/gmp-widevinecdm/system-installed/manifest.json
              wrapProgram "$oldExe" \
                      --set MOZ_GMP_PATH "$out/gmp-widevinecdm/system-installed"
            '';
        });
      })
    ];
  };

I have not tried this (on my todo).

I got this flake working.

Example from the documentation:

{
  description = "My system flake";

  inputs = {
    nixos-aarch64-widevine.url = "github:epetousis/nixos-aarch64-widevine";
  };

  outputs = {
    self,
    [...],
    nixos-aarch64-widevine
  }:
  {
    nixosConfigurations."my-aarch64-device" = nixpkgs.lib.nixosSystem {
      system = "aarch64-linux";
      modules = [
        [...],
        {
          nixpkgs.overlays = [ nixos-aarch64-widevine.overlays.default ];
        }
      ];
    };
  };

In configuration.nix:

  environment.variables.MOZ_GMP_PATH = [
    "${pkgs.widevine-cdm-lacros}/gmp-widevinecdm/system-installed"
  ];