
Ask HN: What are you all using to automate desktop setup and config? - jMyles
So, as seems to happen a couple of times a year, I&#x27;m faced with installing (in my case Ubuntu) GNU&#x2F;Linux on an x86 machine for personal use.<p>Then I&#x27;ll have to go through and do all the things I always do:<p>* Install a bunch of packages: net-tools, vlc, sshfs, and like 30 others<p>* Install Steam and Discord<p>* Install browser extensions<p>* Set some config options<p>* Pair with my bluetooth devices<p>...and on and on.<p>What is everyone using in 2019 to automate some or all of these tasks?
======
afarrell
Nothing.

I’ve found that I do this infrequently enough that the cost of doing writing
and testing code to automate it isn’t worth it.

I’ve found that others do this infrequently enough and with enough variation
of preferences that there isn’t a framework which is sufficiently well-
documented to reduce the above cost.

~~~
_frkl
I've mentioned it a bit further down, but I was sufficiently annoyed by the
absence of such a framework to try to create one:
[https://freckles.io](https://freckles.io)

Documentation and tests could be better, admittedly, but there's just not
enough time in the day. I'd be keen to get input from others though, and I'd
be happy to target specific areas of documentation that they find lacking...

~~~
afarrell
Hmmm... looks interesting. I will likely give it a try on Tuesday or
Wednesday, as I’m onboarding onto a new team with a new osx laptop. I’ll let
you know how it goes.

~~~
_frkl
If you do, please let me know how it goes! There might still be a few
birthing-problems, but I'm fairly confident those can be fixed quickly.

------
jMyles
Sadly, I'm proceeding through a manual exercise of this sort now.

Since a few hours has passed and nobody has anything, I'm kinda assuming that
nothing so great really exists. Maybe just write a shell script? Hard to test
obviously.

Maybe Ansible?

~~~
uponcoffee
I think you caught HN at the wrong time; ansible seems to be the general go to
and chocolately for windows.

If this post doesn't get traction, try
[https://reddit.com/r/sysadmin](https://reddit.com/r/sysadmin) There's some
discussion on this topic there:
[https://www.reddit.com/r/sysadmin/comments/7j1o1g/recommenda...](https://www.reddit.com/r/sysadmin/comments/7j1o1g/recommendations_for_provisioning_linux_laptops/)

~~~
Topgamer7
+1 for ansible

------
mijndert
A very simple bash script that installs some stuff through Homebrew, sets my
default shell to Zsh and copies over some files into my home directory. It's
open source:
[https://github.com/mijndert/dotfiles](https://github.com/mijndert/dotfiles)

------
fastily
I do this pretty frequently, and I've written quite a few bash scripts to
rebuild my preferred environments for my Mac, Ubuntu boxes, raspberry pis,
etc.

It's open source too:
[https://github.com/fastily/autobots](https://github.com/fastily/autobots)

------
eivarv
Shell script that sets OS defaults, copies configs, sets up symlinks and
installs software package managers.

------
bradknowles
Backup and restore from another machine?

I’ve had enough Ansible pain for multiple lifetimes. I might use Chef, but
certainly not Ansible.

~~~
FoxInBoxers
May I ask why you avoid Ansible?

------
_frkl
I'd also use Ansible, but installing browser extensions, and pairing bluetooth
is a bit more difficult, those probably require a different strategy/tool.

If you don't mind me blowing my own horn: I wrote this project that started
off as a way to let me re-install new development machines with a single
command, 'freckles' ( [https://freckles.io](https://freckles.io) ).

It uses Ansible under the hood, but configuration is simpler, all you'd need
is a single text file containing something like:

    
    
        - packages-installed:
            packages:                                                          
              - net-tools                                                                
              - vlc                                                                      
              - sshfs                                                                    
        - file-with-content:                                                           
            path: /home/nancy/.gitconfig                                             
            content: |                                                                
              [user]                                                                 
              email = email@exmple                                                   
              name = Nancy Drew                                                      
        - file-with-content:                                                           
            path: /home/nancy/.tmux.conf                                             
            content: |                                                               
              unbind C-b                                                             
              set -g prefix `                                                        
              bind-key ` send-prefix 
    

Choosing pre-made tasks from:
[https://freckles.io/frecklets/default](https://freckles.io/frecklets/default)
or create your own (for example, there is none for installing steam currently,
but I'm happy to add those over time when users request them -- the nice thing
is those only need to be written once).

Then execute the thing with:

    
    
        frecklecute <your_file>
     

It's smart enough to figure out whether it needs to ask for root and such. It
needs (and autoinstalls if required) a minimal Python and rsync on the target
machine, and it creates and installs some other helper tools into
$HOME/.local/share/freckles, but that can be deleted after a run if necessary.

There's quite a bit more to it, but that'd be the simplest way to use it. The
main thing really is that you can keep your machine specific configuration in
a single, easy-to-read and -create file, and you only need one single command
to apply it to your machine.

EDIT: anybody know how to format code blocks on here so they render on mobile
properly?

------
ryankrage77
sudo apt update && sudo apt upgrade -y

sudo apt install [all the packages I want]

I'm usually working 100% in the terminal (raspi, VPS, WSL, etc), and the
defaults are fine.

------
mbrock
NixOS

~~~
_frkl
Running NixOS on a desktop is a bit of a challenge, and I'm pretty certain not
everybody is prepared to put in the time that is required. That being said, it
is a good learning experience, and once setup you're golden. And you can
always elect to not use NixOS, but only it's package manager, 'nix'.

In the context of OPs question, you might also want to mention home-manager (
[https://github.com/rycee/home-manager](https://github.com/rycee/home-manager)
)

