I think the least that distros can do, is allow listing all packages and system settings in config files like .toml rather than having to type in every single package to install, or click through system setting GUIs to setup. Would that require using a whole programming language or system like NIx?

While NixOS works much differently from most distros, that’s the only reason I use it: package and system settings in text files. If I fix something, it’s fixed permanently, I don’t need to hunt down files in random directories if I want to change a setting. If I ever need to reinstall the OS I don’t have to write dnf install every single damn package and manually setup all that up all over again. Having daily-drove Windows macOS & Fedora as throughout the years, my setups have felt hacky as well as houses of cards as I’ve wanted or had to set them up again (I don’t mean Fedora specifically, but distros in general).

Basically it feels insane that it’s the way most linux users and servers in the world operate. If I, a humble computer hobbyist can figure out Nix, why don’t more users do so, and why is Nix so niche?

Gentoo’s Portage has a “world file”. It contains list of packages (in plain text) which user has explicitly installed.

Since Gentoo allows customization of almost every package, there’s actually more things to explore. I, personally, have created my custom profiles as a base for my Gentoo installs. With Gentoo the rabbit hole goes deep

oranki
link
fedilink
33M

If something like Ansible is too much, you could list the packages as a bash array in a file

pkgs=(
vim
bash-completion
...
)

Source the file

source pkgs.txt

Then install them

dnf install ${pkgs[@]}

This expands to dnf install vim bash-completion ...

As for listing the installed packages,

dnf repoquery --userinstalled --queryformat '%{name}\n'

The list includes all packages not installed as dependencies, so it’s not quite perfect but might be close enough to what you need.

The array expansion workaround should work for other package managers too, as long as they take the list of packages as whitespace-separated arguments.

Alexander
link
fedilink
33M

Configs certainly change faster than systems, I have to adatp it to hw and tasks every tima. So, pacman -S base-devel

Take a look at configuration management systems like Puppet or Ansible. There are many ways to have a pre-defined, repeatable system configuration in a text file.

[object Object]
link
fedilink
5
edit-2
3M

NixOS took that particular aspect too far that I don’t think it would become mainstream, especially in desktop environments. But I do agree that package management itself makes sense to do this. requirements.txt/packages.json/etc worked out for most environments, and it wouldn’t require much scripting.

Lucy :3
link
fedilink
73M

pacman -Qqe > pkgs.txt and pacman -Syu < pkgs.txt

Create a post
  • 0 users online
  • 1 user / day
  • 2 users / week
  • 3 users / month
  • 9 users / 6 months
  • 1 subscriber
  • 65 Posts
  • 395 Comments
  • Modlog