Share your yay config.json + Lua questions

Greetings!

With the recent malware in the AUR, I’ve tried my best to increase my (lack of) knowledge on PKGBUILDs, install scripts, etc. I’ve adjusted some options for yay. For those curious here is the yay manual, btw.

"answerdiff": "All", ##Set a predetermined answer for the edit diff menu question.
"editmenu": true, ##This menu gives you the option to edit or view PKGBUILDs before building.
"editor": "nano", ##Editor to use when editing PKGBUILDs
"removemake": "yes", ##Remove makedepends after installing packages.
"cleanAfter": true, ##Remove untracked files after installation.
"maxconcurrentdownloads": 5, ##Allows up to X concurrent downloads
"sudoloop": true, ##Loop sudo calls in the background to prevent sudo from timing out during long builds

editmenu, from my understanding, should really only be used if you know what you’re doing. I can’t confidently say I know everything about PKGBUILDs yet, but I’m learning, and I want the ability to inspect/view the PKGBUILD, which this option allows.

Warning: Yay resolves dependencies ahead of time via the RPC. It is not recommended to edit pkgbuild variables unless you know what you are doing. ( Source )

These options encourage me to review changes instead of blindly accepting updates. I’m still learning what to look for, but this helps me inspect PKGBUILDs and related file changes before building AUR packages. One thing I noticed is that my config didn’t have an editor listed. You may want to make sure the editor field points to something you actually use like nano, vim, micro, etc.

Let me know if I need to consider changing/reverting any options, I’m always open to editing something if it’s more practical a certain way.

If you’re a bit curious like me, I wanted to compare the yay defaults to my own edited config. Luckily there’s some nice commands for that!

yay -Pd ##Prints yay default config
yay -Pg ##Prints current config

yay -Pd This command helped me figure out which settings I actually changed versus what yay already defaults to.

Hopefully we can get a little discussion going about how you configure, review, or change yay to your liking. Are there any yay options you’ve enabled or disabled over the years that you think are worth considering?

And lastly, yay v13.0.0 added Lua support and I’m wondering if anyone has already written or found any useful Lua config that could help to compliment yay? Or if we just have to wait for the community to come up with some useful configs? The yay manual also has a Lua configuration page: https://jguer.github.io/yay/lua.html

Below is my config located at /home/scott/.config/yay/config.json

Summary
{
	"aururl": "https://aur.archlinux.org",
	"aurrpcurl": "https://aur.archlinux.org/rpc?",
	"buildDir": "/home/scott/.cache/yay",
	"editor": "nano",
	"editorflags": "",
	"makepkgbin": "makepkg",
	"makepkgconf": "",
	"pacmanbin": "pacman",
	"pacmanconf": "/etc/pacman.conf",
	"redownload": "no",
	"answerclean": "",
	"answerdiff": "All",
	"answeredit": "",
	"answerupgrade": "",
	"gitbin": "git",
	"gpgbin": "gpg",
	"gpgflags": "",
	"mflags": "",
	"sortby": "",
	"searchby": "name-desc",
	"gitflags": "",
	"removemake": "yes",
	"sudobin": "sudo",
	"sudoflags": "",
	"version": "12.6.0",
	"requestsplitn": 150,
	"completionrefreshtime": 7,
	"maxconcurrentdownloads": 5,
	"bottomup": true,
	"sudoloop": false,
	"devel": false,
	"cleanAfter": true,
	"keepSrc": false,
	"provides": true,
	"pgpfetch": true,
	"cleanmenu": true,
	"diffmenu": true,
	"editmenu": true,
	"combinedupgrade": true,
	"useask": false,
	"batchinstall": false,
	"singlelineresults": false,
	"separatesources": true,
	"debug": false,
	"rpc": true,
	"doubleconfirm": true,
	"rebuild": "no"
}

I always took what was given to me with yay, but I am at the point you are: “With the recent malware in the AUR, I’ve tried my best to increase my (lack of) knowledge on PKGBUILDs, install scripts, etc”

I’m semi-confident looking at DIFFS which I just seriously started doing. I’ve read enough posts here to know what funny business looks like in code.

What did you learn using -Pd and -Pg? What apps for instance? This alerts you to your own changes?

What did your .config add or subtract in order to keep track of funny business?

you got me real curious now.

yay as a potential malware screener is an interesting idea

        "sudoloop": true,
        "diffmenu": true,
        "combinedupgrade": true,

I just use yay as-is. I don’t think I’ve ever even looked at any .config files.

@dalto where did you put those configs? On yay github page there is no mention of any config file so i wonder?

You use the yay command to modify them with --save.

The configs are located in ~/.config/yay/config.json but you aren’t intended to modify it by hand.

You are missing out. :slight_smile:

so it would look a little like (for instance):

yay "sudoloop": true --save

?

(or seperated by commas)

edit: formatting kicking my a## right now

:sweat_smile:

:down_arrow:

yay --sudoloop --save

what make it true then in the command itself? everything dash-dash defaults to true? Or it defaults to true regardless of dash-dash? Or would you have manually set the false in the argument to make it false?

Inquiring minds, code, and all that :slight_smile:

Pretty much.

--sudoloop=false to disable it.

thanks for indulging me; good to know

Here is the relevant part of man yay, lots of options to configure:

PERMANENT CONFIGURATION SETTINGS
     --save
            Causes the following options to be saved back to the config file. This provides an easy way to change config options without directly editing the file.

     --aururl
            Set an alternative AUR URL.

     --aurrpcurl
            Set an alternative URL for the AUR /rpc endpoint.

     --builddir <dir>
            Directory to use for Building AUR Packages. This directory is also used as the AUR cache when deciding if Yay should skip builds.

     --editor <command>
            Editor to use when editing PKGBUILDs. If this is not set the VISUAL environment variable will be checked, followed by EDITOR. If none of these are set Yay will prompt the user for an editor.

     --editorflags <flags>
            Passes arguments to the editor. These flags get passed to every instance where the editor is called by Yay. Arguments are split on whitespace before being passed to the  editor.  Multiple  arguments
            may be passed by supplying a space separated list that is quoted by the shell.

     --makepkg <command>
            The command to use for makepkg calls. This can be a command in PATH or an absolute path to the file.

     --pacman <command>
            The command to use for pacman calls. This can be a command in PATH or an absolute path to the file.

     --git <command>
            The command to use for git calls. This can be a command in PATH or an absolute path to the file.

     --gitflags <flags>
            Passes  arguments  to git. These flags get passed to every instance where git is called by yay. Arguments are split on whitespace before being passed to git. Multiple arguments may be passed by sup‐
            plying a space separated list that is quoted by the shell.

     --gpg <command>
            The command to use for gpg calls. This can be a command in PATH or an absolute path to the file.

     --config <file>
            The pacman config file to use.

     --makepkgconf <file>
            The config file for makepkg to use. If this is not set then the default config file will be used.

     --nomakepkgconf
            Reset the makepkg config file back to its default.

     --requestsplitn <number>
            The maximum amount of packages to request per AUR query. The higher the number the faster AUR requests will be. Requesting too many packages in one AUR query will cause an error.  This  should  only
            make a noticeable difference with very large requests (>500) packages.

     --completioninterval <days>
            Time in days to refresh the completion cache. Setting this to 0 will cause the cache to be refreshed every time, while setting this to -1 will cause the cache to never be refreshed.

     --sortby <votes|popularity|name|base|submitted|modified>
            Sort AUR results by a specific field during search.

     --searchby <name|name-desc|maintainer|depends|checkdepends|makedepends|optdepends|provides|conflicts|replaces|groups|keywords|comaintainers>
            Search for AUR packages by querying the specified field.

     --answerclean <All|None|Installed|NotInstalled|...>
            Set a predetermined answer for the clean build menu question. This answer will be used instead of reading from standard input but will be parsed exactly the same.

     --answerdiff <All|None|Installed|NotInstalled|...>
            Set a predetermined answer for the edit diff menu question. This answer will be used instead of reading from standard input but will be parsed exactly the same.

     --answeredit <All|None|Installed|NotInstalled|...>
            Set a predetermined answer for the edit pkgbuild menu question. This answer will be used instead of reading from standard input but will be parsed exactly the same.

     --answerupgrade <Repo|^Repo|None|...>
            Set  a  predetermined  answer  for  the  upgrade menu question. Selects which package ranges or repos to omit for updates. This answer will be used instead of reading from standard input but will be
            treated exactly the same.

     --noanswerclean
            Unset the answer for the clean build menu.

     --noanswerdiff
            Unset the answer for the diff menu.

     --noansweredit
            Unset the answer for the edit pkgbuild menu.

     --noanswerupgrade
            Unset the answer for the upgrade menu.

     --cleanmenu
            Show the clean menu. This menu gives you the chance to fully delete the downloaded build files from Yay's cache before redownloading a fresh copy.

            If 'cleanmenu' is enabled in the configuration file, you can temporarily disable it by using '--cleanmenu=false' on the command line

     --diffmenu
            Show the diff menu. This menu gives you the option to view diffs from build files before building.

            Diffs are shown via git diff which uses less by default. This behaviour can be changed via git's config, the $GIT_PAGER or $PAGER environment variables.

     --editmenu
            Show the edit menu. This menu gives you the option to edit or view PKGBUILDs before building.

            Warning: Yay resolves dependencies ahead of time via the RPC. It is not recommended to edit pkgbuild variables unless you know what you are doing.

     --askremovemake
            Ask to remove makedepends after installing packages.

     --askyesremovemake
            Ask to remove makedepends after installing packages(with "Y" as default).

     --removemake
            Remove makedepends after installing packages.

     --noremovemake
            Do not remove makedepends after installing packages.

     --topdown
            Display repository packages first and then AUR packages.

     --bottomup
            Show AUR packages first and then repository packages.

     --singlelineresults
            Override pacman's usual double-line search result format and list each result on its own line.

     --doublelineresults
            Follow pacman's double-line search result format and list each result using two lines.

     --devel
            During sysupgrade also check AUR development packages for updates. Currently only Git packages are supported.

            Devel checking is done using git ls-remote. The newest commit hash is compared against the hash at install time. This allows devel updates to be checked almost instantly and not require the original
            pkgbuild to be downloaded.

            The slower pacaur-like devel checks can be implemented manually by piping a list of packages into yay (see examples).

            If 'devel' is enabled in the configuration file, you can temporarily disable it by using '--devel=false' on the command line

     --cleanafter
            Remove untracked files after installation.

            Untracked files are removed with the exception of directories.  This allows VCS packages to easily pull an update instead of having to reclone the entire repo.

     --keepsrc
            Keep pkg/ and src/ after building packages

     --separatesources
            Separate query results by source, AUR and sync

     --redownload
            Always download pkgbuilds of targets even when a copy is available in cache.

     --redownloadall
            Always download pkgbuilds of all AUR packages even when a copy is available in cache.

     --noredownload
            When downloading pkgbuilds if the pkgbuild is found in cache and is equal or newer than the AUR's version use that instead of downloading a new one.

     --provides
            Look for matching providers when searching for AUR packages. When multiple providers are found a menu will appear prompting you to pick one. This increases  dependency  resolve  time  although  this
            should not be noticeable.

     --pgpfetch
            Prompt to import unknown PGP keys from the validpgpkeys field of each PKGBUILD.

     --useask
            Use pacman's --ask flag to automatically confirm package conflicts. Yay lists conflicts ahead of time. It is possible that Yay does not detect a conflict, causing a package to be removed without the
            user's confirmation.  However, this is very unlikely.

     --combinedupgrade
            During  sysupgrade,  Yay  will  first perform a refresh, then show its combined menu of repo and AUR packages that will be upgraded. Then after reviewing the pkgbuilds, the repo and AUR upgrade will
            start with no need for manual intervention.

            If Yay exits for any reason After the refresh without upgrading. It is then the user's responsibility to either resolve the reason Yay exited or run a sysupgrade through pacman directly.

     --batchinstall
            When building and installing AUR packages instead of installing each package after building, queue each package for install. Then once either all packages are built or a package in the  build  queue
            is needed as a dependency to build another package, install all the packages in the install queue.

     --rebuild
            Always build target packages even when a copy is available in cache.

     --rebuildall
            Always build all AUR packages even when a copy is available in cache.

     --rebuildtree
            When  installing  an  AUR package rebuild and reinstall all of its AUR dependencies recursively, even the ones already installed. This flag allows you to easily rebuild packages against your current
            system's libraries if they have become incompatible.

     --norebuild
            When building packages if the package is found in cache and is an equal version to the one wanted skip the package build and use the existing package.

     --mflags <flags>
            Passes arguments to makepkg. These flags get passed to every instance where makepkg is called by Yay. Arguments are split on whitespace before being passed to  makepkg.  Multiple  arguments  may  be
            passed by supplying a space separated list that is quoted by the shell.

     --gpgflags <flags>
            Passes  arguments  to gpg. These flags get passed to every instance where gpg is called by Yay. Arguments are split on whitespace before being passed to gpg. Multiple arguments may be passed by sup‐
            plying a space separated list that is quoted by the shell.

     --sudo <command>
            The command to use for sudo calls. This can be a command in PATH or an absolute path to the file.  The sudoloop is not guaranteed to work with a custom sudo command.

     --sudoflags <flags>
            Passes arguments to sudo. These flags get passed to every instance where sudo is called by Yay. Arguments are split on whitespace before being passed to sudo. Multiple arguments  may  be  passed  by
            supplying a space separated list that is quoted by the shell.

     --sudoloop
            Loop sudo calls in the background to prevent sudo from timing out during long builds.

There are reasons why I hid this command as an spoiler.

yay -S $(yay -Slq aur)

And no, you definitely shouldn’t try it out. No matter what.

Only 114667 packages to install!

A piece of cake for a 5 years old kid running Vanilla Arch. Of course he audits all PKGBUILDs beforehand.

So far I have set yay --diffmenu --answerdiff All --save

pulls up the PKGBUILD

to read

Are you expecting different?

One should always read the PKGBUILD before installing.

Up until few days ago I didn’t know yay had options. if I can figure out how to get bat to work with yay like paru, that’ll be great.

Seems yay doesn’t have an option to show news on upgrade. I have that in my paru.conf

Not only options, even configuration file support. usually located in ~/.config/yay/config.json, if you perform a --save command or configurable via --config /path/to/file.json

yay -Pd will show the configuration defaults. yay -Pg the current one.

Edit: Which has been already pointed out in the initial post… I really should read not only the latest replies, but also the whole thread :see_no_evil_monkey: