testsAndMisc/linux_configuration/scripts/single_use/fresh-install
Krzysztof kuhy Rudnicki 9b30329ca3 fresh-install: split main.sh 308 -> 200 + 121
The five package-installation functions move to lib/packages.sh; main.sh
keeps the top-level flow and sources the library after `set -e`.

The first attempt sliced by line range and was thrown away. This file
interleaves top-level commands - sudo -v, git config, the cp of
makepkg.conf and pacman.conf - between its function definitions, so a range
slice swept them into the library, where they would have run at source time
and in the wrong order. Sourcing that version blocked on a sudo password
prompt, which is how it was caught. The rebuild extracts function blocks by
brace counting and leaves every other line exactly where it was.

Verified with the new shfmt harness (all 5 functions verbatim), by a
structural comparison of the top-level flow showing exactly one line added
and none missing, and by sourcing the library to confirm it defines all five
functions with no side effects. The script itself was NOT run: it does
`sudo pacman -Sy`, overwrites /etc/makepkg.conf and /etc/pacman.conf, and
installs AUR packages.

Over-cap files 32 -> 31.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-17 14:11:26 +02:00
..
lib fresh-install: split main.sh 308 -> 200 + 121 2026-08-17 14:11:26 +02:00
aur_packages.txt refactor(linux_configuration): move remaining dirs + scripts/ to meta/ 2026-05-15 00:53:01 +02:00
detect_gpu_and_install.sh refactor(linux_configuration): move remaining dirs + scripts/ to meta/ 2026-05-15 00:53:01 +02:00
detect_gpu.sh refactor(linux_configuration): move remaining dirs + scripts/ to meta/ 2026-05-15 00:53:01 +02:00
install_amd_driver.sh refactor(linux_configuration): move remaining dirs + scripts/ to meta/ 2026-05-15 00:53:01 +02:00
install_intel_driver.sh refactor(linux_configuration): move remaining dirs + scripts/ to meta/ 2026-05-15 00:53:01 +02:00
install_nvidia_driver.sh refactor(linux_configuration): move remaining dirs + scripts/ to meta/ 2026-05-15 00:53:01 +02:00
main.sh fresh-install: split main.sh 308 -> 200 + 121 2026-08-17 14:11:26 +02:00
makepkg.conf refactor(linux_configuration): move remaining dirs + scripts/ to meta/ 2026-05-15 00:53:01 +02:00
mkinitcpio.conf refactor(linux_configuration): move remaining dirs + scripts/ to meta/ 2026-05-15 00:53:01 +02:00
mpv.conf refactor(linux_configuration): move remaining dirs + scripts/ to meta/ 2026-05-15 00:53:01 +02:00
packages.txt refactor(linux_configuration): move remaining dirs + scripts/ to meta/ 2026-05-15 00:53:01 +02:00
pacman_packages.txt refactor(linux_configuration): move remaining dirs + scripts/ to meta/ 2026-05-15 00:53:01 +02:00
pacman.conf refactor(linux_configuration): move remaining dirs + scripts/ to meta/ 2026-05-15 00:53:01 +02:00
README.md refactor(linux_configuration): move remaining dirs + scripts/ to meta/ 2026-05-15 00:53:01 +02:00

Package Lists

This directory contains package lists for the fresh install script:

  • pacman_packages.txt - List of packages to install via pacman
  • aur_packages.txt - List of AUR packages with their repository URLs

Format

pacman_packages.txt

One package name per line:

package1
package2
package3
# This is a comment and will be ignored
# Another comment

aur_packages.txt

Package name and repository URL separated by space:

package-name https://aur.archlinux.org/package-name.git
another-package https://aur.archlinux.org/another-package.git
# This is a comment and will be ignored
# Another comment

Note: Lines starting with anything other than lowercase letters (a-z) or digits (0-9) will be ignored as comments. This includes lines starting with #, spaces, uppercase letters, or special characters.

Usage

The main.sh script will automatically read from these files:

  • Pacman packages will be installed via pacman -Sy --noconfirm
  • AUR packages will be built and installed via the install_from_aur function

Modifying Package Lists

To add or remove packages:

  1. Edit the appropriate .txt file
  2. For AUR packages, ensure the format is correct (package-name followed by space and URL)
  3. You can add comments by starting lines with # or any non-alphanumeric character
  4. Save the file - the script will automatically pick up changes on next run

Comments

You can add comments to organize your package lists:

# Essential packages
git
vim

# Development tools
gcc
make

# Optional packages (commented out)
# some-package-i-might-want-later