I frequently reinstall Linux. Is there a tool to say what to install and configure that I can just run once after OS install? Things like

  • Install neovim, signal, steam
  • Configure firefox, desktop environment

I’m using this for just me, on my personal machine.

I don’t anticipate it’s possible between different distros, so assume I’m reinstalling the same distro.

EDIT: thanks for replies. I’m mostly seeing Ansible and NixOS. I’ll start looking at those.

  • Nibodhika@lemmy.world
    link
    fedilink
    arrow-up
    19
    ·
    23 hours ago

    You should have a look at NixOS. It’s a Linux distro where you declare the whole system in configuration like files, in a language called Nix (hence NixOS), then you run a command and that gets resolved into your system.

    It takes a long time to setup the first time, but it’s a breeze when you need to reinstall, and you will never need to reinstall as every boot is a fresh copy of the system you declared.

    There’s also a thing called home-manager which uses the Nix language to declare your home configuration. That part can be used in any other Linux by installing the home-manager package.

    You can declare your OS in a way that the home part is portable for machines running other systems. I do that, then my machines are very easy to declare, and with some groups for things like Base (Terminal, prompt, some things I expect to have on every system like Python, nvim fully configured, etc), Gaming (Steam mostly), UI (Sway, many GUI things I use like browser with extensions, etc) I can add configs for a new machine in instants depending on what I expected for it, and if I ever want to convert my “Steam machine” into a desktop it’s just a couple line changes, regenerate the config and it’s exactly the same as my laptop.

    Honestly I don’t think Nix is for everyone, but it’s a very niche thing that works extremely well for what it sets up to do, and if you’re in the target audience it’s a game changer.

    • a14o@feddit.org
      link
      fedilink
      arrow-up
      3
      ·
      11 hours ago

      I love NixOS but I wouldn’t commend it to people who are at a point in their sysadmin trajectory where they haven’t heard of Ansible. (It’s not just that Nix has a learning curve, it’s that you’re seriously screwed if you can’t tell the difference between a Nix problem and a regular package / kernel issue.)

      OP, use Ansible.

      • Nibodhika@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        6 hours ago

        Yeah, I can see that. But I don’t think that knowing Ansible will teach you that difference. OP seems to know enough about Linux to be comfortable so I would expect him to be able to distinguish between those.

        I agree that Nix has a steep learning curve and it’s not for everyone, but OP specifically asked for a way to declare their system, and Ansible doesn’t work for something you’ll setup now to use in 6 months when you decide to reinstall the system, because the best case scenario is you get your system as it was 6 months ago, but more realistically it doesn’t work and you have to spend time fixing it or doing it manually.

        Don’t get me wrong, Ansible is great, I manage my home server with it, but if I go a while without running the pipeline when I do it rolls back several changes I made manually to test and forgot to consolidate. Nix is annoying because it forces you to declare everything every time, but you’re guaranteed to get the same result you have now, which is very important for the case OP asked about.

      • beeng@discuss.tchncs.de
        link
        fedilink
        arrow-up
        2
        ·
        9 hours ago

        Skip Ansible (IMO). Bit of a hole and slow, pain to write and debug (slow cycles).

        Bite the bullet learn the hard right thing, nixos.