on gentoo for example I have accrued a few files under /etc/portage that to my knowledge just have to live there…

right now I basically rely on my backups for this. but maybe somebody knows a clever way to handle this?

  • Lily33@kbin.social
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    NixOS does that well. I never quite managed to figure out a solution to this on other distros (which is actually what led me into making the jump in the end).

  • aurtzy@social.fossware.space
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    Maybe etckeeper fits your use case? It’s specifically built for managing /etc files with version control systems. I can’t say much about it since I’ve never used it, though.

  • Elw@lemmy.sdf.org
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    1 year ago

    There should be no dotfiles outside of home directories so I assume you mean a config file. In those cases, git and symlinks are a great option. Make a config directory in your home dir and organize it however you want. Include config files for the tools you’re interested in, commit them to git for backups and then symlink/hardlink the file to the expected path for the application.

  • eshep@social.trom.tf
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    @gkpy I assume by “dotfiles” you simply mean “config files” as there should be nothing in your /etc/portage directory that’s hidden. For all configs I want to backup, I just keep a copy of them elsewhere. As for portage stuff, I just copy my make.conf, and everything in each repos.conf and package.* directories.

    If you want to simplify a complex solution to an already simple thing, take a look at bare git worktrees.

  • Eager Eagle@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    1 year ago

    Not a great solution, but my custom set of functions that synchronize the (dot)files just copy them over into a directory preserving their paths within it e.g. cp /etc/hosts ~/.sysbackups/$(hostname)/etc/hosts

    • JubilantJaguar@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      My script rewrites the paths to --etc--hosts and so on. Avoids creating a giant tree of mostly empty directories. Wish distros came with a default out-of-the-box solution for all this.

      • Eager Eagle@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        right, for system files I do the minimal approach only select a handful that I wish to keep, so the tree is easy to search into. A system equivalent to $XDG_CONFIG_HOME would be nice though.