nix #11

Manually merged
geoffrey merged 113 commits from nix into main 2023-12-09 21:43:01 +01:00
417 changed files with 3450 additions and 7204 deletions

5
.gitignore vendored
View file

@ -1 +1,4 @@
__pycache__
*/system
*/vm
*/vmWithBootLoader
*.qcow2

9
.gitmodules vendored
View file

@ -1,9 +0,0 @@
[submodule "config/automatrop/roles/mnussbaum.base16-builder-ansible"]
path = config/automatrop/roles/mnussbaum.base16-builder-ansible
url = https://github.com/GeoffreyFrogeye/base16-builder-ansible.git
[submodule "config/automatrop/plugins/modules/aur"]
path = config/automatrop/plugins/modules/aur
url = https://github.com/kewlfft/ansible-aur.git
[submodule "config/automatrop/plugins/modules/gpg_key"]
path = config/automatrop/plugins/modules/gpg_key
url = https://github.com/netson/ansible-gpg-key.git

37
README.md Normal file
View file

@ -0,0 +1,37 @@
# Geoffrey Frogeye's dotfiles
This repo holds most of my systems configuration.
It is built on top of the Nix ecosystem
## Directory structure
- `os`, `hm`, `nod`: Re-usable configuration for [NixOS](https://nixos.org/), [home-manager](https://github.com/nix-community/home-manager/#home-manager-using-nix), [Nix-on-Droid](https://github.com/nix-community/nix-on-droid#nix-on-droid) respectively
- `<module-name>`: Module. Used to separate configuration in separate logical units.
- `default.nix`: Entrypoint for that module. Contains Nix configuration for the module.
- `<other file>`: Extra files: scripts to be installed, or ... whatever.
- `default.nix`: Entrypoint for that system. Import all the modules.
- `<other file>`: Files non-conforming to the structure above because I'm hurrying to have everything working before cleaning.
- `dk`: Re-usable configuration for [disko](https://github.com/nix-community/disko#disko---declarative-disk-partitioning)
- `<name>.nix`: Partitionning scheme configuration. Don't assume a specific context, it will be imported as Disko and NixOS config.
- `options.nix`: Definition of options exposed to all systems (even though if not relevant for all, it's for simplicity sake).
- `<profile-name>` (e.g. `curacao`): Configurations for my different devices
- `options.nix`: Common options configuration. Don't assume a specific context (for reasons unclear, I'm sure I can do something with that).
- `hardware.nix`: NixOS configuration for that specific device.
- `dk.nix`: Partitionning configuration. Import a top-level `dk` scheme, adding disks ids and other configuration required.
- `os.nix`, `hm.nix`, `nod.nix`: Entrypoint for the device/system configuration. Imports the above files (last two only for NixOS) and contains configuration specific to this combination.
- `<profile-name>_<media>` (e.g. `pindakaas_sd`): Alternate configuration for a device. Used to test a configuration without altering the "main" one.
- `options.nix`: Same as above. Can be a symlink.
- `hardware.nix`: Same as above. Should be a symlink.
- `dk.nix`: Same as above. Should not be a symlink.
- `os.nix`, `hm.nix`, `nod.nix`: Same as above. Should not be a symlink.
## Scripts
They all have a `-h` flag.
Except `add_channels.sh`, which should be removed as soon as I migrate to Flakes.
## Extensions
There's some things I'm not putting in this public repo: work-related things, and other sensitive things that probably shouldn't be public.
Those are stored in extensions, i.e. repos with a similar structure to this one, and ultimately importing things from it.
This is why you might see options not being seemingly used.

8
add_channels.sh Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
# TODO Flakes
nix-channel --add https://nixos.org/channels/nixos-23.11 nixpkgs
nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager
nix-channel --add https://github.com/NixOS/nixos-hardware/archive/8772491ed75f150f02552c60694e1beff9f46013.tar.gz nixos-hardware
nix-channel --update

View file

@ -1,2 +0,0 @@
clear
reset

View file

@ -1,7 +0,0 @@
#!/usr/bin/env bash
source ~/.config/shell/shenv
source ~/.config/shell/commonenv
source ~/.config/shell/shrc
source ~/.config/shell/commonrc
source ~/.config/shell/bashrc

5
bashrc
View file

@ -1,5 +0,0 @@
#!/usr/bin/env bash
source ~/.config/shell/shrc
source ~/.config/shell/commonrc
source ~/.config/shell/bashrc

67
build_os.sh Executable file
View file

@ -0,0 +1,67 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash
#! nix-shell -p bash nix-output-monitor
set -euo pipefail
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# Parse arguments
function help {
echo "Usage: $0 [-h|-v|-b] profile"
echo "Build NixOS configuration on the local machine."
echo
echo "Arguments:"
echo " profile: OS/disk profile to use"
echo
echo "Options:"
echo " -h: Display this help message."
echo " -v: Build a virtual machine."
echo " -b: Build a virtual machine with boot loader."
}
attr=system
while getopts "hvb" OPTION
do
case "$OPTION" in
h)
help
exit 0
;;
v)
attr=vm
;;
b)
attr=vmWithBootLoader
;;
?)
help
exit 2
;;
esac
done
shift "$(($OPTIND -1))"
if [ "$#" -ne 1 ]
then
help
exit 2
fi
profile="$1"
profile_dir="${SCRIPT_DIR}/${profile}"
if [ ! -d "$profile_dir" ]
then
echo "Profile not found."
fi
nixos_config="${profile_dir}/os.nix"
if [ ! -f "$nixos_config" ]
then
echo "NixOS configuration not found."
fi
set -x
nom-build '<nixpkgs/nixos>' -I "nixos-config=${nixos_config}" -A "$attr" -o "${profile_dir}/${attr}"
echo 

View file

@ -1 +0,0 @@
theme

View file

@ -1,4 +0,0 @@
#include ".config/Xresources/xft"
#include ".config/Xresources/theme"
#include ".config/Xresources/xterm"
#include ".config/Xresources/urxvt"

View file

@ -1,61 +0,0 @@
! Scrollback position
! TODO Does not work
! do not scroll with output
URxvt*scrollTtyOutput: false
! scroll in relation to buffer (with mouse scroll or Shift+Page Up)
URxvt*scrollWithBuffer: true
! scroll back to the bottom on keypress
URxvt*scrollTtyKeypress: true
! Scrollback buffer in secondary screen
! TODO Does not work
URxvt.secondaryScreen: 1
URxvt.secondaryScroll: 0
! No scroll bar
URxvt*scrollBar: false
! Font declaration
URxvt.font: xft:DejaVuSansMono Nerd Font Mono:size=12:antialias=true,xft:Twemoji:size=12:antialias=true,xft:symbola:size=12:minspace=False
! Font spacing
URxvt.letterSpace: 0
! Disable Ctrl+Shift default bindings
URxvt.iso14755: false
URxvt.iso14755_52: false
! Copy/Paste CLIPBOARD selection with Ctrl+Shift+C/V
URxvt.keysym.C-S-C: eval:selection_to_clipboard
URxvt.keysym.C-S-V: eval:paste_clipboard
! Extensions
URxvt.perl-ext-common: resize-font,bell-command,readline,selection
! Changing font size on the fly (extension: resize-font, package: urxvt-resize-font-git)
URxvt.keysym.C-KP_Subtract: resize-font:smaller
URxvt.keysym.C-KP_Add: resize-font:bigger
! Fake transparency (without compositing manager)
urxvt*transparent: true
urxvt*shading: 30
! True transparency (with compositing manager)
!urxvt*depth: 32
!urxvt*background: rgba:2700/2800/2200/c800
! Bell command (extension: bell-command)
URxvt.bell-command: play -n synth sine C5 sine E4 remix 1-2 fade 0.1 0.2 0.1 &> /dev/null
! Open URL in browser (extension: matcher)
! URxvt.url-launcher: o
! URxvt.matcher.button: 1
! URxvt.matcher.rend.0: Uline Bold fg5

View file

@ -1,9 +0,0 @@
Xft.dpi: 96
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.autohint: false
Xft.hintstyle: hintslight
Xft.lcdfilter: lcddefault
Xcursor.theme: Menda-Cursor
Xcursor.size: 0

View file

@ -1,15 +0,0 @@
xterm*faceName : DejaVuSansMono Nerd Font Mono:size=12:antialias=true
xterm*dynamicColors: true
xterm*utf8: 2
xterm*eightBitInput: true
xterm*saveLines: 512
xterm*scrollKey: true
xterm*scrollTtyOutput: false
xterm*scrollBar: false
xterm*rightScrollBar: false
xterm*jumpScroll: true
xterm*multiScroll: true
xterm*toolBar: false
XTerm.vt100.translations: #override \n\
Ctrl Shift <Key>C: copy-selection(CLIPBOARD) \n\
Ctrl Shift <Key>V: insert-selection(CLIPBOARD)

View file

@ -1,2 +0,0 @@
theme.yml
alacritty.yml

View file

@ -1,727 +0,0 @@
# vi:syntax=yaml
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.
#import:
# - /path/to/alacritty.yml
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
#TERM: xterm-256color
window:
# Window dimensions (changes require restart)
#
# Number of lines/columns (not pixels) in the terminal. The number of columns
# must be at least `2`, while using a value of `0` for columns and lines will
# fall back to the window manager's recommended size.
#dimensions:
# columns: 0
# lines: 0
# Window position (changes require restart)
#
# Specified in number of pixels.
# If the position is not set, the window manager will handle the placement.
#position:
# x: 0
# y: 0
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides.
#padding:
# x: 0
# y: 0
# Spread additional padding evenly around the terminal content.
dynamic_padding: false
# Window decorations
#
# Values for `decorations`:
# - full: Borders and title bar
# - none: Neither borders nor title bar
#
# Values for `decorations` (macOS only):
# - transparent: Title bar, transparent background and title bar buttons
# - buttonless: Title bar, transparent background and no title bar buttons
#decorations: full
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
#startup_mode: Windowed
# Window title
#title: Alacritty
# Allow terminal applications to change Alacritty's window title.
dynamic_title: true
# Window class (Linux/BSD only):
#class:
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# GTK theme variant (Linux/BSD only)
#
# Override the variant of the GTK theme. Commonly supported values are `dark`
# and `light`. Set this to `None` to use the default theme variant.
#gtk_theme_variant: None
#scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
#history: 10000
# Scrolling distance multiplier.
#multiplier: 3
# Font configuration
font:
# Normal (roman) font face
normal:
# Font family
#
# Default:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
family: DejaVuSansMono Nerd Font Mono
# The `style` can be specified to pick a specific face.
style: Regular
# Bold font face
bold:
# Font family
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
family: DejaVuSansMono Nerd Font Mono
# The `style` can be specified to pick a specific face.
style: Bold
# Italic font face
italic:
# Font family
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
family: DejaVuSansMono Nerd Font Mono
# The `style` can be specified to pick a specific face.
style: Oblique
# Bold italic font face
bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
family: DejaVuSansMono Nerd Font Mono
# The `style` can be specified to pick a specific face.
style: Bold Oblique
# Point size
size: 12.0
# Offset is the extra space around each character. `offset.y` can be thought
# of as modifying the line spacing, and `offset.x` as modifying the letter
# spacing.
#offset:
# x: 0
# y: 0
# Glyph offset determines the locations of the glyphs within their cells with
# the default being at the bottom. Increasing `x` moves the glyph to the
# right, increasing `y` moves the glyph upward.
#glyph_offset:
# x: 0
# y: 0
# Thin stroke font rendering (macOS only)
#
# Thin strokes are suitable for retina displays, but for non-retina screens
# it is recommended to set `use_thin_strokes` to `false`.
#use_thin_strokes: true
{{ base16_schemes['schemes'][base16_scheme]['alacritty']['colors']['base16-' + base16_scheme + '.yml'] }}
# Bell
#
# The bell is rung every time the BEL control character is received.
bell:
# Visual Bell Animation
#
# Animation effect for flashing the screen when the visual bell is rung.
#
# Values for `animation`:
# - Ease
# - EaseOut
# - EaseOutSine
# - EaseOutQuad
# - EaseOutCubic
# - EaseOutQuart
# - EaseOutQuint
# - EaseOutExpo
# - EaseOutCirc
# - Linear
animation: EaseOutExpo
# Duration of the visual bell flash in milliseconds. A `duration` of `0` will
# disable the visual bell animation.
duration: 100
# Visual bell animation color.
color: '#000000'
# Bell Command
#
# This program is executed whenever the bell is rung.
#
# When set to `command: None`, no command will be executed.
#
# Example:
# command:
# program: notify-send
# args: ["Hello, World!"]
#
command:
program: play
args: ['-n', 'synth', 'sine', 'C5', 'sine', 'E4', 'remix', '1-2', 'fade', '0.1', '0.2', '0.1']
# program: notify-send
# args: ["Hello, World!"]
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
#background_opacity: 1.0
#selection:
# This string contains all characters that are used as separators for
# "semantic words" in Alacritty.
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
# When set to `true`, selected text will be copied to the primary clipboard.
#save_to_clipboard: false
cursor:
# Cursor style
#
# Values for `style`:
# - ▇ Block
# - _ Underline
# - | Beam
#style: Block
# Cursor blinking state
#
# Values for `blinking`:
# - Never: Prevent the cursor from ever blinking
# - Off: Disable blinking by default
# - On: Enable blinking by default
# - Always: Force the cursor to always blink
#blinking: Off
# Vi mode cursor style
#
# If the vi mode cursor style is `None` or not specified, it will fall back to
# the style of the active value of the normal cursor.
#
# See `cursor.style` for available options.
vi_mode_style: Underline
# Cursor blinking interval in milliseconds.
#blink_interval: 750
# If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused.
#unfocused_hollow: true
# Thickness of the cursor relative to the cell width as floating point number
# from `0.0` to `1.0`.
#thickness: 0.15
# Live config reload (changes require restart)
#live_config_reload: true
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g.
# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the
# shell.
#
# Default:
# - (macOS) /bin/bash --login
# - (Linux/BSD) user login shell
# - (Windows) powershell
#shell:
# program: /bin/bash
# args:
# - --login
# Startup directory
#
# Directory the shell is started in. If this is unset, or `None`, the working
# directory of the parent process will be used.
#working_directory: None
# WinPTY backend (Windows only)
#
# Alacritty defaults to using the newer ConPTY backend if it is available,
# since it resolves a lot of bugs and is quite a bit faster. If it is not
# available, the WinPTY backend will be used instead.
#
# Setting this option to `true` makes Alacritty use the legacy WinPTY backend,
# even if the ConPTY backend is available.
#winpty_backend: false
# Send ESC (\x1b) before characters when alt is pressed.
#alt_send_esc: true
#mouse:
# Click settings
#
# The `double_click` and `triple_click` settings control the time
# alacritty should wait for accepting multiple clicks as one double
# or triple click.
#double_click: { threshold: 300 }
#triple_click: { threshold: 300 }
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
# Regex hints
#
# Terminal hints can be used to find text in the visible part of the terminal
# and pipe it to other applications.
hints:
# Keys used for the hint labels.
#alphabet: "jfkdls;ahgurieowpq"
# List with all available hints
#
# Each hint must have a `regex` and either an `action` or a `command` field.
# The fields `mouse`, `binding` and `post_processing` are optional.
#
# The fields `command`, `binding.key`, `binding.mods` and `mouse.mods` accept
# the same values as they do in the `key_bindings` section.
#
# The `mouse.enabled` field controls if the hint should be underlined while
# the mouse with all `mouse.mods` keys held or the vi mode cursor is above it.
#
# If the `post_processing` field is set to `true`, heuristics will be used to
# shorten the match if there are characters likely not to be part of the hint
# (e.g. a trailing `.`). This is most useful for URIs.
#
# Values for `action`:
# - Copy
# Copy the hint's text to the clipboard.
# - Paste
# Paste the hint's text to the terminal or search.
# - Select
# Select the hint's text.
# - MoveViModeCursor
# Move the vi mode cursor to the beginning of the hint.
enabled:
- regex: "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\
[^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"
command: xdg-open
post_processing: true
mouse:
enabled: true
mods: Control
binding:
key: F
mods: Control|Alt
# Mouse bindings
#
# Mouse bindings are specified as a list of objects, much like the key
# bindings further below.
#
# To trigger mouse bindings when an application running within Alacritty
# captures the mouse, the `Shift` modifier is automatically added as a
# requirement.
#
# Each mouse binding will specify a:
#
# - `mouse`:
#
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# - `action` (see key bindings)
#
# And optionally:
#
# - `mods` (see key bindings)
#mouse_bindings:
# - { mouse: Middle, action: PasteSelection }
# Key bindings
#
# Key bindings are specified as a list of objects. For example, this is the
# default paste binding:
#
# `- { key: V, mods: Control|Shift, action: Paste }`
#
# Each key binding will specify a:
#
# - `key`: Identifier of the key pressed
#
# - A-Z
# - F1-F24
# - Key0-Key9
#
# A full list with available key codes can be found here:
# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants
#
# Instead of using the name of the keys, the `key` field also supports using
# the scancode of the desired key. Scancodes have to be specified as a
# decimal number. This command will allow you to display the hex scancodes
# for certain keys:
#
# `showkey --scancodes`.
#
# Then exactly one of:
#
# - `chars`: Send a byte sequence to the running application
#
# The `chars` field writes the specified string to the terminal. This makes
# it possible to pass escape sequences. To find escape codes for bindings
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
# of tmux. Note that applications use terminfo to map escape sequences back
# to keys. It is therefore required to update the terminfo when changing an
# escape sequence.
#
# - `action`: Execute a predefined action
#
# - ToggleViMode
# - SearchForward
# Start searching toward the right of the search origin.
# - SearchBackward
# Start searching toward the left of the search origin.
# - Copy
# - Paste
# - IncreaseFontSize
# - DecreaseFontSize
# - ResetFontSize
# - ScrollPageUp
# - ScrollPageDown
# - ScrollHalfPageUp
# - ScrollHalfPageDown
# - ScrollLineUp
# - ScrollLineDown
# - ScrollToTop
# - ScrollToBottom
# - ClearHistory
# Remove the terminal's scrollback history.
# - Hide
# Hide the Alacritty window.
# - Minimize
# Minimize the Alacritty window.
# - Quit
# Quit Alacritty.
# - ToggleFullscreen
# - SpawnNewInstance
# Spawn a new instance of Alacritty.
# - ClearLogNotice
# Clear Alacritty's UI warning and error notice.
# - ClearSelection
# Remove the active selection.
# - ReceiveChar
# - None
#
# - Vi mode exclusive actions:
#
# - Open
# Perform the action of the first matching hint under the vi mode cursor
# with `mouse.enabled` set to `true`.
# - ToggleNormalSelection
# - ToggleLineSelection
# - ToggleBlockSelection
# - ToggleSemanticSelection
# Toggle semantic selection based on `selection.semantic_escape_chars`.
#
# - Vi mode exclusive cursor motion actions:
#
# - Up
# One line up.
# - Down
# One line down.
# - Left
# One character left.
# - Right
# One character right.
# - First
# First column, or beginning of the line when already at the first column.
# - Last
# Last column, or beginning of the line when already at the last column.
# - FirstOccupied
# First non-empty cell in this terminal row, or first non-empty cell of
# the line when already at the first cell of the row.
# - High
# Top of the screen.
# - Middle
# Center of the screen.
# - Low
# Bottom of the screen.
# - SemanticLeft
# Start of the previous semantically separated word.
# - SemanticRight
# Start of the next semantically separated word.
# - SemanticLeftEnd
# End of the previous semantically separated word.
# - SemanticRightEnd
# End of the next semantically separated word.
# - WordLeft
# Start of the previous whitespace separated word.
# - WordRight
# Start of the next whitespace separated word.
# - WordLeftEnd
# End of the previous whitespace separated word.
# - WordRightEnd
# End of the next whitespace separated word.
# - Bracket
# Character matching the bracket at the cursor's location.
# - SearchNext
# Beginning of the next match.
# - SearchPrevious
# Beginning of the previous match.
# - SearchStart
# Start of the match to the left of the vi mode cursor.
# - SearchEnd
# End of the match to the right of the vi mode cursor.
#
# - Search mode exclusive actions:
# - SearchFocusNext
# Move the focus to the next search match.
# - SearchFocusPrevious
# Move the focus to the previous search match.
# - SearchConfirm
# - SearchCancel
# - SearchClear
# Reset the search regex.
# - SearchDeleteWord
# Delete the last word in the search regex.
# - SearchHistoryPrevious
# Go to the previous regex in the search history.
# - SearchHistoryNext
# Go to the next regex in the search history.
#
# - macOS exclusive actions:
# - ToggleSimpleFullscreen
# Enter fullscreen without occupying another space.
#
# - Linux/BSD exclusive actions:
#
# - CopySelection
# Copy from the selection buffer.
# - PasteSelection
# Paste from the selection buffer.
#
# - `command`: Fork and execute a specified command plus arguments
#
# The `command` field must be a map containing a `program` string and an
# `args` array of command line parameter strings. For example:
# `{ program: "alacritty", args: ["-e", "vttest"] }`
#
# And optionally:
#
# - `mods`: Key modifiers to filter binding actions
#
# - Command
# - Control
# - Option
# - Super
# - Shift
# - Alt
#
# Multiple `mods` can be combined using `|` like this:
# `mods: Control|Shift`.
# Whitespace and capitalization are relevant and must match the example.
#
# - `mode`: Indicate a binding for only specific terminal reported modes
#
# This is mainly used to send applications the correct escape sequences
# when in different modes.
#
# - AppCursor
# - AppKeypad
# - Search
# - Alt
# - Vi
#
# A `~` operator can be used before a mode to apply the binding whenever
# the mode is *not* active, e.g. `~Alt`.
#
# Bindings are always filled by default, but will be replaced when a new
# binding with the same triggers is defined. To unset a default binding, it can
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
# a no-op if you do not wish to receive input characters for that binding.
#
# If the same trigger is assigned to multiple actions, all of them are executed
# in the order they were defined in.
key_bindings:
#- { key: Paste, action: Paste }
#- { key: Copy, action: Copy }
#- { key: L, mods: Control, action: ClearLogNotice }
#- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp, }
#- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown }
#- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop, }
#- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom }
# Vi Mode
#- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom }
- { key: Space, mods: Alt|Control, mode: ~Search, action: ToggleViMode }
#- { key: Escape, mode: Vi|~Search, action: ClearSelection }
#- { key: I, mode: Vi|~Search, action: ScrollToBottom }
#- { key: I, mode: Vi|~Search, action: ToggleViMode }
#- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode }
#- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp }
#- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown }
#- { key: G, mode: Vi|~Search, action: ScrollToTop }
#- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom }
#- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp }
#- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown }
- { key: K, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp }
- { key: J, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown }
#- { key: Y, mode: Vi|~Search, action: Copy }
#- { key: Y, mode: Vi|~Search, action: ClearSelection }
#- { key: Copy, mode: Vi|~Search, action: ClearSelection }
#- { key: V, mode: Vi|~Search, action: ToggleNormalSelection }
#- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection }
#- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection }
#- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection }
#- { key: Return, mode: Vi|~Search, action: Open }
#- { key: K, mode: Vi|~Search, action: Up }
#- { key: J, mode: Vi|~Search, action: Down }
#- { key: H, mode: Vi|~Search, action: Left }
#- { key: L, mode: Vi|~Search, action: Right }
#- { key: Up, mode: Vi|~Search, action: Up }
#- { key: Down, mode: Vi|~Search, action: Down }
#- { key: Left, mode: Vi|~Search, action: Left }
#- { key: Right, mode: Vi|~Search, action: Right }
#- { key: Key0, mode: Vi|~Search, action: First }
#- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last }
#- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied }
#- { key: H, mods: Shift, mode: Vi|~Search, action: High }
#- { key: M, mods: Shift, mode: Vi|~Search, action: Middle }
#- { key: L, mods: Shift, mode: Vi|~Search, action: Low }
#- { key: B, mode: Vi|~Search, action: SemanticLeft }
#- { key: W, mode: Vi|~Search, action: SemanticRight }
#- { key: E, mode: Vi|~Search, action: SemanticRightEnd }
#- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft }
#- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight }
#- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd }
#- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket }
#- { key: Slash, mode: Vi|~Search, action: SearchForward }
#- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward }
#- { key: N, mode: Vi|~Search, action: SearchNext }
#- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious }
# Search Mode
#- { key: Return, mode: Search|Vi, action: SearchConfirm }
#- { key: Escape, mode: Search, action: SearchCancel }
#- { key: C, mods: Control, mode: Search, action: SearchCancel }
#- { key: U, mods: Control, mode: Search, action: SearchClear }
#- { key: W, mods: Control, mode: Search, action: SearchDeleteWord }
#- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious }
#- { key: N, mods: Control, mode: Search, action: SearchHistoryNext }
#- { key: Up, mode: Search, action: SearchHistoryPrevious }
#- { key: Down, mode: Search, action: SearchHistoryNext }
#- { key: Return, mode: Search|~Vi, action: SearchFocusNext }
#- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious }
# (Windows, Linux, and BSD only)
- { key: V, mods: Control|Alt, mode: ~Vi, action: Paste }
- { key: C, mods: Control|Alt, action: Copy }
- { key: F, mods: Control|Alt, mode: ~Search, action: SearchForward }
- { key: B, mods: Control|Alt, mode: ~Search, action: SearchBackward }
- { key: C, mods: Control|Alt, mode: Vi|~Search, action: ClearSelection }
#- { key: Insert, mods: Shift, action: PasteSelection }
#- { key: Key0, mods: Control, action: ResetFontSize }
#- { key: Equals, mods: Control, action: IncreaseFontSize }
#- { key: Plus, mods: Control, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Control, action: IncreaseFontSize }
#- { key: Minus, mods: Control, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize }
# (Windows only)
#- { key: Return, mods: Alt, action: ToggleFullscreen }
# (macOS only)
#- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory }
#- { key: Key0, mods: Command, action: ResetFontSize }
#- { key: Equals, mods: Command, action: IncreaseFontSize }
#- { key: Plus, mods: Command, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Command, action: IncreaseFontSize }
#- { key: Minus, mods: Command, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize }
#- { key: V, mods: Command, action: Paste }
#- { key: C, mods: Command, action: Copy }
#- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection }
#- { key: H, mods: Command, action: Hide }
#- { key: H, mods: Command|Alt, action: HideOtherApplications }
#- { key: M, mods: Command, action: Minimize }
#- { key: Q, mods: Command, action: Quit }
#- { key: W, mods: Command, action: Quit }
#- { key: N, mods: Command, action: SpawnNewInstance }
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
#- { key: F, mods: Command, mode: ~Search, action: SearchForward }
#- { key: B, mods: Command, mode: ~Search, action: SearchBackward }
#debug:
# Display the time it takes to redraw each frame.
#render_timer: false
# Keep the log file after quitting Alacritty.
#persistent_logging: false
# Log level
#
# Values for `log_level`:
# - Off
# - Error
# - Warn
# - Info
# - Debug
# - Trace
#log_level: Warn
# Print all received window events.
#print_events: false

View file

@ -1,16 +0,0 @@
root_access: yes
display_server: "x11"
dev_stuffs:
- shell
- network
- ansible
- python
has_battery: yes
encrypt_home_stacked_fs: yes
extensions:
- g
- gh
x11_screens:
- DP-1
- eDP-1
max_video_height: 720

View file

@ -1,36 +0,0 @@
---
- name: Default
hosts: all
roles:
- role: facts
tags: facts
- role: access
tags: access
when: root_access
- role: software
tags: software
- role: system
tags: system
when: root_access
- role: ecryptfs_automount
tags: ecryptfs_automount
when: encrypt_home_stacked_fs
- role: dotfiles
tags: dotfiles
- role: vim
tags: vim
- role: gnupg
tags: gnupg
- role: mnussbaum.base16-builder-ansible # Required for desktop_environment
tags:
- color
- desktop_environment
- role: termux
tags: termux
when: termux
- role: desktop_environment
tags: desktop_environment
when: display_server
- role: extensions
tags: extensions
# TODO Dependencies

@ -1 +0,0 @@
Subproject commit 592c6d9841674211f904cf9ea2a951fca3fd5a80

@ -1 +0,0 @@
Subproject commit 435f8e6aea0ba9be482c4409db380868a23fea9c

View file

@ -1,23 +0,0 @@
---
- name: Set variables
ansible.builtin.set_fact:
manjaro: "{{ ansible_lsb.id == 'Manjaro' or ansible_lsb.id == 'Manjaro-ARM' }}"
- name: Enable passwordless sudo access to wheel group (Others)
ansible.builtin.lineinfile:
path: /etc/sudoers
line: "%wheel ALL=(ALL) NOPASSWD: ALL"
regexp: "^#? *%wheel ALL=\\(ALL\\) NOPASSWD: ALL$"
become: true
when: not manjaro
- name: Enable passwordless sudo access to wheel group (Manjaro)
ansible.builtin.copy:
content: "%wheel ALL=(ALL) NOPASSWD: ALL"
dest: /etc/sudoers.d/11-wheel-nopasswd
mode: u=rwx,g=rx,o=
when: manjaro
become: true
# /etc/sudoers.d/10-installer is the same thing,
# but **with** a password, and it's overwritten
# with each upgrade of manjaro-system, hence this.

View file

@ -1 +0,0 @@
base16_scheme: solarized-dark

View file

@ -1,16 +0,0 @@
---
- name: Xrdb-reload
ansible.builtin.command: xrdb -I{{ ansible_env.HOME }} {{ ansible_env.HOME }}/.config/Xresources/main
listen: xrdb-reload
- name: I3-reload
ansible.builtin.command: i3-msg reload
listen: i3-reload
- name: Shell-reload
ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApply"
listen: shell-reload
- name: Fzf-reload
ansible.builtin.shell: source {{ ansible_env.HOME }}/.local/bin/colorSchemeApplyFzf
listen: fzf-reload
- name: Qutebrowser-reload
ansible.builtin.shell: "! pgrep qutebrowser || qutebrowser :config-source"
listen: qutebrowser-reload

View file

@ -1,179 +0,0 @@
---
- name: Ensure directories for desktop applications are present
ansible.builtin.file:
state: directory
path: "{{ ansible_user_dir }}/{{ item }}"
mode: u=rwx,g=rx,o=rx
with_items:
- .config/Xresources
- .config/rofi
- .local/bin
- .local/share/fonts
- .config/qutebrowser
- .config/tridactyl/themes
# Download fonts
- name: Download Nerd fonts
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/ryanoasis/nerd-fonts/704336735f576781b2a57b12a0c723e3316cbdec/patched-fonts/DejaVuSansMono/{{ item.folder }}/complete/{{
item.filename | urlencode }}
dest: "{{ ansible_user_dir }}/.local/share/fonts/{{ item.filename }}"
mode: u=rw,g=r,o=r
loop:
- filename: DejaVu Sans Mono Bold Nerd Font Complete Mono.ttf
folder: Bold
- filename: DejaVu Sans Mono Bold Oblique Nerd Font Complete Mono.ttf
folder: Bold-Italic
- filename: DejaVu Sans Mono Nerd Font Complete Mono.ttf
folder: Regular
- filename: DejaVu Sans Mono Oblique Nerd Font Complete Mono.ttf
folder: Italic
- name: Download icon fonts
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/FortAwesome/Font-Awesome/a8386aae19e200ddb0f6845b5feeee5eb7013687/fonts/fontawesome-webfont.ttf
dest: "{{ ansible_user_dir }}/.local/share/fonts/fontawesome-webfont.ttf"
mode: u=rw,g=r,o=r
# TODO Either replace with ForkAwesome or Nerd Fonts
- name: Install python dependencies for lemonbar
ansible.builtin.pip:
requirements: "{{ ansible_user_dir }}/.dotfiles/config/lemonbar/requirements.txt"
extra_args: --break-system-packages # It's fine, it's local anyways
# Build a single color scheme and template and assign it to a variable
- base16_builder:
scheme: "{{ base16_scheme }}"
template: # This requires https://github.com/mnussbaum/base16-builder-ansible/pull/6
- i3
- xresources
- rofi
- alacritty
- shell
- fzf
- vim
- qutebrowser
- tridactyl
- dunst
register: base16_schemes
tags:
- color
- i3
- name: Configure Alacritty
ansible.builtin.template:
src: "{{ ansible_env.HOME }}/.config/alacritty/alacritty.yml.j2"
dest: "{{ ansible_env.HOME }}/.config/alacritty/alacritty.yml"
mode: u=rw,g=r,o=r
# Alacritty has live config reload, so no command to execute
# However, it doesn't work with yaml includes, hence the template
tags:
- color
- name: Set base16 theme for Xresources
ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['xresources']['xresources']['base16-' + base16_scheme + '-256.Xresources'] }}"
dest: "{{ ansible_env.HOME }}/.config/Xresources/theme"
mode: u=rw,g=r,o=r
notify:
- xrdb-reload
tags:
- color
when: display_server == 'x11'
- name: Download base16 theme for qutebrowser
ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['qutebrowser']['themes/minimal']['base16-' + base16_scheme + '.config.py'] }}"
dest: "{{ ansible_env.HOME }}/.config/qutebrowser/theme.py"
mode: u=rw,g=r,o=r
notify:
- qutebrowser-reload
tags:
- color
- name: Download base16 theme for Tridactyl
ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['tridactyl']['base16-' + base16_scheme + '.config.py'] }}"
# url: "https://raw.githubusercontent.com/bezmi/base16-tridactyl/master/base16-{{ base16_scheme }}.css"
dest: "{{ ansible_env.HOME }}/.config/tridactyl/themes/theme.css"
mode: u=rw,g=r,o=r
when: false # Not currently used
tags:
- color
- name: Configure i3
ansible.builtin.template:
src: "{{ ansible_env.HOME }}/.config/i3/config.j2"
dest: "{{ ansible_env.HOME }}/.config/i3/config"
mode: u=rw,g=r,o=r
notify:
- i3-reload
tags:
- color
- i3
when: display_server == 'x11'
- name: Set base16 theme for rofi
ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['rofi']['themes']['base16-' + base16_scheme + '.' + item] }}"
dest: "{{ ansible_env.HOME }}/.config/rofi/theme.{{ item }}"
mode: u=rw,g=r,o=r
tags:
- color
loop:
- config
- rasi
- name: Configure Dunst
ansible.builtin.template:
src: "{{ ansible_env.HOME }}/.config/dunst/dunstrc.j2"
dest: "{{ ansible_env.HOME }}/.config/dunst/dunstrc"
mode: u=rw,g=r,o=r
tags:
- color
when: display_server == 'x11'
- name: Download base16 theme for fzf
ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['fzf']['bash']['base16-' + base16_scheme + '.config'] }}"
dest: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApplyFzf"
mode: u=rw,g=r,o=r
notify:
- fzf-reload
tags:
- color
- name: Download base16 theme for shell
ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['shell']['script']['base16-' + base16_scheme + '.sh'] }}"
dest: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApply"
mode: u=rwx,g=rx,o=rx
notify:
- shell-reload
when: false # Not currently used
tags:
- color
- name: Set used base16 theme for vim
ansible.builtin.copy:
path: "{{ ansible_env.HOME }}/.config/vim/colorscheme.vim"
mode: u=rw,g=r,o=r
content: colorscheme base16-{{ base16_scheme }}
when: false # Not currently used
tags:
- color
- name: Enable user services
ansible.builtin.systemd:
name: "{{ item }}"
state: started
enabled: true
scope: user
loop:
- pulseaudio
- mpd
when: has_systemd
# TODO bar (might change bar in the future, so...)
# TODO highlight (there IS a template but the colors look different from vim and mostly the same from when there's no config)
# TODO https://github.com/makuto/auto-base16-theme ? :P

View file

@ -1,32 +0,0 @@
---
- name: Ensure directories for applications are present
ansible.builtin.file:
state: directory
path: "{{ ansible_user_dir }}/{{ item }}"
mode: u=rwx,g=rx,o=rx
with_items:
- .cache/zsh
- .cache/mpd
- .ssh
- .local/bin
- .ansible/collections/ansible_collections/geoffreyfrogeye
- name: Install dotfiles repository
ansible.builtin.git:
repo: "{% if has_forge_access %}git@git.frogeye.fr:{% else %}https://git.frogeye.fr/{% endif %}geoffrey/dotfiles.git"
dest: "{{ ansible_user_dir }}/.dotfiles"
update: true
notify: install dotfiles
tags: dotfiles_repo
# TODO Put actual dotfiles in a subdirectory of the repo, so we don't have to put everything in config
- name: Register as Ansible collection
ansible.builtin.file:
state: link
src: "{{ ansible_user_dir }}/.dotfiles/config/automatrop"
path: "{{ ansible_user_dir }}/.ansible/collections/ansible_collections/geoffreyfrogeye/automatrop"
- name: Install python dependencies for scripts
ansible.builtin.pip:
requirements: "{{ ansible_user_dir }}/.dotfiles/config/scripts/requirements.txt"
extra_args: --break-system-packages # It's fine, it's local anyways

View file

@ -1,17 +0,0 @@
# ecryptfs_automount
Configure pam to allow auto-mounting of encrypted home directories with eCryptfs.
## Usage
You still need to run the following for an user directory to be encrypted:
```bash
modprobe ecryptfs
ecryptfs-migrate-home -u username
```
## Source
https://wiki.archlinux.org/title/ECryptfs#Auto-mounting

View file

@ -1,35 +0,0 @@
---
- name: Setup pam_encryptfs auth
ansible.builtin.blockinfile:
path: /etc/pam.d/system-auth
block: |
auth [success=1 default=ignore] pam_succeed_if.so service = systemd-user quiet
auth required pam_ecryptfs.so unwrap
insertafter: ^(auth\s+required\s+pam_unix.so|auth\s+\[default=die\]\s+pam_faillock.so\s+authfail)$
marker: "# {mark} AUTOMATROP ECRYPTFS_AUTOMOUNT AUTH"
become: true
notify:
- etc changed
- name: Setup pam_encryptfs password
ansible.builtin.blockinfile:
path: /etc/pam.d/system-auth
block: |
password optional pam_ecryptfs.so unwrap
insertbefore: ^(password\s+required\s+pam_unix.so|-password\s+\[success=1\s+default=ignore\]\s+pam_systemd_home.so)$
marker: "# {mark} AUTOMATROP ECRYPTFS_AUTOMOUNT PASSWORD"
become: true
notify:
- etc changed
- name: Setup pam_encryptfs session
ansible.builtin.blockinfile:
path: /etc/pam.d/system-auth
block: |
session [success=1 default=ignore] pam_succeed_if.so service = systemd-user quiet
session optional pam_ecryptfs.so unwrap
insertafter: ^session\s+required\s+pam_unix.so$
marker: "# {mark} AUTOMATROP ECRYPTFS_AUTOMOUNT SESSION"
become: true
notify:
- etc changed

View file

@ -1,21 +0,0 @@
---
- name: Set facts
ansible.builtin.set_fact:
arch_based: "{{ ansible_distribution == 'Archlinux' }}"
arch: "{{ ansible_lsb.id == 'Arch' }}"
manjaro: "{{ ansible_lsb.id == 'Manjaro' or ansible_lsb.id == 'Manjaro-ARM' }}"
termux: "{{ ansible_distribution == 'OtherLinux' and ansible_python.executable == '/data/data/com.termux/files/usr/bin/python' }}"
debian: "{{ ansible_distribution == 'Debian' }}"
ubuntu: "{{ ansible_distribution == 'Ubuntu' }}"
junest: "{{ ansible_distribution == 'Archlinux' and ansible_is_chroot }}" # TODO Check if /etc/junest exists
tags:
- always
- name: Set composed facts
ansible.builtin.set_fact:
debian_based: "{{ debian or ubuntu }}"
can_chown: "{{ not junest }}"
has_systemd: "{{ not junest }}"
tags:
- always
# TODO Make this a real Ansible fact maybe?

View file

@ -1,52 +0,0 @@
---
- name: Create GnuPG directory
ansible.builtin.file:
path: "{{ gnupghome }}"
state: directory
mode: u=rwx
- name: Create GnuPG configuration files
ansible.builtin.file:
path: "{{ gnupghome }}/{{ item }}"
state: file
mode: u=rw,g=r,o=r
loop:
- gpg-agent.conf
- gpg.conf
- name: Configure GnuPG
ansible.builtin.lineinfile:
path: "{{ gnupghome }}/gpg.conf"
regex: ^#?\s*{{ item.key }}\s
line: "{{ item.key }}{% if item.value is defined %} {{ item.value }}{% endif %}"
loop:
# Remove fluff
- key: no-greeting
- key: no-emit-version
- key: no-comments
# Output format that I prefer
- key: keyid-format
value: "0xlong"
# Show fingerprints
- key: with-fingerprint
# Make sure to show if key is invalid
# (should be default on most platform,
# but just to be sure)
- key: list-options
value: show-uid-validity
- key: verify-options
value: show-uid-validity
# Stronger algorithm (https://wiki.archlinux.org/title/GnuPG#Different_algorithm)
- key: personal-digest-preferences
value: SHA512
- key: cert-digest-algo
value: SHA512
- key: default-preference-list
value: SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
- key: personal-cipher-preferences
value: TWOFISH CAMELLIA256 AES 3DES
- name: Install Geoffrey Frogeye's key
gpg_key:
fpr: 4FBA930D314A03215E2CDB0A8312C8CAC1BAC289
trust: 5

View file

@ -1,2 +0,0 @@
---
gnupghome: "{{ ansible_user_dir }}/.config/gnupg"

View file

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View file

@ -1,126 +0,0 @@
# Ansible AUR helper
Ansible module to use some Arch User Repository (AUR) helpers as well as makepkg.
The following helpers are supported and automatically selected, if present, in the order listed below:
- [yay](https://github.com/Jguer/yay)
- [paru](https://github.com/Morganamilo/paru)
- [pacaur](https://github.com/E5ten/pacaur)
- [trizen](https://github.com/trizen/trizen)
- [pikaur](https://github.com/actionless/pikaur)
- [aurman](https://github.com/polygamma/aurman) (discontinued)
*makepkg* will be used if no helper was found or if it is explicitly specified:
- [makepkg](https://wiki.archlinux.org/index.php/makepkg)
## Options
|Parameter |Choices/**Default** |Comments|
|--- |--- |---|
|name | |Name or list of names of the package(s) to install or upgrade.|
|state |**present**, latest |Desired state of the package, 'present' skips operations if the package is already installed.|
|upgrade |yes, **no** |Whether or not to upgrade whole system.|
|use |**auto**, yay, paru, pacaur, trizen, pikaur, aurman, makepkg |The tool to use, 'auto' uses the first known helper found and makepkg as a fallback.|
|extra_args |**null** |A list of additional arguments to pass directly to the tool. Cannot be used in 'auto' mode.|
|aur_only |yes, **no** |Limit helper operation to the AUR.|
|local_pkgbuild |Local directory with PKGBUILD, **null** |Only valid with makepkg or pikaur. Don't download the package from AUR. Build the package using a local PKGBUILD and the other build files.|
|skip_pgp_check |yes, **no** |Only valid with makepkg. Skip PGP signatures verification of source file, useful when installing packages without GnuPG properly configured.|
|ignore_arch |yes, **no** |Only valid with makepkg. Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field.|
### Note
* Either *name* or *upgrade* is required, both cannot be used together.
* In the *use*=*auto* mode, makepkg is used as a fallback if no known helper is found.
## Installing
### AUR package
The [ansible-aur-git](https://aur.archlinux.org/packages/ansible-aur-git) package is available in the AUR.
Note: The module is installed in `/usr/share/ansible/plugins/modules` which is one of the default module library paths.
### Manual installation
Just clone the *ansible-aur* repository into your user custom-module directory:
```
git clone https://github.com/kewlfft/ansible-aur.git ~/.ansible/plugins/modules/aur
```
### Ansible Galaxy
*ansible-aur* is available in Galaxy which is a hub for sharing Ansible content. To download it, use:
```
ansible-galaxy install kewlfft.aur
```
Note: If this module is installed from Ansible Galaxy, you will need to list it explicitly in your playbook:
```
# playbook.yml
- hosts: localhost
roles:
- kewlfft.aur
tasks:
- aur: name=package_name
```
or in your role:
```
# meta/main.yml
dependencies:
- kewlfft.aur
```
```
# tasks/main.yml
- aur: name=package_name
```
## Usage
### Notes
* The scope of this module is installation and update from the AUR; for package removal or for updates from the repositories, it is recommended to use the official *pacman* module.
* The *--needed* parameter of the helper is systematically used, it means if a package is up-to-date, it is not built and reinstalled.
### Create the "aur_builder" user
While Ansible expects to SSH as root, makepkg or AUR helpers do not allow executing operations as root, they fail with "you cannot perform this operation as root". It is therefore recommended to create a user, which is non-root but has no need for password with pacman in sudoers, let's call it *aur_builder*.
This user can be created in an Ansible task with the following actions:
```
- user:
name: aur_builder
create_home: no
group: wheel
- lineinfile:
path: /etc/sudoers.d/11-install-aur_builder
line: 'aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman'
create: yes
validate: 'visudo -cf %s'
```
### Examples
Use it in a task, as in the following examples:
```
# Install trizen using makepkg, skip if it is already installed
- aur: name=trizen use=makepkg state=present
become: yes
become_user: aur_builder
# Install package_name using the first known helper found
- aur: name=package_name
become: yes
become_user: aur_builder
# Install package_name_1 and package_name_2 using yay
- aur:
use: yay
name:
- package_name_1
- package_name_2
# Upgrade the system using yay, only act on AUR packages.
# Note: Dependency resolving will still include repository packages.
- aur: upgrade=yes use=yay aur_only=yes
# Install gnome-shell-extension-caffeine-git using pikaur and a local PKGBUILD.
# Skip if it is already installed
- aur:
name: gnome-shell-extension-caffeine-git
use: pikaur
local_pkgbuild: {{ role_path }}/files/gnome-shell-extension-caffeine-git
state: present
become: yes
become_user: aur_builder
```

View file

@ -1,397 +0,0 @@
#!/usr/bin/python
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url
import json
import shlex
import tarfile
import os
import os.path
import shutil
import tempfile
import urllib.parse
DOCUMENTATION = '''
---
module: aur
short_description: Manage packages from the AUR
description:
- Manage packages from the Arch User Repository (AUR)
author:
- Kewl <xrjy@nygb.rh.bet(rot13)>
options:
name:
description:
- Name or list of names of the package(s) to install or upgrade.
state:
description:
- Desired state of the package.
default: present
choices: [ present, latest ]
upgrade:
description:
- Whether or not to upgrade whole system.
default: no
type: bool
use:
description:
- The tool to use, 'auto' uses the first known helper found and makepkg as a fallback.
default: auto
choices: [ auto, yay, paru, pacaur, trizen, pikaur, aurman, makepkg ]
extra_args:
description:
- Arguments to pass to the tool.
Requires that the 'use' option be set to something other than 'auto'.
type: str
skip_pgp_check:
description:
- Only valid with makepkg.
Skip PGP signatures verification of source file.
This is useful when installing packages without GnuPG (properly) configured.
Cannot be used unless use is set to 'makepkg'.
type: bool
default: no
ignore_arch:
description:
- Only valid with makepkg.
Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field.
Cannot be used unless use is set to 'makepkg'.
type: bool
default: no
aur_only:
description:
- Limit helper operation to the AUR.
type: bool
default: no
local_pkgbuild:
description:
- Only valid with makepkg or pikaur.
Directory with PKGBUILD and build files.
Cannot be used unless use is set to 'makepkg' or 'pikaur'.
type: path
default: no
notes:
- When used with a `loop:` each package will be processed individually,
it is much more efficient to pass the list directly to the `name` option.
'''
RETURN = '''
msg:
description: action that has been taken
helper:
the helper that was actually used
'''
EXAMPLES = '''
- name: Install trizen using makepkg, skip if trizen is already installed
aur: name=trizen use=makepkg state=present
become: yes
become_user: aur_builder
'''
def_lang = ['env', 'LC_ALL=C']
use_cmd = {
'yay': ['yay', '-S', '--noconfirm', '--needed', '--cleanafter'],
'paru': ['paru', '-S', '--noconfirm', '--needed', '--cleanafter'],
'pacaur': ['pacaur', '-S', '--noconfirm', '--noedit', '--needed'],
'trizen': ['trizen', '-S', '--noconfirm', '--noedit', '--needed'],
'pikaur': ['pikaur', '-S', '--noconfirm', '--noedit', '--needed'],
'aurman': ['aurman', '-S', '--noconfirm', '--noedit', '--needed', '--skip_news', '--pgp_fetch', '--skip_new_locations'],
'makepkg': ['makepkg', '--syncdeps', '--install', '--noconfirm', '--needed']
}
use_cmd_local_pkgbuild = {
'pikaur': ['pikaur', '-P', '--noconfirm', '--noedit', '--needed', '--install'],
'makepkg': ['makepkg', '--syncdeps', '--install', '--noconfirm', '--needed']
}
has_aur_option = ['yay', 'paru', 'pacaur', 'trizen', 'pikaur', 'aurman']
def package_installed(module, package):
"""
Determine if the package is already installed
"""
rc, _, _ = module.run_command(['pacman', '-Q', package], check_rc=False)
return rc == 0
def check_packages(module, packages):
"""
Inform the user what would change if the module were run
"""
would_be_changed = []
diff = {
'before': '',
'after': '',
}
for package in packages:
installed = package_installed(module, package)
if not installed:
would_be_changed.append(package)
if module._diff:
diff['after'] += package + "\n"
if would_be_changed:
status = True
if len(packages) > 1:
message = '{} package(s) would be installed'.format(len(would_be_changed))
else:
message = 'package would be installed'
else:
status = False
if len(packages) > 1:
message = 'all packages are already installed'
else:
message = 'package is already installed'
module.exit_json(changed=status, msg=message, diff=diff)
def build_command_prefix(use, extra_args, skip_pgp_check=False, ignore_arch=False, aur_only=False, local_pkgbuild=None):
"""
Create the prefix of a command that can be used by the install and upgrade functions.
"""
if local_pkgbuild:
command = def_lang + use_cmd_local_pkgbuild[use]
else:
command = def_lang + use_cmd[use]
if skip_pgp_check:
command.append('--skippgpcheck')
if ignore_arch:
command.append('--ignorearch')
if aur_only and use in has_aur_option:
command.append('--aur')
if local_pkgbuild and use != 'makepkg':
command.append(local_pkgbuild)
if extra_args:
command += shlex.split(extra_args)
return command
def install_with_makepkg(module, package, extra_args, skip_pgp_check, ignore_arch, local_pkgbuild=None):
"""
Install the specified package or a local PKGBUILD with makepkg
"""
if not local_pkgbuild:
module.get_bin_path('fakeroot', required=True)
f = open_url('https://aur.archlinux.org/rpc/?v=5&type=info&arg={}'.format(urllib.parse.quote(package)))
result = json.loads(f.read().decode('utf8'))
if result['resultcount'] != 1:
return (1, '', 'package {} not found'.format(package))
result = result['results'][0]
f = open_url('https://aur.archlinux.org/{}'.format(result['URLPath']))
with tempfile.TemporaryDirectory() as tmpdir:
if local_pkgbuild:
shutil.copytree(local_pkgbuild, tmpdir, dirs_exist_ok=True)
command = build_command_prefix('makepkg', extra_args)
rc, out, err = module.run_command(command, cwd=tmpdir, check_rc=True)
else:
tar = tarfile.open(mode='r|*', fileobj=f)
tar.extractall(tmpdir)
tar.close()
command = build_command_prefix('makepkg', extra_args, skip_pgp_check=skip_pgp_check, ignore_arch=ignore_arch)
rc, out, err = module.run_command(command, cwd=os.path.join(tmpdir, result['Name']), check_rc=True)
return (rc, out, err)
def install_local_package(module, package, use, extra_args, local_pkgbuild):
"""
Install the specified package with a local PKGBUILD
"""
with tempfile.TemporaryDirectory() as tmpdir:
shutil.copytree(local_pkgbuild, tmpdir, dirs_exist_ok=True)
command = build_command_prefix(use, extra_args, local_pkgbuild=tmpdir + '/PKGBUILD')
rc, out, err = module.run_command(command, check_rc=True)
return (rc, out, err)
def check_upgrade(module, use):
"""
Inform user how many packages would be upgraded
"""
rc, stdout, stderr = module.run_command([use, '-Qu'], check_rc=True)
data = stdout.split('\n')
data.remove('')
module.exit_json(
changed=len(data) > 0,
msg="{} package(s) would be upgraded".format(len(data)),
helper=use,
)
def upgrade(module, use, extra_args, aur_only):
"""
Upgrade the whole system
"""
assert use in use_cmd
command = build_command_prefix(use, extra_args, aur_only=aur_only)
command.append('-u')
rc, out, err = module.run_command(command, check_rc=True)
module.exit_json(
changed=not (out == '' or 'nothing to do' in out or 'No AUR updates found' in out),
msg='upgraded system',
helper=use,
)
def install_packages(module, packages, use, extra_args, state, skip_pgp_check, ignore_arch, aur_only, local_pkgbuild):
"""
Install the specified packages
"""
if local_pkgbuild:
assert use in use_cmd_local_pkgbuild
else:
assert use in use_cmd
changed_iter = False
for package in packages:
if state == 'present':
if package_installed(module, package):
rc = 0
continue
if use == 'makepkg':
rc, out, err = install_with_makepkg(module, package, extra_args, skip_pgp_check, ignore_arch, local_pkgbuild)
elif local_pkgbuild:
rc, out, err = install_local_package(module, package, use, extra_args, local_pkgbuild)
else:
command = build_command_prefix(use, extra_args, aur_only=aur_only)
command.append(package)
rc, out, err = module.run_command(command, check_rc=True)
changed_iter = changed_iter or not (out == '' or '-- skipping' in out or 'nothing to do' in out)
message = 'installed package(s)' if changed_iter else 'package(s) already installed'
module.exit_json(
changed=changed_iter,
msg=message if not rc else err,
helper=use,
rc=rc,
)
def make_module():
module = AnsibleModule(
argument_spec={
'name': {
'type': 'list',
},
'state': {
'default': 'present',
'choices': ['present', 'latest'],
},
'upgrade': {
'type': 'bool',
},
'use': {
'default': 'auto',
'choices': ['auto'] + list(use_cmd.keys()),
},
'extra_args': {
'default': None,
'type': 'str',
},
'skip_pgp_check': {
'default': False,
'type': 'bool',
},
'ignore_arch': {
'default': False,
'type': 'bool',
},
'aur_only': {
'default': False,
'type': 'bool',
},
'local_pkgbuild': {
'default': None,
'type': 'path',
},
},
mutually_exclusive=[['name', 'upgrade']],
required_one_of=[['name', 'upgrade']],
supports_check_mode=True
)
params = module.params
use = params['use']
if params['name'] == []:
module.fail_json(msg="'name' cannot be empty.")
if use == 'auto':
if params['extra_args'] is not None:
module.fail_json(msg="'extra_args' cannot be used with 'auto', a tool must be specified.")
use = 'makepkg'
# auto: select the first helper for which the bin is found
for k in use_cmd:
if module.get_bin_path(k):
use = k
break
if use != 'makepkg' and (params['skip_pgp_check'] or params['ignore_arch']):
module.fail_json(msg="This option is only available with 'makepkg'.")
if not (use in use_cmd_local_pkgbuild) and params['local_pkgbuild']:
module.fail_json(msg="This option is not available with '%s'" % use)
if params['local_pkgbuild'] and not os.path.isdir(params['local_pkgbuild']):
module.fail_json(msg="Directory %s not found" % (params['local_pkgbuild']))
if params['local_pkgbuild'] and not os.access(params['local_pkgbuild'] + '/PKGBUILD', os.R_OK):
module.fail_json(msg="PKGBUILD inside %s not readable" % (params['local_pkgbuild']))
if params.get('upgrade', False) and use == 'makepkg':
module.fail_json(msg="The 'upgrade' action cannot be used with 'makepkg'.")
return module, use
def apply_module(module, use):
params = module.params
if params.get('upgrade', False):
if module.check_mode:
check_upgrade(module, use)
else:
upgrade(module, use, params['extra_args'], params['aur_only'])
else:
if module.check_mode:
check_packages(module, params['name'])
else:
install_packages(module,
params['name'],
use,
params['extra_args'],
params['state'],
params['skip_pgp_check'],
params['ignore_arch'],
params['aur_only'],
params['local_pkgbuild'])
def main():
module, use = make_module()
apply_module(module, use)
if __name__ == '__main__':
main()

View file

@ -1,2 +0,0 @@
install_date: Sun Feb 21 21:18:27 2021
version: master

View file

@ -1,17 +0,0 @@
galaxy_info:
author: kewlfft
role_name: aur
description: Ansible module to use some Arch User Repository (AUR) helpers as well as makepkg.
license: GPL-3.0-or-later
min_ansible_version: 2.0
# https://galaxy.ansible.com/api/v1/platforms/
platforms:
- name: ArchLinux
versions:
- any
galaxy_tags:
- aur
dependencies: []

@ -1 +0,0 @@
Subproject commit a977bb298fb9e1c057e0b2587dbd4d047e13f5bd

View file

@ -1,24 +0,0 @@
---
- name: Create and install meta package for Arch Linux
when: arch_based
block:
- name: Generate meta package PKGBUILD
ansible.builtin.template:
src: PKGBUILD.j2
dest: "{{ ansible_user_dir }}/.cache/automatrop/PKGBUILD"
listen: software changed
- name: Install meta package
aur:
name: automatrop-packages-{{ inventory_hostname_short }}
local_pkgbuild: "{{ ansible_user_dir }}/.cache/automatrop"
use: makepkg
state: latest
listen: software changed
when: root_access
- name: Update pacman cache
community.general.pacman:
update_cache: true
become: true
when: arch_based

View file

@ -1,224 +0,0 @@
---
# TODO Install python if not done
# Or maybe not, it requires a lot of automation for something that can be done
# very quickly manually and is usually already installed
- name: Install python-apt dependency for Termux
when: termux
vars:
version: 2.39
block:
# TODO Check if the correct version
- name: Check for DistUtilsExtra (Termux)
ansible.builtin.command: python -c 'import DistUtilsExtra'
changed_when: false
rescue:
- name: Create temporarty folder for DistUtilsExtra (Termux)
ansible.builtin.tempfile:
state: directory
suffix: python-distutils-extra
# path: /data/data/com.termux/files/usr/tmp/
register: pde_tempdir
- name: Download DistUtilsExtra (Termux)
ansible.builtin.get_url:
url: https://launchpad.net/python-distutils-extra/trunk/{{ version }}/+download/python-distutils-extra-{{ version }}.tar.gz
dest: "{{ pde_tempdir.path }}/python-distutils-extra.tar.gz"
- name: Extract DistUtilsExtra (Termux)
ansible.builtin.unarchive:
src: "{{ pde_tempdir.path }}/python-distutils-extra.tar.gz"
remote_src: true
dest: "{{ pde_tempdir.path }}"
- name: Install DistUtilsExtra (Termux)
ansible.builtin.command:
cmd: python3 setup.py install
chdir: "{{ pde_tempdir.path }}/python-distutils-extra-{{ version }}"
- name: Install python-apt (Termux)
ansible.builtin.pip:
name: python-apt
when: termux
# Collecting python-apt
# Using cached python-apt-0.7.8.tar.bz2 (49 kB)
# ERROR: Command errored out with exit status 1:
# command: /data/data/com.termux/files/usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-install-dsga__i7/python-apt/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-install-dsga__i7/python-apt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-ptpprl0m
# cwd: /data/data/com.termux/files/usr/tmp/pip-install-dsga__i7/python-apt/
# Complete output (5 lines):
# Traceback (most recent call last):
# File "<string>", line 1, in <module>
# File "/data/data/com.termux/files/usr/tmp/pip-install-dsga__i7/python-apt/setup.py", line 11, in <module>
# string.split(parse_makefile("python/makefile")["APT_PKG_SRC"]))
# AttributeError: module 'string' has no attribute 'split'
# ----------------------------------------
# ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
# WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
# You should consider upgrading via the '/data/data/com.termux/files/usr/bin/python3 -m pip install --upgrade pip' command.
# Arch configuration
# TODO Patch sudo-fake so it allows using -u so `become` works
- name: Enable multilib repo
ansible.builtin.lineinfile:
path: /etc/pacman.conf
regexp: ^#?\s*\[multilib\]$
line: "[multilib]"
become: true
when: arch_based and ansible_architecture == "x86_64"
notify: udpate pacman cache
- name: Configure multilib repo
ansible.builtin.lineinfile:
path: /etc/pacman.conf
regexp: ^#?\s*Include\s*=\s*/etc/pacman.d/mirrorlist
line: Include = /etc/pacman.d/mirrorlist
insertafter: ^\[multilib\]$
become: true
when: arch_based and ansible_architecture == "x86_64"
notify: udpate pacman cache
- name: Update cache if needed
ansible.builtin.meta: flush_handlers
- name: Install ccache
community.general.pacman:
name: ccache
state: present
extra_args: --asdeps
become: true
when: arch_based
- name: Enable makepkg color
ansible.builtin.replace:
path: /etc/makepkg.conf
regexp: ^BUILDENV=(.+)!color(.+)$
replace: BUILDENV=\1color\2
become: true
when: arch_based
- name: Enable makepkg ccache
ansible.builtin.replace:
path: /etc/makepkg.conf
regexp: ^BUILDENV=(.+)!ccache(.+)$
replace: BUILDENV=\1ccache\2
become: true
when: arch_based
- name: Remove -mtune from makepkg CFLAGS
ansible.builtin.replace:
path: /etc/makepkg.conf
regexp: ^#? *CFLAGS=(.+)-mtune=\S+\s(.*)$
replace: CFLAGS=\1\2
become: true
when: arch_based
- name: Change -march to native from makepkg CFLAGS
ansible.builtin.replace:
path: /etc/makepkg.conf
regexp: ^#? *CFLAGS=(.+)-march=\S+(\s)(.*)$
replace: CFLAGS=\1-march=native\2\3
become: true
when: arch_based
- name: Set makepkg MAKEFLAGS
ansible.builtin.replace:
path: /etc/makepkg.conf
regexp: ^#? *MAKEFLAGS=(.+)-j[0-9]+(.+)$
replace: MAKEFLAGS=\1-j{{ j }}\2
become: true
vars:
j: "{{ [ansible_processor_nproc - 1, 1] | max | int }}"
when: arch_based
- name: Enable pacman ParallelDownloads
ansible.builtin.lineinfile:
path: /etc/pacman.conf
regexp: ^#?ParallelDownloads
line: ParallelDownloads = 5
insertafter: ^\[options\]$
become: true
when: arch_based
- name: Enable pacman colors
ansible.builtin.lineinfile:
path: /etc/pacman.conf
regexp: ^#?Color
line: Color
insertafter: ^\[options\]$
become: true
when: arch_based
- name: Enable pacman pac-man
ansible.builtin.lineinfile:
path: /etc/pacman.conf
regexp: ^#?ILoveCandy
line: ILoveCandy
insertafter: ^#?Color
become: true
when: arch_based
# Install alternative package managers
- name: Install dependencies for AUR helpers
community.general.pacman:
name:
- base-devel
- fakeroot
become: true
when: arch_based
# Do not install sudo because maybe sudo-fake is installed (otherwise it conflicts)
# It should already be installed already anyway
- name: Install AUR package manager (Arch)
aur:
name: yay-bin
when: arch
- name: Install AUR package manager (Manjaro)
community.general.pacman:
name: yay
become: true
when: manjaro
# Not sure if regular Manjaro has yay in its community packages,
# but Manjaro-ARM sure does
- name: Create cache folder
ansible.builtin.file:
state: directory
mode: u=rwx,g=rx,o=rx
path: "{{ ansible_user_dir }}/.cache/automatrop"
- name: Generate list of packages for package manager
ansible.builtin.set_fact:
packages: "{{ query('template', 'package_manager.j2')[0].split('\n')[:-1]|sort|unique }}"
tags: softwarelist
- name: Install packages (Arch-based)
aur:
name: "{{ packages }}"
extra_args: --asdeps --needed
# Nothing is set as installed manually so it can
# be removed by dependency check.
# Current packages will be kept by the meta package
use: yay
notify: software changed
tags: softwarelist
when: arch_based
- name: Check if list of packages changed
ansible.builtin.copy:
content: "{% for package in packages %}{{ package }}\n{% endfor %}"
dest: "{{ ansible_user_dir }}/.cache/automatrop/package_manager"
notify: software changed
tags: softwarelist
# translate-shell
# $ curl -L git.io/trans > ~/.local/bin/trans
# $ chmod +x ~/.local/bin/trans
# sct
# $ TMP=$(mktemp /tmp/XXXXXXXXXX.c)
# $ wget https://gist.githubusercontent.com/ajnirp/208c03d3aa7f02c743d2/raw/55bf3eed25739173d8be57b5179ed5542cf40ed6/sct.c -O $TMP
# $ cc $TMP --std=c99 -lX11 -lXrandr -o $HOME/.local/bin/sct
# $ rm $TMP

View file

@ -1,14 +0,0 @@
# Maintainer: Geoffrey Frogeye
pkgname=automatrop-packages-{{ inventory_hostname_short }}
pkgver={{ ansible_date_time.iso8601_basic_short }}
pkgrel=1
pkgdesc='Metapackage for packages wanted by Geoffrey via automatrop for {{ inventory_hostname }}'
url='https://git.frogeye.fr/geoffrey/dotfiles/src/branch/master/config/automatrop'
arch=('any')
license=('GPL')
depends=(
{% for package in packages %}
'{{ package }}'
{% endfor %}
)

View file

@ -1,51 +0,0 @@
{# Macros #}
{% if debian_based %}
{% set python_prefix = 'python3' %}
{% set lib_suffix = '-common' %}
{% else %}
{% set python_prefix = 'python' %}
{% set lib_suffix = '' %}
{% endif %}
{# Include essential snippets #}
{% include 'snippets/pm_dotfiles_dependencies.j2' %}
{% include 'snippets/pm_shell.j2' %}
{% include 'snippets/pm_terminal_essentials.j2' %}
{% include 'snippets/pm_remote.j2' %}
{% include 'snippets/pm_disk_cleanup.j2' %}
{% include 'snippets/pm_local_monitoring.j2' %}
{% include 'snippets/pm_mpd.j2' %}
{% include 'snippets/pm_multimedia_toolbox.j2' %}
{% include 'snippets/pm_multimedia_common.j2' %}
{% include 'snippets/pm_data_management.j2' %}
{# Include rules-determined snippets #}
{% if root_access %}
{% include 'snippets/pm_system.j2' %}
{% endif %}
{% if display_server %}
{% include 'snippets/pm_desktop_environment.j2' %}
{% endif %}
{% if termux %}
{% include 'snippets/pm_termux.j2' %}
{% else %}
{% include 'snippets/pm_noandroid.j2' %}
{% endif %}
{% if software_full %}
{% include 'snippets/pm_android_tools.j2' %}
{% include 'snippets/pm_multimedia_editors.j2' %}
{% include 'snippets/pm_download.j2' %}
{% include 'snippets/pm_wine.j2' %}
{% include 'snippets/pm_document.j2' %}
{% endif %}
{# Inclde dev snippets #}
{% if dev_stuffs %}
{% include 'snippets/pm_dev_common.j2' %}
{% for dev_stuff in dev_stuffs %}
{% include 'snippets/pm_dev_' + dev_stuff + '.j2' %}
{% endfor %}
{% endif %}
{# Include custom snippets #}
{% for software_snippet in software_snippets %}
{% if software_snippet.startswith('pm_') %}
{% include 'snippets/' + software_snippet + '.j2' %}
{% endif %}
{% endfor %}

View file

@ -1,11 +0,0 @@
{#
Stuff for accessing Android phones
#}
{% if not termux %}
{% if arch_based %}
android-tools
android-udev
{% elif debian_based %}
adb
{% endif %}
{% endif %}

View file

@ -1,12 +0,0 @@
{#
Stuff to synchronize/backup data
#}
rsync
borg
syncthing
{% if arch_based %}
{% if ansible_architecture == 'x86_64' and can_chown %}
freefilesync-bin
{# Not worth the compilation if you can't have the binaries #}
{% endif %}
{% endif %}

View file

@ -1,71 +0,0 @@
{# Essential #}
firefox
qutebrowser
{# Sound #}
pulseaudio
pacmixer
{% if arch_based %}
ttf-dejavu
ttf-twemoji
{% endif %}
{% if arch_based %}
xkb-qwerty-fr
{% endif %}
thunar
gedit
feh
zathura
zbar
{% if arch_based %}
zathura-pdf-mupdf
{% elif debian_based %}
zathura-pdf-poppler
{% endif %}
meld
{{ python_prefix }}-magic
{% if arch_based %}
yubikey-touch-detector
{% endif %}
{% if display_server == "x11" %}
i3-wm
libgnomekbd{{ lib_suffix }}
dunst
i3lock
numlockx
rofi
{% if arch_based %}
rofimoji
{% endif %}
rxvt-unicode
{% if arch_based %}
urxvt-resize-font-git
alacritty
{% endif %}
scrot
simplescreenrecorder
trayer
unclutter
{% if arch_based %}
xautolock
{% endif %}
xclip
{% if arch_based %}
lemonbar-xft-git
wireless_tools
{% else %}
lemonbar
{% endif %}
{# lemonbar dependency #}
notmuch
autorandr
keynav
sct
xorg-xinit
{% if arch_based %}
xorg-xbacklight
{% elif debian_based %}
xbacklight
{% endif %}
{% elif display_server == "wayland" %}
sway
{% endif %}

View file

@ -1,4 +0,0 @@
ansible
ansible-lint
ansible-language-server
{# EOF #}

View file

@ -1,10 +0,0 @@
{% if termux %}
{# Otherwise installed by base-devel or equivalent #}
make
gcc
{% endif %}
cmake
clang
ccache
gdb
{# EOF #}

View file

@ -1,18 +0,0 @@
perf
git
jq
{% if arch_based %}
ctags
{% elif debian_based %}
universal-ctags
{% endif %}
{% if not termux %}
highlight
{% endif %}
{# For nvim's :Telescope live_grep #}
ripgrep
{# Offline documentation #}
{# Relies on qt5-webkit which is a pain to compile
zeal
#}
{# EOF #}

View file

@ -1,3 +0,0 @@
docker
docker-compose
{# EOF #}

View file

@ -1,6 +0,0 @@
yosys
iverilog
ghdl
{% if display_server %}
gtkwave
{% endif %}

View file

@ -1,14 +0,0 @@
wget
curl
socat
{% if arch_based %}
bind
{% else %}
dnsutils
{% endif %}
whois
nmap
tcpdump
{% if display_server %}
wireshark-qt
{% endif %}

View file

@ -1,5 +0,0 @@
{% if arch_based %}
{# TODO Disabled because it currently doesn't build
perl-perl-languageserver
#}
{% endif %}

View file

@ -1,12 +0,0 @@
mypy
{% if not arch_based %}
black
{# On arch it's installed as a dependency, also it's called python-black #}
{% endif %}
{% if arch_based %}
python-lsp-server
python-mypy-ls
python-lsp-black
{% endif %}
ipython
{# EOF #}

View file

@ -1,2 +0,0 @@
bash-language-server
{# EOF #}

View file

@ -1 +0,0 @@
sql-language-server

View file

@ -1,13 +0,0 @@
{#
Program that essentially help you reduce disk usage
#}
jdupes
duperemove
optipng
{% if debian_based %}
libjpeg-turbo-progs
{% else %}
libjpeg-turbo
{% endif %}
reflac
{# EOF #}

View file

@ -1,27 +0,0 @@
{# Document utilities #}
pandoc
{% if arch_based %}
texlive-bibtexextra
texlive-core
texlive-fontsextra
texlive-formatsextra
texlive-latexextra
texlive-pictures
texlive-pstricks
texlive-science
{% elif debian_based %}
texlive-base
texlive-lang-european
{% endif %}
pdftk
{% if display_server %}
{# Spell checking #}
hunspell-en_gb
hunspell-en_us
hunspell-fr
hunspell-nl
{# libreoffice-extension-grammalecte-fr #}
{% if arch_based %}
libreoffice-extension-languagetool
{% endif %}
{% endif %}

View file

@ -1,23 +0,0 @@
{#
Stuff that is required for scripts/programs of dotfiles to work properly
#}
coreutils
bash
grep
sed
tar
openssl
git
wget
curl
{% if not termux %}
{{ python_prefix }}-pip
{# Termux already has pip via Python #}
{% endif %}
ansible
{# Uncompressors #}
unzip
unrar
p7zip
{{ python_prefix }}-pystache
{# EOF #}

View file

@ -1,12 +0,0 @@
{#
Programs used to download sutff off the internet
#}
wget
curl
rsync
yt-dlp
megatools
transmission-cli
{% if display_server %}
transmission-qt
{% endif %}

View file

@ -1,24 +0,0 @@
{#
Shell utilities to see what's going on on the system
#}
htop
{% if root_access %}
iotop
iftop
{% endif %}
ncdu
{% if not termux %}
lsof
{% endif %}
strace
pv
progress
{% if not termux %}
speedtest-cli
{% endif %}
{% if arch_based %}
pacman-contrib
{% endif %}
{% if has_battery %}
powertop
{% endif %}

View file

@ -1,9 +0,0 @@
{#
To play music with Music Player Daemon
#}
mpd
mpc
{% if arch_based %}
ashuffle-git
vimpc-git
{% endif %}

View file

@ -1,13 +0,0 @@
{% if display_server %}
gimp
inkscape
mpv
{% if arch_based %}
mpv-thumbnail-script
{% endif %}
{% if arch_based %}
libreoffice-fresh
{% elif debian_based %}
libreoffice
{% endif %}
{% endif %}

View file

@ -1,12 +0,0 @@
{#
Big behemoth applications
#}
{% if display_server %}
gimp
inkscape
darktable
blender
puddletag
musescore
audacity
{% endif %}

View file

@ -1,4 +0,0 @@
ffmpeg
sox
imagemagick
{# EOF #}

View file

@ -1,30 +0,0 @@
{#
Stuff that isn't required on Android because there are apps for that
#}
{# Password handling #}
pass
pwgen
{% if display_server %}
rofi-pass
{# TODO Try autopass.cr #}
{% endif %}
{# Mail #}
isync
msmtp
notmuch
neomutt
lynx
{% if not arch_based %}
{# https://aur.archlinux.org/packages/tiv/#comment-812593 #}
tiv
{% endif %}
{% if display_server %}
thunderbird
{% endif %}
{# Organisation #}
vdirsyncer
khard
khal
todoman
syncthing
{# EOF #}

View file

@ -1,6 +0,0 @@
openssh
wget
rsync
{% if display_server %}
tigervnc
{% endif %}

View file

@ -1,21 +0,0 @@
{#
Shell related stuff
#}
{# ZSH #}
zsh
antigen
{% if arch_based %}
{# Antigen takex care of the above for others platforms #}
zsh-autosuggestions
zsh-completions
zsh-history-substring-search
zsh-syntax-highlighting
{% endif %}
tmux
bash-completion
fzf
{% if arch_based and ansible_architecture == 'x86_64' %}
powerline-go-bin
{% else %}
powerline-go
{% endif %}

View file

@ -1,16 +0,0 @@
etckeeper
{% if has_battery %}
tlp
{% endif %}
dhcpcd
wpa_supplicant
chrony
{% if encrypt_home_stacked_fs %}
ecryptfs-utils
{% endif %}
kexec-tools
openvpn
{% if arch_based %}
openvpn-update-resolv-conf-git
{# TODO Other distributions #}
{% endif %}

View file

@ -1,24 +0,0 @@
moreutils
man
visidata
{% if can_chown or not arch_based %}
insect
{% endif %}
translate-shell
gnupg
{# Editor #}
{% if termux %}
nvim
{% else %}
neovim
{% endif %}
{% if not termux %}
{{ python_prefix }}-neovim
{% endif %}
{# Downloaders #}
wget
{# Uncompressors #}
unzip
unrar
p7zip
{# EOF #}

View file

@ -1,9 +0,0 @@
{#
Stuff that only makes sense on Termux
#}
{% if termux %}
{% if root_access %}
tsu
{% endif %}
termux-api
{% endif %}

View file

@ -1,11 +0,0 @@
{% if ansible_architecture == 'x86_64' %}
wine
{% if arch_based %}
wine-gecko
wine-mono
mono
lib32-libpulse
{% elif debian_based %}
mono-runtime
{% endif %}
{% endif %}

View file

@ -1,7 +0,0 @@
server 0.europe.pool.ntp.org offline
server 1.europe.pool.ntp.org offline
server 2.europe.pool.ntp.org offline
server 3.europe.pool.ntp.org offline
driftfile /etc/chrony.drift
rtconutc
rtcsync

View file

@ -1,5 +0,0 @@
if $if_up; then
chronyc online
elif $if_down; then
chronyc offline
fi

View file

@ -1,11 +0,0 @@
[Service]
ExecStart=
ExecStart=/usr/bin/openvpn --suppress-timestamps --nobind --config %i.conf --script-security 2 --up /etc/openvpn/update-resolv-conf --down /etc/openvpn/update-resolv-conf
# The part before --script-security 2 might need upgrading from
# /usr/lib/systemd/system/openvpn-client@.service if it was upgraded
Restart=on-failure
User=
AmbiantCapabilities=
# It's not pretty, but other script only work with systemd or call resolvconf with -p,
# which doesn't work without a local DNS resolver
# TODO Local DNS resolver sounds nice anyway

View file

@ -1,10 +0,0 @@
***************
*** 6,11 ****
--- 6,12 ----
{
include "us(basic)"
include "level3(ralt_switch)"
+ include "keypad(oss)"
name[Group1]= "US keyboard with french symbols - AltGr combination";

View file

@ -1,3 +0,0 @@
[Service]
ExecStart=
ExecStart=/usr/bin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -i%I

View file

@ -1,7 +0,0 @@
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "us_qwerty-fr"
#Option "XkbModel" "pc105+inet"
Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

View file

@ -1,6 +0,0 @@
Section "InputClass"
Identifier "touchpad"
Driver "libinput"
MatchIsTouchpad "on"
Option "Tapping" "on"
EndSection

View file

@ -1,47 +0,0 @@
---
- name: Create a etckeeper commit
ansible.builtin.command: etckeeper commit 'automatrop {{ ansible_date_time.iso8601 }}'
listen: etc changed
become: true
register: etckeeper_commit
failed_when: etckeeper_commit.rc != 0 and 'nothing to commit' not in etckeeper_commit.stdout
changed_when: "'nothing to commit' not in etckeeper_commit.stdout"
- name: Restart chrony
ansible.builtin.systemd:
name: chronyd
state: restarted
listen: chrony reconfigured
become: true
- name: Reload systemd daemon
ansible.builtin.systemd:
daemon_reload: true
listen: systemd changed
become: true
- name: Restart wpa_supplicant
ansible.builtin.systemd:
name: wpa_supplicant@{{ item }}
state: restarted
become: true
loop: "{{ ansible_interfaces }}"
when: item.startswith('wl')
listen: wpa_supplicant changed
# Could probably use something better like
# listing /sys/class/ieee80211/*/device/net/
- name: Warn about changed Wi-Fi setup
ansible.builtin.debug:
msg: The Wi-Fi configuration was changed, but not applied to let this playbook finish. A reboot is required.
listen: wifi setup changed
- name: Warn about changed Panfrost config
ansible.builtin.debug:
msg: The Panfrost display driver configuration was changed, but needs a reboot to be applied.
listen: panfrost config changed
- name: Reload systemd-logind
ansible.builtin.command: systemctl kill -s HUP systemd-logind
become: true
listen: systemd-logind config changed

View file

@ -1,378 +0,0 @@
---
# TODO For other distributions
# Package are installed with --asdeps because they are needed
# Etckeeper
- name: Check if etckeeper is initialized
ansible.builtin.stat:
path: /etc/.git
register: etckeeper
become: true
- name: Initialize etckeeper
ansible.builtin.command: etckeeper init
become: true
when: not etckeeper.stat.exists
changed_when: true
- name: Configure git user.name for etckeeper
community.general.git_config:
scope: local
repo: /etc
name: "{{ item.name }}"
value: "{{ item.value }}"
loop:
- name: user.name
value: etckeeper on {{ inventory_hostname_short }}
- name: user.email
value: etckeeper@{{ inventory_hostname }}
become: true
# Manjaro configuration
- name: Remove Manjaro's pamac
community.general.pacman:
name: pamac
state: absent
become: true
when: arch_based and False # I'm trying to remember why I usually delete this thing
# Verbose logging during boot
- name: Check if using Uboot
ansible.builtin.stat:
path: /boot/extlinux/extlinux.conf
register: extlinux
# This (and the following) was made with the Pinebook in mind,
# not sure about compatibility
- name: Remove non-tty1 console (Uboot)
ansible.builtin.replace:
path: /boot/extlinux/extlinux.conf
regexp: ^APPEND(.*) console=(?!tty1)\S+(.*)$
replace: APPEND\1\2
become: true
when: extlinux.stat.exists
# Only one console= will be removed because regular expression are either hard
# or somewhat limited. It's just what I need anyway
- name: Remove bootsplash.bootfile (Uboot)
ansible.builtin.replace:
path: /boot/extlinux/extlinux.conf
regexp: ^APPEND(.*) bootsplash.bootfile=\S+(.*)$
replace: APPEND\1\2
become: true
when: extlinux.stat.exists
- name: Remove bootsplash packages (Arch based)
community.general.pacman:
name:
- bootsplash-systemd
- bootsplash-theme-manjaro
state: absent
become: true
when: arch_based
# Display Manager
- name: Remove display manager packages (Arch based)
community.general.pacman:
name:
- sddm
- sddm-breath2-theme
state: absent
become: true
when: arch_based
# Xorg configuration
- name: Check if there is nvidia-xrun is installed
ansible.builtin.stat:
path: /etc/X11/nvidia-xorg.conf
register: nvidia_xrun
when: display_server == 'x11'
- name: Add nvidia-xrun xorg config directory
ansible.builtin.set_fact:
xorg_common_config_dirs: "{{ xorg_default_config_dirs + xorg_nvidia_config_dirs }}"
vars:
xorg_default_config_dirs:
- /etc/X11/xorg.conf.d
xorg_nvidia_config_dirs: "{{ ['/etc/X11/nvidia-xorg.conf.d'] if nvidia_xrun.stat.exists else [] }}"
when: display_server == 'x11'
- name: Configure Xorg keyboard layout
ansible.builtin.copy:
src: xorg/keyboard.conf
dest: "{{ item }}/00-keyboard.conf"
become: true
when: display_server == 'x11'
notify: etc changed
loop: "{{ xorg_common_config_dirs }}"
- name: Use Alt keys for numpad
ansible.posix.patch:
src: us_qwert_alt_numpad.patch
dest: /usr/share/X11/xkb/symbols/us_qwerty-fr
become: true
when: display_server == 'x11'
# This is not very nice but it's updated so infrequently that it's not worth
# the trouble
- name: Check if there is Intel backlight
ansible.builtin.stat:
path: /sys/class/backlight/intel_backlight
register: intel_backlight
when: display_server == 'x11'
- name: Install Intel video drivers (Arch based)
community.general.pacman:
name: xf86-video-intel
# state: "{{ intel_backlight.stat.exists }}"
state: present
become: true
when: display_server == 'x11' and intel_backlight.stat.exists and arch_based
# TODO With software role? Would permit other distributions
- name: Configure Xorg Intel backlight
ansible.builtin.copy:
src: xorg/intel_backlight.conf
dest: "{{ item }}/20-intel_backlight.conf"
become: true
when: display_server == 'x11' and intel_backlight.stat.exists
notify: etc changed
loop: "{{ xorg_common_config_dirs }}"
- name: Configure Xorg touchpad behaviour
ansible.builtin.copy:
src: xorg/touchpad.conf
dest: "{{ item }}/30-touchpad.conf"
become: true
when: display_server == 'x11'
notify: etc changed
loop: "{{ xorg_common_config_dirs }}"
- name: Configure Xorg joystick behaviour
ansible.builtin.copy:
src: xorg/joystick.conf
dest: "{{ item }}/50-joystick.conf"
become: true
when: display_server == 'x11'
notify: etc changed
loop: "{{ xorg_common_config_dirs }}"
- name: List modules we're using
ansible.builtin.slurp:
src: /proc/modules
register: modules
when: display_server
# Not sure the module will be loaded in early setup stages though
- name: Make panfrost use OpenGL 3.3
ansible.builtin.lineinfile:
path: /etc/environment
line: PAN_MESA_DEBUG="gl3"
regexp: ^#? ?PAN_MESA_DEBUG=
become: true
when: display_server and using_panfrost
vars:
using_panfrost: "{{ 'panfrost' in (modules.content | b64decode) }}"
notify: panfrost config changed
# Numlock on boot
- name: Set numlock on boot
ansible.builtin.copy:
src: getty.service
dest: /etc/systemd/system/getty@.service.d/override.conf
become: true
notify:
- etc changed
- systemd changed
when: auto_numlock
- name: Unset numlock on boot
ansible.builtin.file:
path: /etc/systemd/system/getty@.service.d/override.conf
state: absent
become: true
notify:
- etc changed
- systemd changed
when: not auto_numlock
# TLP configuration
- name: Start/enable TLP
ansible.builtin.systemd:
name: tlp
state: started
enabled: true
become: true
notify: etc changed
# Network configuration
- name: Start/enable dhcpcd
ansible.builtin.systemd:
name: dhcpcd
state: started
enabled: true
become: true
notify: etc changed
- name: Configure wpa_supplicant
ansible.builtin.template:
src: wpa_supplicant.conf.j2
dest: /etc/wpa_supplicant/wpa_supplicant.conf
notify:
- etc changed
- wpa_supplicant changed
become: true
tags:
- wificonf
- name: Prepare directory for wpa_supplicant service override
ansible.builtin.file:
path: /etc/systemd/system/wpa_supplicant@.service.d
state: directory
mode: u=rwx,g=rx,o=rx
become: true
- name: Make wpa_supplicant use a common configuration file
ansible.builtin.copy:
src: wpa_supplicant.service
dest: /etc/systemd/system/wpa_supplicant@.service.d/override.conf
become: true
notify:
- etc changed
- systemd changed
- wifi setup changed
- name: Disable wpa_supplicant for networkmanager
ansible.builtin.systemd:
name: wpa_supplicant
enabled: false
become: true
notify:
- etc changed
- wifi setup changed
- name: Start/enable wpa_supplicant for interface
ansible.builtin.systemd:
name: wpa_supplicant@{{ item }}
enabled: true
become: true
notify:
- etc changed
- wifi setup changed
loop: "{{ ansible_interfaces }}"
when: item.startswith('wl')
# Could probably use something better like
# listing /sys/class/ieee80211/*/device/net/
- name: Uninstall networkmanager
community.general.pacman:
name: networkmanager
state: absent
extra_args: --cascade --recursive
when: arch_based
become: true
notify:
- wifi setup changed
- name: Mask systemd-networkd
ansible.builtin.systemd:
name: systemd-networkd
state: stopped
enabled: false
masked: true
become: true
notify: etc changed
# Time synchronisation
- name: Mask systemd-timesyncd
ansible.builtin.systemd:
name: systemd-timesyncd
state: stopped
enabled: false
masked: true
become: true
notify: etc changed
- name: Configure chrony
ansible.builtin.copy:
src: chrony.conf
dest: /etc/chrony.conf
become: true
notify:
- etc changed
- chrony reconfigured
# TODO More configuration, RTC configuration
- name: Enable chronyd
ansible.builtin.systemd:
name: chronyd
enabled: true
become: true
notify:
- etc changed
- chrony reconfigured
- name: Configure dhcpcd chrony hook
ansible.builtin.copy:
src: dhcpcd.exit-hook
dest: /etc/dhcpcd.exit-hook
become: true
notify: etc changed
- name: Empty motd
ansible.builtin.copy:
content: ""
dest: /etc/motd
mode: u=rw,g=r,o=r
become: true
notify:
- etc changed
# VPN configuration
- name: Prepare directory for openvpn-client service override
ansible.builtin.file:
path: /etc/systemd/system/openvpn-client@.service.d
state: directory
mode: u=rwx,g=rx,o=rx
become: true
- name: Make openvpn use hooks for resolvconf
ansible.builtin.copy:
src: openvpn-client.service
dest: /etc/systemd/system/openvpn-client@.service.d/override.conf
become: true
notify:
- etc changed
- systemd changed
- name: Disable power button
ansible.builtin.lineinfile:
path: /etc/systemd/logind.conf
line: HandlePowerKey=ignore
regexp: ^#? *HandlePowerKey=
insertafter: ^\[Login\]$
become: true
notify: systemd-logind config changed
# Reason: I sometimes press it accidentally
# (hoping to start it when it's already started,
# or really accidentally on the Pinebook).
# Suspend would be nice, but it doesn't have the locker then
# TODO Hibernation, if that's relevant
# $ sudo blkid | grep 'TYPE="swap"'
# $ sudoedit /etc/default/grub
# Add resume=UUID=<UUID-of-swap-partition> to GRUB_CMDLINE_LINUX_DEFAULT
# $ sudo grub-mkconfig -o /boot/grub/grub.cfg
# TODO udevil

View file

@ -1,98 +0,0 @@
# Giving configuration update rights to wpa_cli
ctrl_interface=/run/wpa_supplicant
ctrl_interface_group=wheel
update_config=1
# AP scanning
ap_scan=1
# ISO/IEC alpha2 country code in which the device is operating
country=NL
{% set password_store_path = lookup('env', 'PASSWORD_STORE_DIR') or ansible_user_dir + '/.password-store/' %}
{% set wifi_pass_paths = query('fileglob', password_store_path + 'wifi/*.gpg') %}
{% set names = wifi_pass_paths | map('regex_replace', '^.+/wifi/(.+).gpg$', '\\1') | sort%}
{% for name in names %}
{#
community.general.passwordstore doesn't support path with spaces in it,
so we're using a `ssid` attribute, which default to the names for SSIDs without space.
#}
{% set pass = lookup('community.general.passwordstore', 'wifi/' + name) %}
{% set suffixes = lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=suffixes') or [''] %}
{% set ssid = lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=ssid') or name %}
{% set type = lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=type') or ('wpa' if pass else 'open') %}
# {{ name }}
{% for suffix in suffixes %}
network={
ssid="{{ ssid }}{{ suffix }}"
{% if type == 'wpa' %}
psk="{{ pass }}"
{% elif type == 'wep' %}
key_mgmt=NONE
wep_key0={{ pass }}
{% elif type == 'wpa-eap' %}
key_mgmt=WPA-EAP
eap={{ lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=eap') }}
identity="{{ lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=identity') }}"
password="{{ pass }}"
ca_cert="{{ lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=ca_cert') }}"
altsubject_match="{{ lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=altsubject_match') }}"
phase2="{{ lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=phase2') }}"
{% elif type == 'open' %}
key_mgmt=NONE
{% else %}
# Error, unknown type: {{ type }}
{% endif %}
}
{% endfor %}
{% endfor %}
{# REFERENCES
# WPA
network={
ssid="WPA_SSID"
psk="XXXXXXXXXXXXXXXXXXXXXXXXXX"
}
# WEP
network={
ssid="WEP_SSID"
key_mgmt=NONE
wep_key0=FFFFFFFFFFFFFFFFFFFFFFFFFF
}
# Open
network={
ssid="OPEN_SSID"
key_mgmt=NONE
}
# eduroam password
network={
ssid="eduroam"
key_mgmt=WPA-EAP
eap=PEAP
identity="id@univ.tld"
password="hunter2"
}
# eduroam certificate
network={
ssid="eduroam"
key_mgmt=WPA-EAP
# pairwise=CCMP
pairwise=CCMP TKIP
group=CCMP TKIP
eap=TLS
ca_cert="/path/to/ca.pem"
identity="id@univ.tld"
domain_suffix_match="wifi.univ.tld"
client_cert="/path/to/cert.pem"
private_key="/path/to/key.pem"
private_key_passwd="hunter2"
phase2="auth="
#anonymous_identity=""
}
#}

View file

@ -1,12 +0,0 @@
---
- name: Upgrade Neovim plugins
ansible.builtin.command: nvim +PlugUpgrade +PlugUpdate +PlugInstall +qall!
listen: nvim plugins changed
environment:
VIMINIT: source {{ ansible_user_dir }}/.config/nvim/plugininstall.vim
- name: Upgrade Vim plugins
ansible.builtin.command: vim +PlugUpgrade +PlugUpdate +PlugInstall +qall!
listen: vim plugins changed
environment:
VIMINIT: source {{ ansible_user_dir }}/.config/vim/plugininstall.vim

View file

@ -1,55 +0,0 @@
---
- name: Set vim variants to use
ansible.builtin.set_fact:
vim_variants:
- vim
- nvim
# TODO vim-minimal for bsh
# TODO Select those in a clever way
- name: Create vim configuration directory
ansible.builtin.file:
state: directory
path: "{{ ansible_user_dir }}/.config/{{ item }}"
mode: u=rwx,g=rx,o=rx
loop: "{{ vim_variants }}"
- name: Install vim-plug
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
dest: "{{ ansible_user_dir }}/.config/vim/plug.vim"
mode: u=rw,g=r,o=r
- name: Install loader
ansible.builtin.template:
src: loader.j2
dest: "{{ ansible_user_dir }}/.config/vim/loader.vim"
mode: u=rw,g=r,o=r
- name: Install theme
ansible.builtin.template:
src: theme.j2
dest: "{{ ansible_user_dir }}/.config/vim/theme.vim"
mode: u=rw,g=r,o=r
tags:
- color
- name: Configure vim plugin list
ansible.builtin.template:
src: plugininstall.j2
dest: "{{ ansible_user_dir }}/.config/{{ variant }}/plugininstall.vim"
mode: u=rw,g=r,o=r
notify:
- "{{ variant }} plugins changed"
loop: "{{ vim_variants }}"
loop_control:
loop_var: variant
- name: Configure vim
ansible.builtin.template:
src: init.vim.j2
dest: "{{ ansible_user_dir }}/.config/{{ variant }}/init.vim"
mode: u=rw,g=r,o=r
loop: "{{ vim_variants }}"
loop_control:
loop_var: variant

View file

@ -1,101 +0,0 @@
" From https://www.hillelwayne.com/post/intermediate-vim/
set encoding=utf-8
set title
set number
set ruler
set wrap
set scrolloff=10
set ignorecase
set smartcase
set gdefault
if has('nvim')
set inccommand=nosplit " Shows you in realtime what changes your ex command should make.
endif
set incsearch
set hlsearch
set tabstop=4
set shiftwidth=4
set expandtab
set visualbell
set noerrorbells
set backspace=indent,eol,start
set hidden
set updatetime=250
set lazyredraw " Do not redraw screen in the middle of a macro. Makes them complete faster.
set cursorcolumn
set splitbelow
" Turn off relativenumber only for insert mode.
if has('nvim')
set relativenumber
augroup every
autocmd!
au InsertEnter * set norelativenumber
au InsertLeave * set relativenumber
augroup END
endif
" Keep undo history across sessions by storing it in a file
if has('persistent_undo')
let myUndoDir = expand(vimDir . '/undodir')
" Create dirs
call system('mkdir ' . myUndoDir)
let &undodir = myUndoDir
set undofile
endif
syntax enable
" From http://stackoverflow.com/a/5004785/2766106
set list
set listchars=tab:╾╌,trail:·,extends:↦,precedes:↤,nbsp:_
set showbreak=↪
filetype on
filetype plugin on
filetype indent on
set wildmode=longest:full,full
set wildmenu
set showcmd
" Completion
" Avoid showing message extra message when using completion
set shortmess+=c
" Close the file explorer once you select a file
let g:netrw_fastbrowse = 0
" Allow saving of files as sudo when I forgot to start vim using sudo.
" From https://stackoverflow.com/a/7078429
cmap w!! w !sudo tee > /dev/null %
imap jk <Esc>
vmap <Enter> <Esc>
nmap <Enter> o<Esc>
nmap <C-H> :bp<CR>
nmap <C-L> :bn<CR>
nmap <C-K> kkkkkkkkkkkkkkkkkkkkk
nmap <C-J> jjjjjjjjjjjjjjjjjjjjj
" \s to replace globally the word under the cursor
nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
" add extensions to syntax
au BufNewFile,BufRead *.jinja set filetype=jinja2
command Reload source $MYVIMRC

View file

@ -1,23 +0,0 @@
set nocompatible
filetype on
" SET PATHS
set runtimepath+=~/.config/{{ variant }}
let vimDir = '$HOME/.cache/{{ variant }}'
call system('mkdir ' . vimDir)
let &runtimepath.=','.vimDir
set viminfo+=n~/.cache/{{ variant }}/viminfo
" PLUGIN INSTALLATION
source ~/.config/{{ variant }}/plugininstall.vim
" EDITOR CONFIGURATION
{% include 'editor.j2' %}
" PLUGINS CONFIGURATION
{% include 'pluginconfig.j2' %}

View file

@ -1,6 +0,0 @@
if has('nvim')
let $MYVIMRC="~/.config/nvim/init.vim"
else
let $MYVIMRC="~/.config/vim/init.vim"
endif
source $MYVIMRC

View file

@ -1,2 +0,0 @@
{% set plugins = namespace(sources=[]) %}
{% include 'pluginlist.j2' %}

View file

@ -1,13 +0,0 @@
source ~/.config/vim/plug.vim
{% set plugins = namespace(sources=[]) %}
{% import 'pluginlist.j2' as pluginlist with context %}
call plug#begin('~/.cache/{{ variant }}/plugged')
{% for link, extra in plugins.sources %}
{% if extra %}
Plug '{{ link }}', { {% for k, v in extra.items() %}'{{ k }}': '{{ v }}', {% endfor %} }
{% else %}
Plug '{{ link }}'
{% endif %}
{% endfor %}
call plug#end()

View file

@ -1,115 +0,0 @@
{% macro add_source(link, extra={}) -%}
{% set plugins.sources = plugins.sources + [(link, extra)] %}
{%- endmacro -%}
{% macro use_plugin(name) -%}
" START PLUGIN CONFIG {{ name }}
{% include 'plugins/' + name + '.j2' +%}
" END PLUGIN CONFIG {{ name }}
{%- endmacro -%}
" Visuals
{{ use_plugin('base16') }}
{{ use_plugin('devicons') }}
{% if variant == 'nvim' %}
{{ use_plugin('specs') }}
{{ use_plugin('scrollview') }}
{% endif %}
" Theme
source ~/.config/vim/theme.vim
" Status/tab lines
{% if variant == 'nvim' %}
{{ use_plugin('barbar') }}
{{ use_plugin('feline') }}
{% else %}
{{ use_plugin('airline') }}
{% endif %}
" Goto utilities
{% if variant == 'nvim' %}
{{ use_plugin('telescope') }}
{% else %}
{{ use_plugin('fzf') }}
{% endif %}
" Search/replace
{{ use_plugin('abolish') }}
{{ use_plugin('easy_align') }}
" Sourounding pairs
{{ use_plugin('surround') }}
{{ use_plugin('targets') }}
" f/F mode
{{ use_plugin('shot_f') }}
{{ use_plugin('quick_scope') }}
" Registers
{{ use_plugin('registers') }}
" Tags/Symbols
{{ use_plugin('gutentags') }}
{% if variant == 'nvim' %}
{{ use_plugin('symbols-outline') }}
{% else %}
{{ use_plugin('vista') }}
{% endif %}
" Language Server Client
{% if variant == 'nvim' %}
{{ use_plugin('nvim_lspconfig') }}
{{ use_plugin('lightbulb') }}
{{ use_plugin('lspkind') }}
{{ use_plugin('lsp_signature') }}
{% else %}
{{ use_plugin('vim_lsp') }}
{% endif %}
" Treesitter
{% if variant == 'nvim' %}
{{ use_plugin('treesitter') }}
{{ use_plugin('ts-rainbow') }}
{# TODO
{{ use_plugin('indent-blankline') }}
#}
{% endif %}
" Snippets
{{ use_plugin('vsnip') }}
" Auto-completion
{% if variant == 'nvim' %}
{{ use_plugin('nvim_compe') }}
{% else %}
{{ use_plugin('deoplete') }}
{{ use_plugin('supertab') }}
{% endif %}
" Undo management
{{ use_plugin('undotree') }}
" Git helpers
{{ use_plugin('fugitive') }}
{% if variant == 'nvim' %}
{{ use_plugin('gitsigns') }}
{% else %}
{{ use_plugin('gitgutter') }}
{% endif %}
" Language-specific stuff
{{ use_plugin('tcomment') }}
{{ use_plugin('languagetool') }}
{{ use_plugin('pandoc') }}
{% if variant == 'nvim' %}
{{ use_plugin('dap') }}
{{ use_plugin('colorizer') }}
{% else %}
{% if 'c' in dev_stuffs or 'c++' in dev_stuffs %}
{{ use_plugin('vebugger') }}
{% endif %}
{% endif %}
{% if 'ansible' in dev_stuffs %}
{{ use_plugin('ansible') }}
{% endif %}

View file

@ -1,2 +0,0 @@
{# Regex for words, with case in mind #}
{{ add_source('tpope/tpope-vim-abolish') -}}

View file

@ -1,15 +0,0 @@
{{ add_source('vim-airline/vim-airline') -}}
{{ add_source('vim-airline/vim-airline-themes') -}}
set noshowmode
set laststatus=2
let g:airline_powerline_fonts = 1
{% if variant != 'nvim' %}
let g:airline#extensions#tabline#enabled = 1
{% endif %}
let g:airline_section_a = airline#section#create(['mode'])
let g:airline_section_b = airline#section#create(['branch', 'hunks'])
" let g:airline_section_z = airline#section#create(['%B', '@', '%l', ':', '%c'])
let airline#extensions#languageclient#error_symbol = '✖ '
let airline#extensions#languageclient#warning_symbol = '⚠ '

View file

@ -1,10 +0,0 @@
" Asynchronous Lint Engine
" LSP client for vim and nvim
{{ add_source('dense-analysis/ale') }}
nmap <F3> :ALEFix<CR>
let g:ale_sign_error = '×'
let g:ale_sign_warning = '!'
let g:ale_completion_enabled = 1
let g:ale_fixers = ['autopep8', 'shfmt', 'uncrustify', 'remove_trailing_lines', 'trim_whitespace', 'phpcbf']

View file

@ -1,2 +0,0 @@
{# Various for Ansible #}
{{ add_source('pearofducks/ansible-vim', { 'do': './UltiSnips/generate.sh'}) -}}

View file

@ -1,14 +0,0 @@
{{ add_source('prabirshrestha/asyncomplete.vim') -}}
let g:asyncomplete_auto_popup = 1
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>"
imap <c-space> <Plug>(asyncomplete_force_refresh)
{{ add_source('prabirshrestha/asyncomplete-file.vim') -}}
au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#file#get_source_options({
\ 'name': 'file',
\ 'whitelist': ['*'],
\ 'priority': 10,
\ 'completor': function('asyncomplete#sources#file#completor')
\ }))

View file

@ -1,21 +0,0 @@
{{ add_source('romgrk/barbar.nvim') -}}
" Move to previous/next
nmap <silent> <C-H> :BufferPrevious<CR>
nmap <silent> <C-L> :BufferNext<CR>
" Re-order to previous/next
nmap <silent> <Space><C-H> :BufferMovePrevious<CR>
nmap <silent> <Space><C-L> :BufferMoveNext<CR>
" Goto buffer in position...
nmap <silent> <C-1> :BufferGoto 1<CR>
nmap <silent> <C-2> :BufferGoto 2<CR>
nmap <silent> <C-3> :BufferGoto 3<CR>
nmap <silent> <C-4> :BufferGoto 4<CR>
nmap <silent> <C-5> :BufferGoto 5<CR>
nmap <silent> <C-6> :BufferGoto 6<CR>
nmap <silent> <C-7> :BufferGoto 7<CR>
nmap <silent> <C-8> :BufferGoto 8<CR>
nmap <silent> <C-0> :BufferGoto 0<CR>
nmap <silent> <C-0> :BufferLast<CR>
nmap <silent> gb :BufferPick<CR>

View file

@ -1,7 +0,0 @@
{% if variant == 'nvim' %}
{# Beware, doesn't work without RGB colors #}
{{ add_source('RRethy/nvim-base16') -}}
{% else %}
{{ add_source('chriskempson/base16-vim') -}}
{% endif %}

View file

@ -1,7 +0,0 @@
{# Display the actual color for color codes " #}
{{ add_source('norcalli/nvim-colorizer.lua') -}}
set termguicolors
lua << EOF
require'colorizer'.setup()
EOF
{# TODO Enable for css functions too #}

View file

@ -1,2 +0,0 @@
{# Debug Adapter Protocol client #}
{{ add_source('mfussenegger/nvim-dap') -}}

View file

@ -1,26 +0,0 @@
{# Auto-completion for vim and nvim #}
{% if variant == 'nvim' -%}
{{ add_source('Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'}) -}}
{% else -%}
{{ add_source('Shougo/deoplete.nvim') -}}
{{ add_source('roxma/nvim-yarp') -}}
{{ add_source('roxma/vim-hug-neovim-rpc') -}}
{% endif -%}
{% raw %}
let g:deoplete#enable_at_startup = 1
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ deoplete#manual_complete()
function! s:check_back_space() abort "{{{
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction"}}}
{% endraw %}
" suggested by ssemshi to make it not too slow
" let g:deoplete#auto_complete_delay = 100
call deoplete#custom#option({
\ 'auto_complete_delay': 100,
\ 'smart_case': v:true,
\ })

View file

@ -1,5 +0,0 @@
{% if variant == 'nvim' %}
{{ add_source('kyazdani42/nvim-web-devicons') -}}
{% else %}
{{ add_source('ryanoasis/vim-devicons') -}}
{% endif %}

View file

@ -1,4 +0,0 @@
{# Aligning lines around a certain character #}
{{ add_source('junegunn/vim-easy-align') -}}
" Align GitHub-flavored Markdown tables
au FileType markdown vmap <Bar> :EasyAlign*<Bar><Enter>

Some files were not shown because too many files have changed in this diff Show more