Enable templating for dotfiles
This commit is contained in:
6
_machines/notebook01.yml
Normal file
6
_machines/notebook01.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
font_size: 9
|
||||
letter_space: 0
|
||||
mail: hannes.koerber@haktec.de
|
||||
git_gpg_sign: true
|
||||
gpg_agent: true
|
||||
ssh_agent: true
|
||||
6
_machines/tb-hak.yml
Normal file
6
_machines/tb-hak.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
font_size: 10
|
||||
letter_space: 0
|
||||
mail: hannes.koerber@tradebyte.com
|
||||
git_gpg_sign: false
|
||||
gpg_agent: false
|
||||
ssh_agent: false
|
||||
16
dotfiles.yml
16
dotfiles.yml
@@ -1,16 +1,25 @@
|
||||
empty_directories:
|
||||
- .i3
|
||||
dotfiles:
|
||||
- from: autostart
|
||||
to: .autostart
|
||||
- from: git/gitconfig
|
||||
to: .gitconfig
|
||||
template: true
|
||||
- from: gnupg/dirmngr.conf
|
||||
to: .gnupg/dirmngr.conf
|
||||
- from: gnupg/gpg-agent.conf
|
||||
to: .gnupg/gpg-agent.conf
|
||||
- from: gnupg/gpg.conf
|
||||
to: .gnupg/gpg.conf
|
||||
- from: i3
|
||||
to: .i3
|
||||
- from: i3/config
|
||||
to: .i3/config
|
||||
template: true
|
||||
- from: i3/i3status.conf
|
||||
to: .i3/i3status.conf
|
||||
template: true
|
||||
- from: i3/scripts
|
||||
to: .i3/scripts
|
||||
- from: tmux/tmux.conf
|
||||
to: .tmux.conf
|
||||
- from: vim/vimrc
|
||||
@@ -19,11 +28,14 @@ dotfiles:
|
||||
to: .vimrc
|
||||
- from: x/Xresources
|
||||
to: .Xresources
|
||||
template: true
|
||||
- from: x/xinitrc
|
||||
to: .xinitrc
|
||||
- from: zsh/zprofile
|
||||
to: .zprofile
|
||||
template: true
|
||||
- from: zsh/zshrc
|
||||
to: .zshrc
|
||||
template: true
|
||||
- from: zsh/zshrc.d
|
||||
to: .zshrc.d
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[user]
|
||||
name = Hannes Körber
|
||||
email = hannes.koerber@haktec.de
|
||||
email = {{ machine.mail }}
|
||||
signingkey = 0x078A167A8741BD30
|
||||
[github]
|
||||
user = hakoerber
|
||||
@@ -67,7 +67,7 @@
|
||||
commitBeforeMerge = false
|
||||
detachedHead = false
|
||||
[commit]
|
||||
gpgSign = true
|
||||
gpgSign = {{ machine.git_gpg_sign|bool }}
|
||||
cleanup = strip
|
||||
status = true
|
||||
[status]
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
# The default terminal
|
||||
set $terminal "urxvt -title terminal"
|
||||
set $calc "urxvt256c -title term -e $SHELL -i -c calc"
|
||||
set $calc "urxvt -title calc -e $SHELL -i -c calc"
|
||||
|
||||
set $scriptdir ~/.i3/scripts
|
||||
|
||||
@@ -279,7 +279,7 @@ assign [class="^Keepassx$"] $workspace8
|
||||
floating_minimum_size 0 x 0
|
||||
floating_maximum_size 0 x 0
|
||||
|
||||
font pango:Inconsolata 10
|
||||
font pango:Inconsolata {{ machine.font_size }}
|
||||
|
||||
################################################################################
|
||||
### COLOR SETTINGS #############################################################
|
||||
@@ -353,7 +353,7 @@ bar {
|
||||
|
||||
id bar-0
|
||||
|
||||
font pango:Inconsolata, FontAwesome 10
|
||||
font pango:Inconsolata, FontAwesome {{ machine.font_size }}
|
||||
|
||||
colors {
|
||||
background #222222
|
||||
36
playbook.yml
36
playbook.yml
@@ -2,11 +2,22 @@
|
||||
connection: local
|
||||
become: false
|
||||
tasks:
|
||||
- name: read machine-specific variables
|
||||
include_vars:
|
||||
file: _machines/{{ ansible_hostname }}.yml
|
||||
name: machine
|
||||
tags:
|
||||
- always
|
||||
|
||||
- set_fact:
|
||||
distro: "{{ ansible_distribution|lower }}"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- set_fact:
|
||||
user: "{{ ansible_user_id }}"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- name: configure sudoers
|
||||
lineinfile:
|
||||
@@ -153,6 +164,16 @@
|
||||
- name: load dotfile list
|
||||
include_vars:
|
||||
file: dotfiles.yml
|
||||
tags:
|
||||
- dotfiles
|
||||
|
||||
- name: create empty directories for dotfiles
|
||||
file:
|
||||
state: directory
|
||||
path: ~/{{ item }}
|
||||
with_items: "{{ empty_directories }}"
|
||||
tags:
|
||||
- dotfiles
|
||||
|
||||
- name: link this folder to ~/.dotfiles
|
||||
file:
|
||||
@@ -160,6 +181,8 @@
|
||||
force: true
|
||||
path: "{{ ansible_user_dir }}/.dotfiles"
|
||||
src: "{{ playbook_dir }}"
|
||||
tags:
|
||||
- dotfiles
|
||||
|
||||
- name: link dotfiles
|
||||
file:
|
||||
@@ -167,7 +190,20 @@
|
||||
force: true
|
||||
path: "{{ ansible_user_dir }}/{{ item.to }}"
|
||||
src: ~/.dotfiles/{{ item.from }}
|
||||
when: not item.template|default(false)
|
||||
with_items: "{{ dotfiles }}"
|
||||
tags:
|
||||
- dotfiles
|
||||
|
||||
- name: deploy dotfiles templates
|
||||
template:
|
||||
src: ~/.dotfiles/{{ item.from }}.j2
|
||||
dest: "{{ ansible_user_dir }}/{{ item.to }}"
|
||||
force: true
|
||||
when: item.template|default(false)
|
||||
with_items: "{{ dotfiles }}"
|
||||
tags:
|
||||
- dotfiles
|
||||
|
||||
- name: create directories
|
||||
file:
|
||||
|
||||
@@ -2,8 +2,8 @@ Xcursor.theme: Vanilla-DMZ
|
||||
|
||||
URxvt.scrollBar: false
|
||||
|
||||
URxvt.font: xft:Inconsolata:size=10
|
||||
URxvt.letterSpace: -1
|
||||
URxvt.font: xft:Inconsolata:size={{ machine.font_size }}
|
||||
URxvt.letterSpace: {{ machine.letter_space }}
|
||||
|
||||
URxvt.perl-ext: default,matcher,selection-to-clipboard,font-size,resize-font
|
||||
URxvt.url-launcher: /usr/bin/xdg-open
|
||||
@@ -51,6 +51,12 @@ fi
|
||||
# because gpg-agent is somehow broken for ssh, use the usual ssh-agent
|
||||
eval $(ssh-agent -s)
|
||||
|
||||
{% if distro == 'fedora' %}
|
||||
alias urxvt=urxvt256c
|
||||
{% endif %}
|
||||
|
||||
alias vim="nvim"
|
||||
|
||||
# exec startx breaks some logind fuckery, without exec it works
|
||||
if [[ -z $DISPLAY ]] ; then
|
||||
if (( $XDG_VTNR == 1 )) ; then
|
||||
@@ -2,12 +2,16 @@
|
||||
|
||||
_zshdir="$HOME/.zshrc.d"
|
||||
|
||||
{% if machine.gpg_agent %}
|
||||
export GPG_TTY=$(tty)
|
||||
gpg-connect-agent updatestartuptty /bye >/dev/null
|
||||
{% endif %}
|
||||
|
||||
{% if machine.ssh_agent %}
|
||||
if $(ssh-add -l 2>/dev/null | grep -q "no identities") ; then
|
||||
ssh-add
|
||||
fi
|
||||
{% endif %}
|
||||
|
||||
for file in "${_zshdir}"/* ; do
|
||||
if [[ -e "$file" ]] ; then
|
||||
Reference in New Issue
Block a user