That is all there is to it.
Ensure the custom mirror is used
When you setup a mirror you want to ensure your local computers use that mirror.
You need to make a special configuration for pacman-mirrors to avoid the pamac mirrorlist timer rewriting your mirror list.
Configure pacman-mirrors to use a mirror pool with only one mirror.
sudo pacman-mirrors --country dk
Then edit the resulting pool file /var/lib/pacman-mirrors/custom-mirrors.json and remove unnecessary data.
Initially the file may look like this
[
{
"branches": [
1,
1,
1
],
"country": "Denmark",
"last_sync": "00:59",
"protocols": [
"https"
],
"resp_time": "00.00",
"url": "https://mirrors.dotsrc.org/manjaro/"
}
]
Remove status configs branches, last_sync and resp_time.
Modify url to point to your server.
JSON data is picky on format so ensure all brackets and braces are in place.
[
{
"country": "CUSTOM",
"protocols": [ "https" ],
"url": "https://your-mirror.tld/manjaro"
}
]
Save the file and copy to a convenient location e.g. your home.
cp /var/lib/pacman-mirrors/custom-mirrors.json ~
From there you can distribute the configuration all your systems - copy the file to the same location - replacing the existing file if necessary.
cp custom-mirrors.json /var/lib/pacman-mirrors
Ensure your custom pool is never replaced
Ideally this should be done with a custom pacman-mirrors package.
The package must rebuild on python version change - but the following will work as well.
If you want to ensure the custom pool is never reset by a user running pacman-mirrors -c all you can apply some system wide changes.
REMEMBER: Modifying system files will be reverted when the package owning the files is rebuilt.
Copy the file custom-mirrors.json as mirrors.json to /usr/share/pacman.mirrors - replacing the upstream mirror pool.
sudo cp ~/custom-mirrors.json /usr/share/pacman-mirrors/mirrors.json
Locate the file /usr/lib/python3.10/site-packages/pacman_mirrors/config/configuration.py
Edit the configuration and change the URL_MIRROR_JSON and URL_STATUS_JSON to be an empty string
#URL_MIRROR_JSON = "https://repo.manjaro.org/mirrors.json"
#URL_STATUS_JSON = "https://repo.manjaro.org/status.json"
URL_MIRROR_JSON = ""
URL_STATUS_JSON = ""
Save the file.
no shiny-mirrors
Of course none of the above will work as expected if your systems use shiny-mirrors - only pacman-mirrors can do this.