Combine plainmacs and emacs roles.

This commit is contained in:
Tom Alexander 2023-07-11 00:54:51 -04:00
parent cb84d7d810
commit c1e3b8fc4e
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
18 changed files with 81 additions and 75 deletions

View File

@ -1,2 +1,3 @@
timezone: "America/New_York"
install_bluetooth: true
emacs_flavor: "full"

View File

@ -91,7 +91,7 @@
- jail
- bhyve
- wireguard
- emacs
# - emacs
- mrmanager
- hosts: admin_git:public_dns

View File

@ -0,0 +1 @@
emacs_flavor: "plain" # or full for systems where I do real development.

View File

@ -0,0 +1,19 @@
(progn
(setq make-backup-files nil auto-save-default nil create-lockfiles nil)
(load-theme 'tango-dark t)
(set-face-attribute 'default nil :background "black")
;; Bright yellow highlighting for selected region
(set-face-attribute 'region nil :background "#ffff50" :foreground "black")
;; Bright green cursor to distinguish from yellow region
(set-cursor-color "#ccff66")
;; Hightlight the current line
(set-face-attribute 'line-number-current-line nil :foreground "white")
;; Set default font
(set-face-attribute 'default nil :height 100 :width 'regular :weight 'regular :family "Cascadia Mono")
;; Set fallback font for unicode glyphs
(set-fontset-font "fontset-default" nil (font-spec :name "Noto Color Emoji"))
(menu-bar-mode -1)
(when (fboundp 'tool-bar-mode)
(tool-bar-mode -1))
(when ( fboundp 'scroll-bar-mode)
(scroll-bar-mode -1)))

View File

@ -1,5 +1,5 @@
dependencies:
- users
- fonts
- rust
- plainmacs
- role: rust
when: 'emacs_flavor == "full"'

View File

@ -1,9 +1,21 @@
- name: Install packages
when: 'emacs_flavor == "full"'
package:
name:
- aspell
state: present
- name: Install scripts
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0755
owner: root
group: wheel
loop:
- src: plainmacs
dest: /usr/local/bin/plainmacs
- import_tasks: tasks/freebsd.yaml
when: 'os_flavor == "freebsd"'

View File

@ -2,6 +2,12 @@
package:
name:
- emacs
state: present
- name: Install packages
when: 'emacs_flavor == "full"'
package:
name:
- py39-pygments
- inkscape # to support SVGs in LaTeX
# - prettier # typescript formatting

View File

@ -1,7 +1,30 @@
- name: Build aur packages
register: buildaur
become_user: "{{ build_user.name }}"
command: "aurutils-sync --no-view {{ item }}"
args:
creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*"
loop:
- emacs29-git
- name: Update cache
when: buildaur.changed
pacman:
name: []
state: present
update_cache: true
- name: Install packages
package:
name:
- aspell-en
- emacs29-git
state: present
- name: Install packages
when: 'emacs_flavor == "full"'
package:
name:
- prettier # typescript+yaml formatting
- pyright
- gopls

View File

@ -12,6 +12,7 @@
- ".emacs.d/elisp"
- name: Configure dotfiles
when: 'emacs_flavor == "full"'
copy:
src: "files/{{ item.src }}"
dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
@ -22,7 +23,20 @@
- src: init.el
dest: .emacs.d/init.el
- name: Configure dotfiles
when: 'emacs_flavor == "plain"'
copy:
src: "files/{{ item.src }}"
dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
mode: 0600
owner: "{{ account_name.stdout }}"
group: "{{ group_name.stdout }}"
loop:
- src: plainmacs_init.el
dest: .emacs.d/init.el
- name: Configure elisp files
when: 'emacs_flavor == "full"'
copy:
src: "files/{{ item }}"
dest: "{{ account_homedir.stdout }}/.emacs.d/elisp/{{ item }}"
@ -58,7 +72,8 @@
owner: "{{ account_name.stdout }}"
group: "{{ group_name.stdout }}"
loop:
- emacs_e
- emacs_e # Create an alias 'e' which launches emacs
- plainmacs # Set the EDITOR to plainmacs
- import_tasks: tasks/peruser_freebsd.yaml
when: 'os_flavor == "freebsd"'

View File

@ -1,25 +0,0 @@
- name: Install scripts
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0755
owner: root
group: wheel
loop:
- src: plainmacs
dest: /usr/local/bin/plainmacs
- import_tasks: tasks/freebsd.yaml
when: 'os_flavor == "freebsd"'
- import_tasks: tasks/linux.yaml
when: 'os_flavor == "linux"'
- include_tasks:
file: tasks/peruser.yaml
apply:
become: yes
become_user: "{{ initialize_user }}"
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
loop_control:
loop_var: initialize_user

View File

@ -1,5 +0,0 @@
- name: Install packages
package:
name:
- emacs
state: present

View File

@ -1,22 +0,0 @@
- name: Build aur packages
register: buildaur
become_user: "{{ build_user.name }}"
command: "aurutils-sync --no-view {{ item }}"
args:
creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*"
loop:
- emacs29-git
- name: Update cache
when: buildaur.changed
pacman:
name: []
state: present
update_cache: true
- name: Install packages
package:
name:
- aspell-en
- emacs29-git
state: present

View File

@ -1 +0,0 @@
- import_tasks: tasks/common.yaml

View File

@ -1,18 +0,0 @@
- include_role:
name: per_user
- name: Configure zshrc additional imports
copy:
src: "files/zshrc_{{ item }}"
dest: "{{ account_homedir.stdout }}/.config/ansible_deploy/zshrc/{{ item }}.zsh"
mode: 0600
owner: "{{ account_name.stdout }}"
group: "{{ group_name.stdout }}"
loop:
- plainmacs
- import_tasks: tasks/peruser_freebsd.yaml
when: 'os_flavor == "freebsd"'
- import_tasks: tasks/peruser_linux.yaml
when: 'os_flavor == "linux"'