Stop using install.sh! Start using install.yml! DAJE...

Daje - A general purpose Ansible dotfiles installer

Configure one time and run everywhere.

What is this

I've never liked using a big bash script to install my dotfiles, because the more you add, the more that becomes: bloated, complex to maintain, and less reproducible across multiple platforms. This is why I start write this simple and easy to mantain playbook template that works in every *nix system.

How it works

Create a profile, define the environment you want and let ansible do the rest.

A Profile could be a generic os configuration (e.g.: os_Archlinux or os_MacOSX) or a specific profile (e.g.: profile1).

Every package and configuration specified on the Profile will be installed.

How to use it

First of all you need to have installed ansible, you could do with pip or with any other package manage.

Than create a Profile and configure it, you can find on vars directory some examples where is possible to take one of it as a template.

After create your own profile run:

  • Generic os profile (must be in vars directory)

     ansible-playbook -K install.yml
  • Specific profile (must be in vars/profiles directory)

     ansible-playbook -K install.yml -e 'profile=<profile_name>'

List of all variables supported

This is the complete list of every variable that is possible to configure:

Variable Required Example Description
username yes wabri Username where the configuration will be apply
group no staff (default: {{ username }}) Group of username
install_command yes brew install --quiet Package manager command to install dependencies (N.B.: This need to be a no prompt install because we will not have the access to the standard input, for more info go to Install_command section)
update_command no pacman -Syyu --noconfirm Package manager command to install dependencies (N.B.: all the rules of install_command must be apply to this variable)
home_dir yes /home/wabri Home directory where the configuration file must be place
workspace_dir no Documents/Workspaces Workspaces directory to create
default_shell no zsh Default shell to apply
default_keyboard no us Default kayboard layout to apply
ide_install no true Is a boolean variable used to enable or not the ide installation. (N.B. Ide vs System vs General)
system_install no true Is a boolean variable used to enable or not the system installation (N.B. Ide vs System vs General)
general_install no true Is a boolean variable used to enable or not the general installation (N.B. Ide vs System vs General)
before no - paru
- homebrew
List of the tasks to apply before every other tasks. This could be helpfull for package manager installation or multiple service that need to be stop. (N.B. List of all tasks)
after no - bluetooth Like before, but after. (N.B. List of all tasks)
ide_packages no - git
- zsh
- vim
- tmux
List of packages to install for ide environment.
system_packages no - htop
- vagrant
- arandr
Like ide_packages but for system_packages.
general_packages no - firefox
- spotify
Like system_packages but for general_packages.
ide_config no - vim
- zsh
-ohmyzsh
List of tasks that apply configurations for the ide environment. (N.B. List of all tasks)
system_config no - i3
- gtk3
Like ide_config but for system_packages. (N.B. List of all tasks)
general_config no - vim
- zsh
-ohmyzsh
Like system_config but for general_packages. (N.B. List of all tasks)

Install_command

In order to have a polished and automated installation is necessary to set up a package manager installation command to run without any prompt for standard input. An example could be:

  • For Arch distribution: pacman -Y --noconfirm or paru -Y --noconfirm
  • For MacOSX: brew install --quiet
  • For Debian distribution: apt-get install --yes

Ide vs System vs General

If you're wondering why this separation from: Ide, System and General, the answer is easy to say: division of responsibilities. If I want to refresh the ide configuration or add a new package to it, I don't want to go through the system and general configuration, so I will disable the system_install and general_install and run the installation.

If you're wondering where to put a configuration task or a package installation, ask this question:

  • Is for my vim or visual studio code (for example) configuration? Yes, then put on ide.
  • Is for my i3 or yabai configuration? Yes, then put on system.
  • Is for my firefox or spotify configuration? Yes, then put on general.

List of all tasks

Task Requirements/Description Reference
alacritty Configuration file must be on .config/alacritty/alacritty.yml github/alacritty
bash Configuration file must be on .bashrc gnu/bash
bluetooth These task enable systemd bluetooth service ---
dunst Configuration file must be on .config/dunst/ dunst-project
git Configuration file must be .gitconfig and .gitignore git
grub2-themes Install and select theme (default: whitesur) for grub2. (Works only on linux and not in all distributions) github/grub2-themes
gtk3 Configuration file must be .config/gtk-3.0/ gtk.org
homebrew Install homebrew on MacOSX brew.sh
i3 Configuration file must be .config/i3/ i3wm.org
neofetch Configuration file must be .config/neofetch/ dylanaraps/neofetch
nitrogen Configuration file must be .config/nitrogen/ github/nitrogen
ohmyzsh Install oh-my-zsh ohmyz.sh
paru Install paru on Archlinux github/paru
polybar Configuration file must be .config/polybar/ github/polybar
rofi Configuration file must be .config/rofi/ davatorium/rofi
rofithemes Install rofi themes collection lr-tech/rofi-themes-collection
sddm-sugar-candy Install sddm sugar candy theme (works only on arch with AUR packages enabled) aur/sddm-sugar-candy-git
spotify Install spotify with spicetify themes and more. Must modify task if want a different theming. (For now it works only on linux... sorry!) khanhas/spicetify-cli
starship Install starship the minimal, blazing-fast, and infinitely customizable prompt for any shell! starship.rs
tmux Configuration file must be .tmux.conf github/tmux
tpm Install tmux plugin manager and plugins listed on .tmux.conf github/tmux-plugins
vim-plug Install vim-plug and plugins listed on .vim/plugins.vim github/vim-plug
vim Configuration file must be .vimrc vim.org
zsh Configuration file must be .zshrc zsh.org

Q&A

Can I put everything on a single package and configuration list?

It will works, but are you sure to do it? See Ide vs System vs General.

I have created a new task and I want to add to this template, how can I do it?

Open a pull request and add that task.

Example repository

I create these template for my dotfiles -> wabri/dotfiles.

Owner
Schrödinger Hat
Schrödinger Hat é una community, un podcast, una serie di live streaming e molto altro!
Schrödinger Hat
Similar Resources

gokp aims to install a GitOps Native Kubernetes Platform

gokp gokp aims to install a GitOps Native Kubernetes Platform. This project is a Proof of Concept centered around getting a GitOps aware Kubernetes Pl

Nov 4, 2022

Install hubble-ui on GKE Dataplane V2

GKE Hubble Export This is a grpc server wrapper that re-export the cilium agent's observer service and peer service from the local domain socket. And

Jan 2, 2023

The missing package manager for golang binaries (its homebrew for "go install")

Bingo: The missing package manager for golang binaries (its homebrew for "go install") Do you love the simplicity of being able to download & compile

Oct 31, 2022

Operator Permissions Advisor is a CLI tool that will take a catalog image and statically parse it to determine what permissions an Operator will request of OLM during an install

Operator Permissions Advisor is a CLI tool that will take a catalog image and statically parse it to determine what permissions an Operator will request of OLM during an install. The permissions are aggregated from the following sources:

Apr 22, 2022

Using the Golang search the Marvel Characters. This project is a web based golang application that shows the information of superheroes using Marvel api.

Using the Golang search the Marvel Characters. This project is a web based golang application that shows the information of superheroes using Marvel api.

marvel-universe-web using the Golang search the Marvel Universe Characters About The Project This project is a web based golang application that shows

Oct 10, 2021

How to get a Go / Golang app using the Gin web framework running natively on Windows Azure App Service WITHOUT using a Docker container

Go on Azure App Service View the running app - https://go-azure-appservice.azurewebsites.net 😎 This is an example repo of how to get a Go / Golang a

Nov 28, 2022

Supporting your devops by shortening your strings using common abbreviations and clever guesswork

abbreviate Shorten your strings using common abbreviations. Supported by Tidelift Motivation This tool comes out of a frustration of the name of resou

Dec 14, 2022

Copy files and artifacts via SSH using a binary, docker or Drone CI.

drone-scp Copy files and artifacts via SSH using a binary, docker or Drone CI. Feature Support routines. Support wildcard pattern on source list. Supp

Dec 6, 2022

CSI Driver for dynamic provisioning of Persistent Local Volumes for Kubernetes using LVM.

CSI Driver for dynamic provisioning of Persistent Local Volumes for Kubernetes using LVM.

OpenEBS LVM CSI Driver CSI driver for provisioning Local PVs backed by LVM and more. Project Status Currently the LVM CSI Driver is in alpha

Dec 24, 2022
Comments
  • Create github action for ci cd

    Create github action for ci cd

    • golang ci
    • autopublish to homebrew
    • commitlint https://github.com/wagoid/commitlint-github-action
    • releasedrafter https://github.com/release-drafter/release-drafter
  • Multi-dotfiles manage

    Multi-dotfiles manage

    It could be useful to have multiple dotfile management, for example a dotfiles could be private and one public.

    To apply a specific profile (prof1) of a dotfiles (dots1):

    daje apply dots1:prof1
    

    An other example:

    daje apply dots2:prof3
    

    Majbe in configuration we need something like a default dotfiles, to change it we could add a config command:

    daje config dots.default 'dots1' 
    
  • Profile management

    Profile management

    In the old version of daje we had os_*.yml that be use as default profile if matched the os where daje was run, otherwise you can pass the -e 'profile=<profile_name>' variable to change it.

    We need to consider that more profile could be used in a system or more profile could be define for a OS. Maybe use a tree like hierarchy:

    profile
      |
      |-- mac
      |        |
      |        |-- main (as default configuration for mac)
      |        |
      |        |-- python (seconday configuration for mac)
      |
      |-- arch_vm1
               |
               |-- main (as default configuration for arch_vm1)
               |
               |-- javascript (seconday configuration for arch_vm1)
               |
               |-- go (third configuration for arch_vm1)
    

    We could imagine if I want to install all profile mac I can run: daje apply mac to only apply main configuration, daje apply arch_vm1 main,go to apply a specific subset of configuration for a profile and to apply all the configuration of a profile we use daje apply mac --all.

    These are just ideas, they should be argued and detailed much more 😬

  • configuration directory and file

    configuration directory and file

    I think we need to discus about where to put all the configurations, as a standard we could use ~/.config and put there daje like this ~/.config/daje.

    Another issue is the file extension, maybe the easy way is yaml(?).

    This need to be defined because all of the commands and actions will refer to these configurations.

    To manage configuration we can allow to edit those files or we can think about a config argument as it is done with git:

    daje config default.profile 'main'
    daje config root.allowed 'false'
    

    Something like this!

Go version manager. Super simple tool to install and manage Go versions. Install go without root. Gobrew doesn't require shell rehash.

gobrew Go version manager Install or update With curl $ curl -sLk https://git.io/gobrew | sh - or with go $ go get -u github.com/kevincobain2000/gobre

Jan 5, 2023
ecsk is a CLI tool to interactively use frequently used functions of docker command in Amazon ECS. (docker run, exec, cp, logs, stop)
ecsk is a CLI tool to interactively use frequently used functions of docker command in Amazon ECS. (docker run, exec, cp, logs, stop)

English / 日本語 ecsk ECS + Task = ecsk ?? ecsk is a CLI tool to interactively use frequently used functions of docker command in Amazon ECS. (docker run

Dec 13, 2022
Ever wanted to stop a PVC from deleting?
Ever wanted to stop a PVC from deleting?

cnskunkworks-unterminate Oh no! This repository will show you how to unterminate terminating kubernetes resources. It relies on manipulating the data

Nov 18, 2021
Automatically stop GCE instances
Automatically stop GCE instances

auto-stop-gce-instances Architecture How to deploy 1. Deploy Pub/Sub $ gcloud pubsub topics create $PUBSUB_NAME 2. Deploy Cloud Functions $ gcloud fu

Nov 28, 2021
Quick start repository for creating a Terraform provider using terraform-plugin-framework

Terraform Provider Scaffolding (Terraform Plugin Framework) This template repository is built on the Terraform Plugin Framework. The template reposito

Dec 15, 2022
This plugin helps you to use the AWS Command Line Interface (AWS CLI) to start and end sessions to your managed instances

Session Manager Plugin This plugin helps you to use the AWS Command Line Interface (AWS CLI) to start and end sessions to your managed instances. Sess

Dec 28, 2022
App for VMware Workstartion to auto start VM's on windows reboot

VMware Workstation AutoStart This is an auto start app for VMware Workstation to auto start VM's on windows reboot with VMware Workstation installed.

Dec 15, 2021
Igo Agent is the agent of Igo, a command-line tool, through which you can quickly start Igo

igo agent 英文 | 中文 Igo Agent is the agent of Igo, a command-line tool, through which you can quickly start Igo, and other capabilities may be added lat

Dec 22, 2021
Getting start kubernetes operators.

Robot Operator Tutorial Intro This project understand to concept of Kubebuiler and creating native Kubenetes native resources. YAML sample can be foun

Jan 13, 2022
operator to install cluster manager and klusterlet.

registration-operator Minimum cluster registration and work Community, discussion, contribution, and support Check the CONTRIBUTING Doc for how to con

Dec 14, 2022