https://forum.xda-developers.com/oneplus-x/general/los-16-test-build-rom-kernel-22-12-2018-t3881637

and install it on your phone following the instructions on this link, under “installing a custom recovery using fastboot”

https://wiki.lineageos.org/devices/bullhead/install

Then use sideload in TWRP to install the ROM in the first link, then microg then magisk

https://github.com/microg/android_packages_apps_GmsCore/issues/352#issuecomment-289425428

https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445 (be careful, magisk does NOT have a website)

sudo adb start-server adb devices adb shell su pm grant com.android.vending android.permission.FAKE_PACKAGE_SIGNATURE