[Nexus 5 Original Android Development] :
Thank you very much for porting LineageOS 17.1 to the Nexus 5! It runs like a dream! :)

Are your builds signed with the generic, public Android signing key? According to the notification you receive after every boot (Trust: "This build was signed with public keys") they are. Please think about signing the builds with a private key, if they currently use the public one (I haven't checked it yet), so system applications can't be replaced with malicious ones. Thanks! ;)

Other than that I have created a custom gapps-config.txt file, so I don't have to resize the system partition. My goal was to include every application that can't be installed via the Google Play Store and remove the rest, including all preinstalled Lineage OS applications (I prefer alternatives, so I don't need these 350 MB of apps in /system).

gapps-config.txt

Include
### Install (only include apps that can not be installed via Play Store)
ActionsServices
BatteryUsage
BetterTogether
DialerFramework
ExchangeGoogle
GCS
KeyboardGoogle
Markup
PackageInstallerGoogle
PrintServiceGoogle
SoundPicker
StorageManagerGoogle
WebViewGoogle

### Remove apps
#CMSetupWizard
#CMUpdater
#LSetupWizard
#LUpdater
BasicDreams
Browser
CalculatorStock
CalendarStock
CameraStock
ClockStock
CMAccount
CMAudioFX
CMBugReport
CMFileManager
CMMusic
CMScreenCast
CMWallpapers
CMWeatherProvider
DashClock
Email
ExchangeStock
FMRadio
Galaxy
Gallery
Hexo
HoloSpiral
LiveWallpapers
LockClock
Logcat
LRecorder
MMS
NoiseField
OmniSwitch
Phasebeam
PhotoPhase
PhotoTable
PicoTTS
PrintServiceStock
SimToolKit
SoundRecorder
StorageManagerStock
Studio
SykoPath
TagStock
Terminal
VisualizationWallpapers
WhisperPush

This gapps-config.txt is supposed to be used with the following flash script:

install.sh

#!/bin/sh
### Reboot into recovery mode
adb reboot recovery
sleep 20
### Wipe
adb shell twrp wipe /system
## Clean install
#sleep 2
#adb shell twrp wipe cache
#sleep 2
#adb shell twrp wipe dalvik
#sleep 2
#adb shell twrp wipe data
#sleep 2

### Sideload LineageOS
sleep 2
adb shell twrp sideload
sleep 5
adb sideload lineage-17.1-*-hammerhead.zip
sleep 5

### Sideload Open GApps
adb push gapps-config.txt /tmp/install/gapps-config.txt
sleep 3
adb shell twrp sideload
sleep 5
adb sideload open_gapps-arm-10.0-super-*.zip
sleep 5

### Remove more preinstalled applications and replace Trebuchet with Pixel Launcher
adb shell twrp mount system
sleep 5
adb shell twrp remountrw
sleep 5
## Remove preinstalled applications
adb shell rm -r /system/system/product/priv-app/Contacts/
adb shell rm -r /system/system/product/priv-app/Dialer/
adb shell rm -r /system/system/product/priv-app/TrebuchetQuickStep/
sleep 5
## Install Pixel Launcher (https://xdaforums.com/showpost.php?p=78029447&postcount=483)
adb shell mkdir -p /system/system/etc/sysconfig
adb shell mkdir -p /system/system/priv-app/NexusLauncherPrebuilt

adb push com.google.android.apps.nexuslauncher/system/etc/sysconfig/google-hiddenapi-package-whitelist.xml /system/system/etc/sysconfig/google-hiddenapi-package-whitelist.xml
adb push com.google.android.apps.nexuslauncher/system/etc/sysconfig/pixel.xml /system/system/etc/sysconfig/pixel.xml
adb push com.google.android.apps.nexuslauncher/system/priv-app/NexusLauncherPrebuilt/NexusLauncherPrebuilt.apk /system/system/priv-app/NexusLauncherPrebuilt/NexusLauncherPrebuilt.apk
adb push com.google.android.apps.nexuslauncher/system/product/overlay/PixelStuff.apk /system/system/product/overlay/PixelStuff.apk

adb shell chmod 0644 /system/system/etc/sysconfig/google-hiddenapi-package-whitelist.xml
adb shell chmod 0644 /system/system/etc/sysconfig/pixel.xml
adb shell chmod 0644 /system/system/priv-app/NexusLauncherPrebuilt/NexusLauncherPrebuilt.apk
adb shell chmod 0644 /system/system/product/overlay/PixelStuff.apk
adb shell chmod 0755 /system/system/etc/sysconfig/
adb shell chmod 0755 /system/system/priv-app/NexusLauncherPrebuilt/
sleep 5
adb shell twrp umount system
sleep 2

### Finished
adb reboot bootloader

adb kill-server
rm -r ~/.android/

This does also replace the Trebuchet launcher with the Google Pixel Launcher (including the recent apps provider). Unfortunately all these sleeps are needed, because I can't properly wait for TWRP to finish its tasks and then continue with the next command (TWRP doesn't respond right after finishing a command).

Feel free to use these snippets, if you also don't want to modify your partitions! :) Be warned, space in /system is still very tight and you have to install everything from the Play Store (or any other app source).