Initial commit

This commit is contained in:
2025-09-03 19:19:15 +02:00
commit 0bafe17c05
11 changed files with 442 additions and 0 deletions

141
.gitignore vendored Normal file
View File

@@ -0,0 +1,141 @@
*.html
*.pdf
# Created by https://www.toptal.com/developers/gitignore/api/vim,intellij
# Edit at https://www.toptal.com/developers/gitignore?templates=vim,intellij
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# SonarLint plugin
.idea/sonarlint/
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/
# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml
# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/
# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$
# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml
# Azure Toolkit for IntelliJ plugin
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
.idea/**/azureSettings.xml
### Vim ###
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
Sessionx.vim
# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
# End of https://www.toptal.com/developers/gitignore/api/vim,intellij

32
README.adoc Normal file
View File

@@ -0,0 +1,32 @@
= My dev-machine setup
:source-highlighter: rouge
This ansible-playbook will setup my development machines and prepare them for work.
== Prepararation
The setup is a bit different for linux and macos, since I can use the local package-manager on linux.
Though on macos I need to install `brew` first!
In both cases we need to install `ansible` and `git` though.
.Prepararation on Debian and Ubuntu
[source,bash]
----
sudo apt install ansible git
----
.Prepararation on macos
[source,bash]
----
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install ansible git
----
== Setup
The setup is simple:
[source,bash]
----
git clone git@gitea.nehrke.info:nemoinho/dev-machine.git ~/Development/dev-machine
cd $_
ansible-playbook main.yml
----

5
ansible.cfg Normal file
View File

@@ -0,0 +1,5 @@
[defaults]
nocows = True
inventory = inventory
become = True
ask-become-pass = True

141
debian.config.yml Normal file
View File

@@ -0,0 +1,141 @@
apt_packages:
- alacritty
- arandr
- asciidoctor
- autoconf
- autorandr
- bash-completion
- btop
- build-essential
- chromium-browser
- colordiff
- compton
- enpass
- eza
- fd-find
- feh
- firefox-devedition
- gcc
- gimp
- git
- git-delta
- google-cloud-cli
- graphviz
- htop
- hugo
- hyphen-de
- i3
- imagemagick
- jq
- kitty
- libcairo2-dev
- libev-dev
- libfontconfig1-dev
- libgif-dev
- libjpeg-dev
- libpam0g-dev
- libreoffice
- libreoffice-l10n-de
- libssl-dev
- libx11-xcb-dev
- libxcb-composite0-dev
- libxcb-image0-dev
- libxcb-randr0-dev
- libxcb-util-dev
- libxcb-xinerama0-dev
- libxcb-xkb-dev
- libxcb-xrm-dev
- libxkbcommon-dev
- libxkbcommon-x11-dev
- lm-sensors
- lsb-release
- lynx
- make
- meld
- mutt
- mythes-de
- mythes-en-us
- nala
- ncal
- neovim
- nmap
- oathtool
- openssl
- pavucontrol
- pgcli
- pkg-config
- plantuml
- podman
- podman-compose
- polybar
- pulseaudio-utils
- ripgrep
- rofi
- ruby-asciidoctor-kroki
- ruby-asciidoctor-pdf
- ruby-asciidoctor-plantuml
- ruby-coderay
- ruby-pygments.rb
- ruby-rouge
- tofu
- tree
- spotify-client
- stow
- uuid
- whois
- zoxide
# not all software can be found in standard apt...
apt_repositories:
# Important: when a repo has more than _one_ key each key requires a name!!
- name: enpass
sign_keys:
- url: https://apt.enpass.io/keys/enpass-linux.key
repositories: https://apt.enpass.io/
- name: spotify
sign_keys:
- url: https://download.spotify.com/debian/pubkey_C85668DF69375001.gpg
repositories: https://repository.spotify.com/
components: non-free
- name: opentofu
sign_keys:
- url: https://get.opentofu.org/opentofu.gpg
name: opentofu
format: gpg
- url: https://packages.opentofu.org/opentofu/tofu/gpgkey
name: opentofu-repo
repositories: https://packages.opentofu.org/opentofu/tofu/any/
suites: "any"
types:
- deb
- deb-src
- name: hashicorp
sign_keys:
- url: https://apt.releases.hashicorp.com/gpg
repositories: https://apt.releases.hashicorp.com/
suites: "{{ ansible_distribution_release | lower }}"
- name: google-cloud-sdk
sign_keys:
- url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
repositories: https://packages.cloud.google.com/apt/
suites: cloud-sdk
- name: neovim
sign_keys:
- url: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x9dbb0be9366964f134855e2255f96fcf8231b6dd
repositories: https://ppa.launchpadcontent.net/neovim-ppa/unstable/ubuntu
suites: "{{ ansible_distribution_release | lower }}"
types:
- deb
- deb-src
- name: mozilla
sign_keys:
- url: https://packages.mozilla.org/apt/repo-signing-key.gpg
repositories: https://packages.mozilla.org/apt/
suites: "mozilla"

2
inventory Normal file
View File

@@ -0,0 +1,2 @@
[all]
localhost ansible_connection=local

45
macos.config.yml Normal file
View File

@@ -0,0 +1,45 @@
# brew packages are packages for the command line
brew_packages:
- asciidoctor
- awscli
- btop
- colordiff
- eza
- fd
- git
- git-delta
- gcloud-cli
- graphviz
- htop
- hugo
- imagemagick
- jq
- lynx
- mutt
- nmap
- nvim
- oathtool
- opentofu
- plantuml
- pgcli
- ripgrep
- stow
- tree
- uuid
- whois
- zoxide
# brew casks are visual programms
brew_casks:
- alacritty
- enpass
- firefox@developer-edition
- gimp
- gnucash
- kitty
- spotify
- ungoogled-chromium
# mas apps are apps from the apple app-store
mas_apps: []

12
main.yml Normal file
View File

@@ -0,0 +1,12 @@
---
- hosts: localhost
vars_files:
- debian.config.yml
- macos.config.yml
roles:
- role: roles/macos
tags: [macos]
when: ansible_os_family == 'Darwin'
- role: roles/debian
tags: [debian]
when: ansible_os_family == 'Debian'

View File

@@ -0,0 +1,25 @@
- name: "Download key for {{ item.name }}"
become: yes
get_url:
url: "{{ key.url }}"
dest: "/etc/apt/keyrings/{{ key.name | default(item.name) }}.{{ key.format | default('asc') }}"
mode: u=rw,g=r,o=r
loop: "{{ item.sign_keys }}"
loop_control:
loop_var: key
- name: "Setup apt repository for {{ item.name }}"
become: yes
deb822_repository:
name: "{{ item.name }}"
types: "{{ item.types | default('deb') }}"
uris: "{{ item.repositories }}"
suites: "{{ item.suites | default('stable') }}"
components: "{{ item.components | default('main') }}"
architectures: "{{ item.arch | default([ansible_architecture] | map('extract', deb_architecture) | first) }}"
# Note, the ugliness is needed since jinja2 makes it invalid otherwise
signed_by: "{%- set output = [] %}
{%- for result in item.sign_keys %}
{{- output.append('/etc/apt/keyrings/' ~ (result.name | default(item.name)) ~ '.' ~ (result.format | default('asc'))) }}
{%- endfor %}
{{- output | join(',') -}}"

View File

@@ -0,0 +1,23 @@
- name: Ensure tools to add additional apt sources
tags: [repos]
become: yes
package:
name:
- ca-certificates
- curl
- gnupg
state: present
update_cache: true
- name: Ensure additional apt sources
tags: [repos]
include_tasks: 3rd-party-apt-repository.yml
loop: "{{ apt_repositories }}"
- name: Ensure system packages
become: yes
tags: [packages]
apt:
name: "{{ apt_packages }}"
state: present
update_cache: true

View File

@@ -0,0 +1,4 @@
deb_architecture:
aarch64: arm64
x86_64: amd64

View File

@@ -0,0 +1,12 @@
- name: "Ensure brew-packages"
tags: [packages]
homebrew:
name: "{{ item }}"
loop: "{{ brew_packages }}"
- name: "Ensure brew casks"
tags: [packages]
homebrew_cask:
name: "{{ item }}"
loop: "{{ brew_casks }}"