kiviktnm / decman

Declarative package & configuration manager for Arch Linux.
GNU General Public License v3.0
66 stars 3 forks source link

Kickstart a source file for better onboarding #8

Closed uwidev closed 1 month ago

uwidev commented 1 month ago

What do you think about having a way to kickstart an existing system into a source configuration file?

Maybe it could get all their packages, installed system and user services, their ~/.dotfiles if exists or something, any any non-standard ArchLinux etc file, then turn it into a source file for decman. Once generated, the user could start making their changes form there instead of from scratch.

Some users have a lot of packages, many services, etc files, etc. Starting from scratch to include everything can feel a bit intimidating.

kiviktnm commented 1 month ago

While I can see the usefulness of generating a configuration based on an existing system, I'm not sure if I'd recommend doing so. I believe that by starting from scratch you'll by default build a leaner system that contains only the things you need. Your system configuration will also be more organized when created manually.

Implementing this functionality would also pose problems due to not knowing which configuration files should be added. If parsed from ~/.dotfiles, this could maybe be achieved, but if you have a ~/.dotfiles that should already significantly speed up creating your initial decman configuration.

Here are some commands that should help with onboarding:

List all explicitly installed packages:

pacman -Qeq

List all system and user services that are by default disabled, but currently enabled. This will help you identify services you should add to a decman configuration.

systemctl list-unit-files | grep -E "enabled.*disabled"
systemctl list-unit-files --user | grep -E "enabled.*disabled"

All in all, I'm not going to add this functionality any time soon. If you really want this, check out aconfmgr which is a very similar program to decman. It allows you to capture your existing system and start from there.