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?

  • @d0ntpan1c@lemmy.blahaj.zone
    link
    fedilink
    English
    106 days ago

    For what its worth, many package managers support some method of exporting a list of installed packages to a file (or in a way that can be easily piped to a file), and its not difficult to pipe a file of packages into a shell loop to get the behavior as described.

    Native support in the package manager would be nice, sure, but the Unix philosophy of providing tools that can easily augment each other to solve problems means this is generally a trivial thing to implement by anyone in a way that works best for their use case.

    • @JubilantJaguar@lemmy.world
      link
      fedilink
      English
      15 days ago

      its not difficult to pipe a file of packages into a shell loop to get the behavior as described

      It’s possible, but “not difficult” is a bit of a stretch. FWIW I’ve used this in the past, among other hacky solutions that don’t always work as expected:

      # Print packages installed from different origins.
      # Exclude standard Ubuntu repositories.
      
      grep -H '^Origin:' /var/lib/apt/lists/*Release | grep -v ' Ubuntu$' | sort -u \
      | while read -r line; do
          origin=${line#* }
          echo $origin:
          list=${line%%:*}
          sed -rn 's/^Package: (.*)$/\1/p' ${list%_*Release}*Packages | sort -u \
          | xargs -r dpkg -l 2>/dev/null | grep '^.i '
          echo
      done