{ upkgs, lib, config, ... }: let enabled = config.boot.kernelPatchesOptions.amd-ignore-ctx-privileges; in { options = { boot.kernelPatchesOptions.amd-ignore-ctx-privileges = lib.mkEnableOption "amd-ignore-ctx-privileges"; }; config = lib.mkIf enabled { nixpkgs.channels.default = { upkgs.overlays = [ (self: super: { amdgpu-ignore-ctx-privileges = super.fetchpatch { name = "cap_sys_nice_begone.patch"; url = "https://github.com/Frogging-Family/community-patches/raw/master/linux61-tkg/cap_sys_nice_begone.mypatch"; hash = "sha256-Y3a0+x2xvHsfLax/uwycdJf3xLxvVfkfDVqjkxNaYEo="; }; }) ]; }; boot.kernelPatches = [ { name = "amdgpu-ignore-ctx-privileges"; patch = upkgs.amdgpu-ignore-ctx-privileges; } ]; }; }