diff --git a/.gitignore b/.gitignore index bee8a64..29ae37f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -__pycache__ +*/system +*/vm +*/vmWithBootLoader +*.qcow2 diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index bd1e309..0000000 --- a/.gitmodules +++ /dev/null @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..6088706 --- /dev/null +++ b/README.md @@ -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. Used to separate configuration in separate logical units. + - `default.nix`: Entrypoint for that module. Contains Nix configuration for the module. + - ``: Extra files: scripts to be installed, or ... whatever. + - `default.nix`: Entrypoint for that system. Import all the modules. + - ``: 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) + - `.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). +- `` (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. +- `_` (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. diff --git a/add_channels.sh b/add_channels.sh new file mode 100755 index 0000000..5ad032b --- /dev/null +++ b/add_channels.sh @@ -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 diff --git a/bash_logout b/bash_logout deleted file mode 100644 index 9bccd62..0000000 --- a/bash_logout +++ /dev/null @@ -1,2 +0,0 @@ -clear -reset diff --git a/bash_profile b/bash_profile deleted file mode 100644 index c2a182e..0000000 --- a/bash_profile +++ /dev/null @@ -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 diff --git a/bashrc b/bashrc deleted file mode 100644 index b666d4d..0000000 --- a/bashrc +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -source ~/.config/shell/shrc -source ~/.config/shell/commonrc -source ~/.config/shell/bashrc diff --git a/build_os.sh b/build_os.sh new file mode 100755 index 0000000..2c655d9 --- /dev/null +++ b/build_os.sh @@ -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 '' -I "nixos-config=${nixos_config}" -A "$attr" -o "${profile_dir}/${attr}" + +echo  diff --git a/config/Xresources/.gitignore b/config/Xresources/.gitignore deleted file mode 100644 index 62fd177..0000000 --- a/config/Xresources/.gitignore +++ /dev/null @@ -1 +0,0 @@ -theme diff --git a/config/Xresources/main b/config/Xresources/main deleted file mode 100644 index 7e8e091..0000000 --- a/config/Xresources/main +++ /dev/null @@ -1,4 +0,0 @@ -#include ".config/Xresources/xft" -#include ".config/Xresources/theme" -#include ".config/Xresources/xterm" -#include ".config/Xresources/urxvt" diff --git a/config/Xresources/urxvt b/config/Xresources/urxvt deleted file mode 100644 index 1ea3a06..0000000 --- a/config/Xresources/urxvt +++ /dev/null @@ -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 - diff --git a/config/Xresources/xft b/config/Xresources/xft deleted file mode 100644 index 9cf2b58..0000000 --- a/config/Xresources/xft +++ /dev/null @@ -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 diff --git a/config/Xresources/xterm b/config/Xresources/xterm deleted file mode 100644 index cb5531d..0000000 --- a/config/Xresources/xterm +++ /dev/null @@ -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 C: copy-selection(CLIPBOARD) \n\ - Ctrl Shift V: insert-selection(CLIPBOARD) diff --git a/config/alacritty/.gitignore b/config/alacritty/.gitignore deleted file mode 100644 index f84003c..0000000 --- a/config/alacritty/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -theme.yml -alacritty.yml diff --git a/config/alacritty/alacritty.yml.j2 b/config/alacritty/alacritty.yml.j2 deleted file mode 100644 index 6f9cea6..0000000 --- a/config/alacritty/alacritty.yml.j2 +++ /dev/null @@ -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 diff --git a/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr b/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr deleted file mode 100644 index 0b27504..0000000 --- a/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr +++ /dev/null @@ -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 diff --git a/config/automatrop/playbooks/default.yml b/config/automatrop/playbooks/default.yml deleted file mode 100644 index c3ab088..0000000 --- a/config/automatrop/playbooks/default.yml +++ /dev/null @@ -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 diff --git a/config/automatrop/plugins/modules/aur b/config/automatrop/plugins/modules/aur deleted file mode 160000 index 592c6d9..0000000 --- a/config/automatrop/plugins/modules/aur +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 592c6d9841674211f904cf9ea2a951fca3fd5a80 diff --git a/config/automatrop/plugins/modules/gpg_key b/config/automatrop/plugins/modules/gpg_key deleted file mode 160000 index 435f8e6..0000000 --- a/config/automatrop/plugins/modules/gpg_key +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 435f8e6aea0ba9be482c4409db380868a23fea9c diff --git a/config/automatrop/roles/access/tasks/main.yml b/config/automatrop/roles/access/tasks/main.yml deleted file mode 100644 index 8eec9e3..0000000 --- a/config/automatrop/roles/access/tasks/main.yml +++ /dev/null @@ -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. diff --git a/config/automatrop/roles/desktop_environment/default/main.yml b/config/automatrop/roles/desktop_environment/default/main.yml deleted file mode 100644 index aaaf42b..0000000 --- a/config/automatrop/roles/desktop_environment/default/main.yml +++ /dev/null @@ -1 +0,0 @@ -base16_scheme: solarized-dark diff --git a/config/automatrop/roles/desktop_environment/handlers/main.yml b/config/automatrop/roles/desktop_environment/handlers/main.yml deleted file mode 100644 index 9234eda..0000000 --- a/config/automatrop/roles/desktop_environment/handlers/main.yml +++ /dev/null @@ -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 diff --git a/config/automatrop/roles/desktop_environment/tasks/main.yml b/config/automatrop/roles/desktop_environment/tasks/main.yml deleted file mode 100644 index 7bf5de8..0000000 --- a/config/automatrop/roles/desktop_environment/tasks/main.yml +++ /dev/null @@ -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 diff --git a/config/automatrop/roles/dotfiles/tasks/main.yml b/config/automatrop/roles/dotfiles/tasks/main.yml deleted file mode 100644 index 48af280..0000000 --- a/config/automatrop/roles/dotfiles/tasks/main.yml +++ /dev/null @@ -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 diff --git a/config/automatrop/roles/ecryptfs_automount/README.md b/config/automatrop/roles/ecryptfs_automount/README.md deleted file mode 100644 index de12a3b..0000000 --- a/config/automatrop/roles/ecryptfs_automount/README.md +++ /dev/null @@ -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 - diff --git a/config/automatrop/roles/ecryptfs_automount/tasks/main.yml b/config/automatrop/roles/ecryptfs_automount/tasks/main.yml deleted file mode 100644 index 5500200..0000000 --- a/config/automatrop/roles/ecryptfs_automount/tasks/main.yml +++ /dev/null @@ -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 diff --git a/config/automatrop/roles/facts/tasks/main.yml b/config/automatrop/roles/facts/tasks/main.yml deleted file mode 100644 index 238366b..0000000 --- a/config/automatrop/roles/facts/tasks/main.yml +++ /dev/null @@ -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? diff --git a/config/automatrop/roles/gnupg/tasks/main.yml b/config/automatrop/roles/gnupg/tasks/main.yml deleted file mode 100644 index eb5c3b8..0000000 --- a/config/automatrop/roles/gnupg/tasks/main.yml +++ /dev/null @@ -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 diff --git a/config/automatrop/roles/gnupg/vars/main.yml b/config/automatrop/roles/gnupg/vars/main.yml deleted file mode 100644 index 99f562b..0000000 --- a/config/automatrop/roles/gnupg/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -gnupghome: "{{ ansible_user_dir }}/.config/gnupg" diff --git a/config/automatrop/roles/kewlfft.aur/LICENSE b/config/automatrop/roles/kewlfft.aur/LICENSE deleted file mode 100644 index 94a9ed0..0000000 --- a/config/automatrop/roles/kewlfft.aur/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - 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. - - - Copyright (C) - - 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 . - -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: - - Copyright (C) - 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 -. - - 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 -. diff --git a/config/automatrop/roles/kewlfft.aur/README.md b/config/automatrop/roles/kewlfft.aur/README.md deleted file mode 100644 index 45bd730..0000000 --- a/config/automatrop/roles/kewlfft.aur/README.md +++ /dev/null @@ -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 -``` diff --git a/config/automatrop/roles/kewlfft.aur/library/aur.py b/config/automatrop/roles/kewlfft.aur/library/aur.py deleted file mode 100644 index b52442d..0000000 --- a/config/automatrop/roles/kewlfft.aur/library/aur.py +++ /dev/null @@ -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 -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() diff --git a/config/automatrop/roles/kewlfft.aur/meta/.galaxy_install_info b/config/automatrop/roles/kewlfft.aur/meta/.galaxy_install_info deleted file mode 100644 index 262dba5..0000000 --- a/config/automatrop/roles/kewlfft.aur/meta/.galaxy_install_info +++ /dev/null @@ -1,2 +0,0 @@ -install_date: Sun Feb 21 21:18:27 2021 -version: master diff --git a/config/automatrop/roles/kewlfft.aur/meta/main.yml b/config/automatrop/roles/kewlfft.aur/meta/main.yml deleted file mode 100644 index f65f2df..0000000 --- a/config/automatrop/roles/kewlfft.aur/meta/main.yml +++ /dev/null @@ -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: [] diff --git a/config/automatrop/roles/mnussbaum.base16-builder-ansible b/config/automatrop/roles/mnussbaum.base16-builder-ansible deleted file mode 160000 index a977bb2..0000000 --- a/config/automatrop/roles/mnussbaum.base16-builder-ansible +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a977bb298fb9e1c057e0b2587dbd4d047e13f5bd diff --git a/config/automatrop/roles/software/handlers/main.yml b/config/automatrop/roles/software/handlers/main.yml deleted file mode 100644 index 54bb26a..0000000 --- a/config/automatrop/roles/software/handlers/main.yml +++ /dev/null @@ -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 diff --git a/config/automatrop/roles/software/tasks/main.yml b/config/automatrop/roles/software/tasks/main.yml deleted file mode 100644 index 7686056..0000000 --- a/config/automatrop/roles/software/tasks/main.yml +++ /dev/null @@ -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 "", line 1, in -# File "/data/data/com.termux/files/usr/tmp/pip-install-dsga__i7/python-apt/setup.py", line 11, in -# 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 diff --git a/config/automatrop/roles/software/templates/PKGBUILD.j2 b/config/automatrop/roles/software/templates/PKGBUILD.j2 deleted file mode 100644 index 8f424c6..0000000 --- a/config/automatrop/roles/software/templates/PKGBUILD.j2 +++ /dev/null @@ -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 %} -) diff --git a/config/automatrop/roles/software/templates/package_manager.j2 b/config/automatrop/roles/software/templates/package_manager.j2 deleted file mode 100644 index f8305b4..0000000 --- a/config/automatrop/roles/software/templates/package_manager.j2 +++ /dev/null @@ -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 %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_android_tools.j2 b/config/automatrop/roles/software/templates/snippets/pm_android_tools.j2 deleted file mode 100644 index 3adfc83..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_android_tools.j2 +++ /dev/null @@ -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 %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_data_management.j2 b/config/automatrop/roles/software/templates/snippets/pm_data_management.j2 deleted file mode 100644 index d6c2768..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_data_management.j2 +++ /dev/null @@ -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 %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 b/config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 deleted file mode 100644 index f042a59..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 +++ /dev/null @@ -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 %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 deleted file mode 100644 index 373384a..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 +++ /dev/null @@ -1,4 +0,0 @@ -ansible -ansible-lint -ansible-language-server -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_c.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_c.j2 deleted file mode 100644 index 7353cb9..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_c.j2 +++ /dev/null @@ -1,10 +0,0 @@ -{% if termux %} -{# Otherwise installed by base-devel or equivalent #} -make -gcc -{% endif %} -cmake -clang -ccache -gdb -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_common.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_common.j2 deleted file mode 100644 index 5c0c0ce..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_common.j2 +++ /dev/null @@ -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 #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_docker.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_docker.j2 deleted file mode 100644 index 012121f..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_docker.j2 +++ /dev/null @@ -1,3 +0,0 @@ -docker -docker-compose -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_fpga.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_fpga.j2 deleted file mode 100644 index 67dcb76..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_fpga.j2 +++ /dev/null @@ -1,6 +0,0 @@ -yosys -iverilog -ghdl -{% if display_server %} -gtkwave -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_network.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_network.j2 deleted file mode 100644 index 2b882d6..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_network.j2 +++ /dev/null @@ -1,14 +0,0 @@ -wget -curl -socat -{% if arch_based %} -bind -{% else %} -dnsutils -{% endif %} -whois -nmap -tcpdump -{% if display_server %} -wireshark-qt -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_nix.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_nix.j2 deleted file mode 100644 index 71a9e74..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_nix.j2 +++ /dev/null @@ -1,3 +0,0 @@ -nix -rnix-lsp - diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_perl.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_perl.j2 deleted file mode 100644 index 693399c..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_perl.j2 +++ /dev/null @@ -1,5 +0,0 @@ -{% if arch_based %} -{# TODO Disabled because it currently doesn't build -perl-perl-languageserver -#} -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_php.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_php.j2 deleted file mode 100644 index dd1fee4..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_php.j2 +++ /dev/null @@ -1 +0,0 @@ -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_python.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_python.j2 deleted file mode 100644 index 5f457a8..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_python.j2 +++ /dev/null @@ -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 #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_shell.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_shell.j2 deleted file mode 100644 index 7cd054e..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_shell.j2 +++ /dev/null @@ -1,2 +0,0 @@ -bash-language-server -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_sql.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_sql.j2 deleted file mode 100644 index e961816..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_sql.j2 +++ /dev/null @@ -1 +0,0 @@ -sql-language-server diff --git a/config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 b/config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 deleted file mode 100644 index 24361ff..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 +++ /dev/null @@ -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 #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_document.j2 b/config/automatrop/roles/software/templates/snippets/pm_document.j2 deleted file mode 100644 index 0ba2105..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_document.j2 +++ /dev/null @@ -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 %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dotfiles_dependencies.j2 b/config/automatrop/roles/software/templates/snippets/pm_dotfiles_dependencies.j2 deleted file mode 100644 index 87d4545..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dotfiles_dependencies.j2 +++ /dev/null @@ -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 #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_download.j2 b/config/automatrop/roles/software/templates/snippets/pm_download.j2 deleted file mode 100644 index 272244c..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_download.j2 +++ /dev/null @@ -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 %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 b/config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 deleted file mode 100644 index 236557e..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 +++ /dev/null @@ -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 %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_mpd.j2 b/config/automatrop/roles/software/templates/snippets/pm_mpd.j2 deleted file mode 100644 index f5744ea..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_mpd.j2 +++ /dev/null @@ -1,9 +0,0 @@ -{# -To play music with Music Player Daemon -#} -mpd -mpc -{% if arch_based %} -ashuffle-git -vimpc-git -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 b/config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 deleted file mode 100644 index 92cedd3..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 +++ /dev/null @@ -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 %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_multimedia_editors.j2 b/config/automatrop/roles/software/templates/snippets/pm_multimedia_editors.j2 deleted file mode 100644 index 9462c63..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_multimedia_editors.j2 +++ /dev/null @@ -1,12 +0,0 @@ -{# -Big behemoth applications -#} -{% if display_server %} -gimp -inkscape -darktable -blender -puddletag -musescore -audacity -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 b/config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 deleted file mode 100644 index 9b8ba1b..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 +++ /dev/null @@ -1,4 +0,0 @@ -ffmpeg -sox -imagemagick -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 b/config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 deleted file mode 100644 index 251d823..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 +++ /dev/null @@ -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 #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_remote.j2 b/config/automatrop/roles/software/templates/snippets/pm_remote.j2 deleted file mode 100644 index c3bded8..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_remote.j2 +++ /dev/null @@ -1,6 +0,0 @@ -openssh -wget -rsync -{% if display_server %} -tigervnc -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_shell.j2 b/config/automatrop/roles/software/templates/snippets/pm_shell.j2 deleted file mode 100644 index 5a519a7..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_shell.j2 +++ /dev/null @@ -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 %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_system.j2 b/config/automatrop/roles/software/templates/snippets/pm_system.j2 deleted file mode 100644 index 726dbec..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_system.j2 +++ /dev/null @@ -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 %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_terminal_essentials.j2 b/config/automatrop/roles/software/templates/snippets/pm_terminal_essentials.j2 deleted file mode 100644 index 69a99cd..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_terminal_essentials.j2 +++ /dev/null @@ -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 #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_termux.j2 b/config/automatrop/roles/software/templates/snippets/pm_termux.j2 deleted file mode 100644 index 8cc9822..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_termux.j2 +++ /dev/null @@ -1,9 +0,0 @@ -{# -Stuff that only makes sense on Termux -#} -{% if termux %} -{% if root_access %} -tsu -{% endif %} -termux-api -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_wine.j2 b/config/automatrop/roles/software/templates/snippets/pm_wine.j2 deleted file mode 100644 index 410e64c..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_wine.j2 +++ /dev/null @@ -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 %} diff --git a/config/automatrop/roles/system/files/chrony.conf b/config/automatrop/roles/system/files/chrony.conf deleted file mode 100644 index ed8df86..0000000 --- a/config/automatrop/roles/system/files/chrony.conf +++ /dev/null @@ -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 diff --git a/config/automatrop/roles/system/files/dhcpcd.exit-hook b/config/automatrop/roles/system/files/dhcpcd.exit-hook deleted file mode 100644 index 7f08fd8..0000000 --- a/config/automatrop/roles/system/files/dhcpcd.exit-hook +++ /dev/null @@ -1,5 +0,0 @@ -if $if_up; then - chronyc online -elif $if_down; then - chronyc offline -fi diff --git a/config/automatrop/roles/system/files/openvpn-client.service b/config/automatrop/roles/system/files/openvpn-client.service deleted file mode 100644 index 1748351..0000000 --- a/config/automatrop/roles/system/files/openvpn-client.service +++ /dev/null @@ -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 diff --git a/config/automatrop/roles/system/files/us_qwert_alt_numpad.patch b/config/automatrop/roles/system/files/us_qwert_alt_numpad.patch deleted file mode 100644 index 6e745b3..0000000 --- a/config/automatrop/roles/system/files/us_qwert_alt_numpad.patch +++ /dev/null @@ -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"; - diff --git a/config/automatrop/roles/system/files/wpa_supplicant.service b/config/automatrop/roles/system/files/wpa_supplicant.service deleted file mode 100644 index a839d44..0000000 --- a/config/automatrop/roles/system/files/wpa_supplicant.service +++ /dev/null @@ -1,3 +0,0 @@ -[Service] -ExecStart= -ExecStart=/usr/bin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -i%I diff --git a/config/automatrop/roles/system/files/xorg/keyboard.conf b/config/automatrop/roles/system/files/xorg/keyboard.conf deleted file mode 100644 index 8248b12..0000000 --- a/config/automatrop/roles/system/files/xorg/keyboard.conf +++ /dev/null @@ -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 diff --git a/config/automatrop/roles/system/files/xorg/touchpad.conf b/config/automatrop/roles/system/files/xorg/touchpad.conf deleted file mode 100644 index 4bd1a17..0000000 --- a/config/automatrop/roles/system/files/xorg/touchpad.conf +++ /dev/null @@ -1,6 +0,0 @@ -Section "InputClass" - Identifier "touchpad" - Driver "libinput" - MatchIsTouchpad "on" - Option "Tapping" "on" -EndSection diff --git a/config/automatrop/roles/system/handlers/main.yaml b/config/automatrop/roles/system/handlers/main.yaml deleted file mode 100644 index 45df77b..0000000 --- a/config/automatrop/roles/system/handlers/main.yaml +++ /dev/null @@ -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 diff --git a/config/automatrop/roles/system/tasks/main.yml b/config/automatrop/roles/system/tasks/main.yml deleted file mode 100644 index 01d8630..0000000 --- a/config/automatrop/roles/system/tasks/main.yml +++ /dev/null @@ -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= to GRUB_CMDLINE_LINUX_DEFAULT -# $ sudo grub-mkconfig -o /boot/grub/grub.cfg - -# TODO udevil diff --git a/config/automatrop/roles/system/templates/wpa_supplicant.conf.j2 b/config/automatrop/roles/system/templates/wpa_supplicant.conf.j2 deleted file mode 100644 index fde574b..0000000 --- a/config/automatrop/roles/system/templates/wpa_supplicant.conf.j2 +++ /dev/null @@ -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="" -} - -#} diff --git a/config/automatrop/roles/vim/handlers/main.yml b/config/automatrop/roles/vim/handlers/main.yml deleted file mode 100644 index de6b6f4..0000000 --- a/config/automatrop/roles/vim/handlers/main.yml +++ /dev/null @@ -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 diff --git a/config/automatrop/roles/vim/tasks/main.yml b/config/automatrop/roles/vim/tasks/main.yml deleted file mode 100644 index 5932cd0..0000000 --- a/config/automatrop/roles/vim/tasks/main.yml +++ /dev/null @@ -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 diff --git a/config/automatrop/roles/vim/templates/editor.j2 b/config/automatrop/roles/vim/templates/editor.j2 deleted file mode 100644 index 0b77445..0000000 --- a/config/automatrop/roles/vim/templates/editor.j2 +++ /dev/null @@ -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 -vmap - -nmap o -nmap :bp -nmap :bn -nmap kkkkkkkkkkkkkkkkkkkkk -nmap jjjjjjjjjjjjjjjjjjjjj - -" \s to replace globally the word under the cursor -nnoremap s :%s/\<\>/ - -" add extensions to syntax -au BufNewFile,BufRead *.jinja set filetype=jinja2 - -command Reload source $MYVIMRC diff --git a/config/automatrop/roles/vim/templates/init.vim.j2 b/config/automatrop/roles/vim/templates/init.vim.j2 deleted file mode 100644 index d123945..0000000 --- a/config/automatrop/roles/vim/templates/init.vim.j2 +++ /dev/null @@ -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' %} - diff --git a/config/automatrop/roles/vim/templates/loader.j2 b/config/automatrop/roles/vim/templates/loader.j2 deleted file mode 100644 index 0417ff5..0000000 --- a/config/automatrop/roles/vim/templates/loader.j2 +++ /dev/null @@ -1,6 +0,0 @@ -if has('nvim') - let $MYVIMRC="~/.config/nvim/init.vim" -else - let $MYVIMRC="~/.config/vim/init.vim" -endif -source $MYVIMRC diff --git a/config/automatrop/roles/vim/templates/pluginconfig.j2 b/config/automatrop/roles/vim/templates/pluginconfig.j2 deleted file mode 100644 index 1be4279..0000000 --- a/config/automatrop/roles/vim/templates/pluginconfig.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{% set plugins = namespace(sources=[]) %} -{% include 'pluginlist.j2' %} diff --git a/config/automatrop/roles/vim/templates/plugininstall.j2 b/config/automatrop/roles/vim/templates/plugininstall.j2 deleted file mode 100644 index 6747065..0000000 --- a/config/automatrop/roles/vim/templates/plugininstall.j2 +++ /dev/null @@ -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() diff --git a/config/automatrop/roles/vim/templates/pluginlist.j2 b/config/automatrop/roles/vim/templates/pluginlist.j2 deleted file mode 100644 index 3725f9f..0000000 --- a/config/automatrop/roles/vim/templates/pluginlist.j2 +++ /dev/null @@ -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 %} diff --git a/config/automatrop/roles/vim/templates/plugins/abolish.j2 b/config/automatrop/roles/vim/templates/plugins/abolish.j2 deleted file mode 100644 index 3a5f5d4..0000000 --- a/config/automatrop/roles/vim/templates/plugins/abolish.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Regex for words, with case in mind #} -{{ add_source('tpope/tpope-vim-abolish') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/airline.j2 b/config/automatrop/roles/vim/templates/plugins/airline.j2 deleted file mode 100644 index db93f55..0000000 --- a/config/automatrop/roles/vim/templates/plugins/airline.j2 +++ /dev/null @@ -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 = '⚠ ' diff --git a/config/automatrop/roles/vim/templates/plugins/ale.j2 b/config/automatrop/roles/vim/templates/plugins/ale.j2 deleted file mode 100644 index 99040cb..0000000 --- a/config/automatrop/roles/vim/templates/plugins/ale.j2 +++ /dev/null @@ -1,10 +0,0 @@ -" Asynchronous Lint Engine -" LSP client for vim and nvim -{{ add_source('dense-analysis/ale') }} - -nmap :ALEFix - -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'] diff --git a/config/automatrop/roles/vim/templates/plugins/ansible.j2 b/config/automatrop/roles/vim/templates/plugins/ansible.j2 deleted file mode 100644 index 0fb51fa..0000000 --- a/config/automatrop/roles/vim/templates/plugins/ansible.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Various for Ansible #} -{{ add_source('pearofducks/ansible-vim', { 'do': './UltiSnips/generate.sh'}) -}} diff --git a/config/automatrop/roles/vim/templates/plugins/asyncomplete.j2 b/config/automatrop/roles/vim/templates/plugins/asyncomplete.j2 deleted file mode 100644 index dcf0070..0000000 --- a/config/automatrop/roles/vim/templates/plugins/asyncomplete.j2 +++ /dev/null @@ -1,14 +0,0 @@ -{{ add_source('prabirshrestha/asyncomplete.vim') -}} -let g:asyncomplete_auto_popup = 1 -inoremap pumvisible() ? "\" : "\" -inoremap pumvisible() ? "\" : "\" -inoremap pumvisible() ? "\" : "\" -imap (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') - \ })) diff --git a/config/automatrop/roles/vim/templates/plugins/barbar.j2 b/config/automatrop/roles/vim/templates/plugins/barbar.j2 deleted file mode 100644 index ca9167e..0000000 --- a/config/automatrop/roles/vim/templates/plugins/barbar.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{{ add_source('romgrk/barbar.nvim') -}} - -" Move to previous/next -nmap :BufferPrevious -nmap :BufferNext -" Re-order to previous/next -nmap :BufferMovePrevious -nmap :BufferMoveNext -" Goto buffer in position... -nmap :BufferGoto 1 -nmap :BufferGoto 2 -nmap :BufferGoto 3 -nmap :BufferGoto 4 -nmap :BufferGoto 5 -nmap :BufferGoto 6 -nmap :BufferGoto 7 -nmap :BufferGoto 8 -nmap :BufferGoto 0 -nmap :BufferLast - -nmap gb :BufferPick diff --git a/config/automatrop/roles/vim/templates/plugins/base16.j2 b/config/automatrop/roles/vim/templates/plugins/base16.j2 deleted file mode 100644 index 54f96a1..0000000 --- a/config/automatrop/roles/vim/templates/plugins/base16.j2 +++ /dev/null @@ -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 %} - diff --git a/config/automatrop/roles/vim/templates/plugins/colorizer.j2 b/config/automatrop/roles/vim/templates/plugins/colorizer.j2 deleted file mode 100644 index 2ce1848..0000000 --- a/config/automatrop/roles/vim/templates/plugins/colorizer.j2 +++ /dev/null @@ -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 #} diff --git a/config/automatrop/roles/vim/templates/plugins/dap.j2 b/config/automatrop/roles/vim/templates/plugins/dap.j2 deleted file mode 100644 index 616b124..0000000 --- a/config/automatrop/roles/vim/templates/plugins/dap.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Debug Adapter Protocol client #} -{{ add_source('mfussenegger/nvim-dap') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/deoplete.j2 b/config/automatrop/roles/vim/templates/plugins/deoplete.j2 deleted file mode 100644 index 7219c8c..0000000 --- a/config/automatrop/roles/vim/templates/plugins/deoplete.j2 +++ /dev/null @@ -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 -\ pumvisible() ? "\" : -\ check_back_space() ? "\" : -\ 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, -\ }) diff --git a/config/automatrop/roles/vim/templates/plugins/devicons.j2 b/config/automatrop/roles/vim/templates/plugins/devicons.j2 deleted file mode 100644 index 7b5e65f..0000000 --- a/config/automatrop/roles/vim/templates/plugins/devicons.j2 +++ /dev/null @@ -1,5 +0,0 @@ -{% if variant == 'nvim' %} -{{ add_source('kyazdani42/nvim-web-devicons') -}} -{% else %} -{{ add_source('ryanoasis/vim-devicons') -}} -{% endif %} diff --git a/config/automatrop/roles/vim/templates/plugins/easy_align.j2 b/config/automatrop/roles/vim/templates/plugins/easy_align.j2 deleted file mode 100644 index c5fe06d..0000000 --- a/config/automatrop/roles/vim/templates/plugins/easy_align.j2 +++ /dev/null @@ -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 :EasyAlign* diff --git a/config/automatrop/roles/vim/templates/plugins/fugitive.j2 b/config/automatrop/roles/vim/templates/plugins/fugitive.j2 deleted file mode 100644 index 6abf2e7..0000000 --- a/config/automatrop/roles/vim/templates/plugins/fugitive.j2 +++ /dev/null @@ -1,4 +0,0 @@ -{# Git basics #} -{{ add_source('tpope/vim-fugitive') -}} -{# Open files in GitLab #} -{{ add_source('shumphrey/fugitive-gitlab.vim') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/fzf.j2 b/config/automatrop/roles/vim/templates/plugins/fzf.j2 deleted file mode 100644 index 08815c7..0000000 --- a/config/automatrop/roles/vim/templates/plugins/fzf.j2 +++ /dev/null @@ -1,36 +0,0 @@ -{# Fuzzy matching for all kind of stuff #} -{{ add_source('junegunn/fzf', {'do': './install --bin'}) }} -{{ add_source('junegunn/fzf.vim') -}} -let g:fzf_layout = { 'down': '~40%' } -let g:fzf_colors = -\ { 'fg': ['fg', 'Normal'], - \ 'bg': ['bg', 'Normal'], - \ 'hl': ['fg', 'Comment'], - \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], - \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], - \ 'hl+': ['fg', 'Statement'], - \ 'info': ['fg', 'PreProc'], - \ 'border': ['fg', 'Ignore'], - \ 'prompt': ['fg', 'Conditional'], - \ 'pointer': ['fg', 'Exception'], - \ 'marker': ['fg', 'Keyword'], - \ 'spinner': ['fg', 'Label'], - \ 'header': ['fg', 'Comment'] } - -let g:fzf_command_prefix = 'Fzf' -nmap gF :FzfFiles -nmap gf :FzfGFiles -nmap gb :FzfBuffers -nmap gL :FzfLines -nmap gl :FzfBLines -nmap gT :FzfTags -nmap gt :FzfBTags -nmap gm :FzfMarks -nmap gw :FzfWindows -nmap gh :FzfHistory -nmap gH :FzfHistory: -nmap gS :FzfHistory/ -nmap gs :FzfSnippets - -" TODO `gd` → go to tag matching selected word, or show a list with that -" of tags pre-filtered with that word diff --git a/config/automatrop/roles/vim/templates/plugins/gitgutter.j2 b/config/automatrop/roles/vim/templates/plugins/gitgutter.j2 deleted file mode 100644 index d6b4fad..0000000 --- a/config/automatrop/roles/vim/templates/plugins/gitgutter.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Show changed git lines in the gutter #} -{{ add_source('airblade/vim-gitgutter') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/gitsigns.j2 b/config/automatrop/roles/vim/templates/plugins/gitsigns.j2 deleted file mode 100644 index ca5608f..0000000 --- a/config/automatrop/roles/vim/templates/plugins/gitsigns.j2 +++ /dev/null @@ -1,7 +0,0 @@ -{# Show changed git lines in the gutter #} -{{ add_source('lewis6991/gitsigns.nvim') -}} -{# Dependency #} -{{ add_source('nvim-lua/plenary.nvim') -}} -lua << EOF -require('gitsigns').setup() -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/gutentags.j2 b/config/automatrop/roles/vim/templates/plugins/gutentags.j2 deleted file mode 100644 index 28dd01b..0000000 --- a/config/automatrop/roles/vim/templates/plugins/gutentags.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{# Generate tags #} -{{ add_source('ludovicchabant/vim-gutentags') -}} -let g:gutentags_cache_dir = expand('~/.cache/{{ variant }}/tags') diff --git a/config/automatrop/roles/vim/templates/plugins/indent-blankline.j2 b/config/automatrop/roles/vim/templates/plugins/indent-blankline.j2 deleted file mode 100644 index 138e4b1..0000000 --- a/config/automatrop/roles/vim/templates/plugins/indent-blankline.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{# Show ident lines #} -{{ add_source('lukas-reineke/indent-blankline.nvim') -}} -let g:indent_blankline_char_highlight_list = ['Error', 'Function'] diff --git a/config/automatrop/roles/vim/templates/plugins/languageclient.j2 b/config/automatrop/roles/vim/templates/plugins/languageclient.j2 deleted file mode 100644 index 6f319d9..0000000 --- a/config/automatrop/roles/vim/templates/plugins/languageclient.j2 +++ /dev/null @@ -1,20 +0,0 @@ -{{ add_source('autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh'}) -}} - -let g:LanguageClient_serverCommands = { - \ 'python': ['pyls'], - \ 'sh': ['bash-language-server', 'start'], - \ } -let g:LanguageClient_loggingFile = expand('~/.cache/{{ variant }}/LanguageClient.log') - -function LC_maps() - if has_key(g:LanguageClient_serverCommands, &filetype) - nnoremap K :call LanguageClient#textDocument_hover() - nnoremap gd :call LanguageClient#textDocument_definition() - nnoremap gD :call LanguageClient#textDocument_references() - nnoremap :call LanguageClient#textDocument_rename() - nnoremap :call LanguageClient#textDocument_formatting() - set completefunc=LanguageClient#complete - set omnifunc=LanguageClient#complete - endif -endfunction -autocmd FileType * call LC_maps() diff --git a/config/automatrop/roles/vim/templates/plugins/languagetool.j2 b/config/automatrop/roles/vim/templates/plugins/languagetool.j2 deleted file mode 100644 index a677f9a..0000000 --- a/config/automatrop/roles/vim/templates/plugins/languagetool.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{# Check grammar for human languages #} -{{ add_source('dpelle/vim-LanguageTool') -}} -let g:languagetool_jar = "/usr/share/java/languagetool/languagetool-commandline.jar" diff --git a/config/automatrop/roles/vim/templates/plugins/lightbulb.j2 b/config/automatrop/roles/vim/templates/plugins/lightbulb.j2 deleted file mode 100644 index 426fbd8..0000000 --- a/config/automatrop/roles/vim/templates/plugins/lightbulb.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{# Shows a lightbulb whenever a codeAction is available under the cursor #} -{{ add_source('kosayoda/nvim-lightbulb') -}} -autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb() diff --git a/config/automatrop/roles/vim/templates/plugins/lsp_signature.j2 b/config/automatrop/roles/vim/templates/plugins/lsp_signature.j2 deleted file mode 100644 index 918a056..0000000 --- a/config/automatrop/roles/vim/templates/plugins/lsp_signature.j2 +++ /dev/null @@ -1,8 +0,0 @@ -{# Show argument documentation when typing a function #} -{{ add_source('ray-x/lsp_signature.nvim') -}} - -lua << EOF -require'lsp_signature'.on_attach({ - hint_enable = false, -}) -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/lspkind.j2 b/config/automatrop/roles/vim/templates/plugins/lspkind.j2 deleted file mode 100644 index d81e404..0000000 --- a/config/automatrop/roles/vim/templates/plugins/lspkind.j2 +++ /dev/null @@ -1,6 +0,0 @@ -{# Add icons to LSP completions #} -{{ add_source('onsails/lspkind-nvim') -}} - -lua << EOF -require('lspkind').init() -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 b/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 deleted file mode 100644 index de7fb38..0000000 --- a/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 +++ /dev/null @@ -1,70 +0,0 @@ -{# LSP client for neovim ≥ 0.5 #} -{{ add_source('neovim/nvim-lspconfig') -}} -lua << EOF -local nvim_lsp = require('lspconfig') - --- Mappings. --- See `:help vim.diagnostic.*` for documentation on any of the below functions -local opts = { noremap=true, silent=true } -vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) -vim.keymap.set('n', '[e', vim.diagnostic.goto_prev, opts) -vim.keymap.set('n', ']e', vim.diagnostic.goto_next, opts) --- vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) - --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer -local on_attach = function(client, bufnr) - -- Enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - - -- Mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - local bufopts = { noremap=true, silent=true, buffer=bufnr } - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) --- vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) - vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) - vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) - vim.keymap.set('n', 'wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, bufopts) - vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) --- vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) --- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, bufopts) -end - --- Use a loop to conveniently call 'setup' on multiple servers and --- map buffer local keybindings when the language server attaches -local servers = { -{% if 'ansible' in dev_stuffs %} - "ansiblels", -{% endif %} -{% if 'nix' in dev_stuffs %} - "rnix", -{% endif %} -{% if 'perl' in dev_stuffs %} - "perlls", -{% endif %} -{% if 'python' in dev_stuffs %} - "pylsp", -{% endif %} -{% if 'php' in dev_stuffs %} - "phpactor", -- Install this one manually https://phpactor.readthedocs.io/en/master/usage/standalone.html#global-installation -{% endif %} -{% if 'sql' in dev_stuffs %} - "sqlls", -{% endif %} -} -for _, lsp in ipairs(servers) do - nvim_lsp[lsp].setup { - on_attach = on_attach, - flags = { - debounce_text_changes = 150, - } - } -end -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/pandoc.j2 b/config/automatrop/roles/vim/templates/plugins/pandoc.j2 deleted file mode 100644 index f2acc5d..0000000 --- a/config/automatrop/roles/vim/templates/plugins/pandoc.j2 +++ /dev/null @@ -1,6 +0,0 @@ -{# Pandoc specific stuff because there's no LSP for it #} -{{ add_source('vim-pandoc/vim-pandoc') -}} -{{ add_source('vim-pandoc/vim-pandoc-syntax') -}} -let g:pandoc#modules#disabled = ["folding"] -let g:pandoc#spell#enabled = 0 -let g:pandoc#syntax#conceal#use = 0 diff --git a/config/automatrop/roles/vim/templates/plugins/quick_scope.j2 b/config/automatrop/roles/vim/templates/plugins/quick_scope.j2 deleted file mode 100644 index 8e0692f..0000000 --- a/config/automatrop/roles/vim/templates/plugins/quick_scope.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Auto-highlight one character per word for quick f/F movement #} -{{ add_source('unblevable/quick-scope') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/registers.j2 b/config/automatrop/roles/vim/templates/plugins/registers.j2 deleted file mode 100644 index 04cf261..0000000 --- a/config/automatrop/roles/vim/templates/plugins/registers.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Show register content when pressing " #} -{{ add_source('tversteeg/registers.nvim') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/reload.j2 b/config/automatrop/roles/vim/templates/plugins/reload.j2 deleted file mode 100644 index 483001f..0000000 --- a/config/automatrop/roles/vim/templates/plugins/reload.j2 +++ /dev/null @@ -1,4 +0,0 @@ -{# Live reload #} -{{ add_source('famiu/nvim-reload') -}} -{{ add_source('nvim-lua/plenary.nvim') -}} -{# Not used, this breaks color, and source $MYVIMRC is all that we need to reload colorscheme #} diff --git a/config/automatrop/roles/vim/templates/plugins/scrollview.j2 b/config/automatrop/roles/vim/templates/plugins/scrollview.j2 deleted file mode 100644 index c443dd8..0000000 --- a/config/automatrop/roles/vim/templates/plugins/scrollview.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Customisable status line #} -{{ add_source('dstein64/nvim-scrollview') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/semshi.j2 b/config/automatrop/roles/vim/templates/plugins/semshi.j2 deleted file mode 100644 index 1a77fe0..0000000 --- a/config/automatrop/roles/vim/templates/plugins/semshi.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Semantic highlighting for Python for neovim #} -{{ add_source('numirias/semshi', {'do': ':UpdateRemotePlugins'}) -}} diff --git a/config/automatrop/roles/vim/templates/plugins/shade.j2 b/config/automatrop/roles/vim/templates/plugins/shade.j2 deleted file mode 100644 index 1cddf54..0000000 --- a/config/automatrop/roles/vim/templates/plugins/shade.j2 +++ /dev/null @@ -1,6 +0,0 @@ -{# Dim inactive windows #} -{# Not working very well, at least with undotree #} -{{add_source('sunjon/shade.nvim')-}} -lua << EOF -require'shade'.setup() -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/shot_f.j2 b/config/automatrop/roles/vim/templates/plugins/shot_f.j2 deleted file mode 100644 index 20808d2..0000000 --- a/config/automatrop/roles/vim/templates/plugins/shot_f.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# When in f/F/t/T mode, highlight in red the characters that can be jumped to #} -{{ add_source('deris/vim-shot-f') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/smooth_scroll.j2 b/config/automatrop/roles/vim/templates/plugins/smooth_scroll.j2 deleted file mode 100644 index 36d9752..0000000 --- a/config/automatrop/roles/vim/templates/plugins/smooth_scroll.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Smoooooth scrolling #} -{{ add_source('terryma/vim-smooth-scroll') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/specs.j2 b/config/automatrop/roles/vim/templates/plugins/specs.j2 deleted file mode 100644 index 5eb5504..0000000 --- a/config/automatrop/roles/vim/templates/plugins/specs.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{# Flashes under the cursor when moving far #} -{{ add_source('edluffy/specs.nvim') -}} -lua << EOF -require('specs').setup{ - show_jumps = true, - min_jump = 5, - popup = { - delay_ms = 0, -- delay before popup displays - inc_ms = 10, -- time increments used for fade/resize effects - blend = 10, -- starting blend, between 0-100 (fully transparent), see :h winblend - width = 10, - winhl = "PMenu", - fader = require('specs').pulse_fader, - resizer = require('specs').shrink_resizer - }, - ignore_filetypes = {}, - ignore_buftypes = { - nofile = true, - }, -} -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/supertab.j2 b/config/automatrop/roles/vim/templates/plugins/supertab.j2 deleted file mode 100644 index 8b3abb6..0000000 --- a/config/automatrop/roles/vim/templates/plugins/supertab.j2 +++ /dev/null @@ -1,7 +0,0 @@ -{# Use TAB for autocompletion #} -{{ add_source('ervandew/supertab') -}} -let g:SuperTabLongestEnhanced = 1 -let g:SuperTabLongestHighlight = 1 -{# TODO longest doesn't work, even when longest is set in completeopt #} -let g:SuperTabDefaultCompletionType = "" " Go down when completing -let g:SuperTabContextDefaultCompletionType = "" diff --git a/config/automatrop/roles/vim/templates/plugins/surround.j2 b/config/automatrop/roles/vim/templates/plugins/surround.j2 deleted file mode 100644 index d4dfb9a..0000000 --- a/config/automatrop/roles/vim/templates/plugins/surround.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Change surroundings pairs (e.g. brackets, quotes… #} -{{ add_source('tpope/vim-surround') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/targets.j2 b/config/automatrop/roles/vim/templates/plugins/targets.j2 deleted file mode 100644 index b9a7de7..0000000 --- a/config/automatrop/roles/vim/templates/plugins/targets.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Better interaction with surrounding pairs #} -{{ add_source('wellle/targets.vim') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/tcomment.j2 b/config/automatrop/roles/vim/templates/plugins/tcomment.j2 deleted file mode 100644 index 0539d77..0000000 --- a/config/automatrop/roles/vim/templates/plugins/tcomment.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Language-aware (un)commenting #} -{{ add_source('tomtom/tcomment_vim') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/telescope.j2 b/config/automatrop/roles/vim/templates/plugins/telescope.j2 deleted file mode 100644 index c8424ca..0000000 --- a/config/automatrop/roles/vim/templates/plugins/telescope.j2 +++ /dev/null @@ -1,52 +0,0 @@ -{{ add_source('nvim-telescope/telescope.nvim') -}} -{# Dependencies #} -{{ add_source('nvim-lua/popup.nvim') -}} -{{ add_source('nvim-lua/plenary.nvim') -}} -{# Extensions #} -{{ add_source('nvim-telescope/telescope-fzf-native.nvim', {'do': 'make'}) -}} - -noremap gF Telescope find_files -noremap gf Telescope git_files -noremap gB Telescope buffers -noremap gl Telescope current_buffer_fuzzy_find -noremap gL Telescope live_grep -noremap gT Telescope tags -noremap gt Telescope treesitter -noremap gm Telescope marks -noremap gh Telescope oldfiles -noremap gH Telescope command_history -noremap gS Telescope search_history -noremap gC Telescope commands -noremap gr Telescope lsp_references -noremap ga Telescope lsp_code_actions -vnoremap ga Telescope lsp_range_code_actions -noremap ge Telescope lsp_document_diagnostics -noremap gE Telescope lsp_workspace_diagnostics -noremap gd Telescope lsp_definitions -noremap gs Telescope lsp_document_symbols - -lua << EOF -require('telescope').setup{ - defaults = { - vimgrep_arguments = { - 'rg', - '--color=never', - '--no-heading', - '--with-filename', - '--line-number', - '--column', - '--smart-case' - }, - }, - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - -- the default case_mode is "smart_case" - } - } -} -require('telescope').load_extension('fzf') -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/treesitter.j2 b/config/automatrop/roles/vim/templates/plugins/treesitter.j2 deleted file mode 100644 index 0bfeba3..0000000 --- a/config/automatrop/roles/vim/templates/plugins/treesitter.j2 +++ /dev/null @@ -1,66 +0,0 @@ -{# Allow for better syntax highlighting. Bit experimental #} -{{ add_source('nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}) -}} -{# To check if it's really working -{{ add_source('nvim-treesitter/playground') -}} -#} -lua <u :UndotreeToggle diff --git a/config/automatrop/roles/vim/templates/plugins/vebugger.j2 b/config/automatrop/roles/vim/templates/plugins/vebugger.j2 deleted file mode 100644 index 013a066..0000000 --- a/config/automatrop/roles/vim/templates/plugins/vebugger.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Debug from the editor #} -{{ add_source('idanarye/vim-vebugger') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/vim_lsp.j2 b/config/automatrop/roles/vim/templates/plugins/vim_lsp.j2 deleted file mode 100644 index dfd0d2e..0000000 --- a/config/automatrop/roles/vim/templates/plugins/vim_lsp.j2 +++ /dev/null @@ -1,39 +0,0 @@ -{# LSP client for Vim8 and neovim #} -{{ add_source('prabirshrestha/vim-lsp') -}} -{{ add_source('mattn/vim-lsp-settings') -}} -" (providers are automatically detected thanks to vim-lsp-settings. -" You can even install some locally using :LspInstallServer) - -let g:lsp_signs_enabled = 1 -let g:lsp_diagnostics_echo_cursor = 1 - -let g:lsp_signs_error = {'text': '✗'} -let g:lsp_signs_warning = {'text': '‼'} -let g:lsp_signs_information = {'text': 'ℹ'} -let g:lsp_signs_hint = {'text': '?'} - -let g:lsp_highlight_references_enabled = 1 - -function! s:on_lsp_buffer_enabled() abort - setlocal omnifunc=lsp#complete - setlocal signcolumn=yes - if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif - nmap gd (lsp-definition) - nmap gD (lsp-declaration) - nmap gr (lsp-references) - nmap gi (lsp-implementation) - nmap rn (lsp-rename) - nmap [d (lsp-previous-diagnostic) - nmap ]d (lsp-next-diagnostic) - nmap K (lsp-hover) - nmap f (lsp-document-format) - vmap f (lsp-document-range-format) - inoremap lsp#scroll(+4) - inoremap lsp#scroll(-4) -endfunction - -augroup lsp_install - au! - " call s:on_lsp_buffer_enabled only for languages that has the server registered. - autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() -augroup END diff --git a/config/automatrop/roles/vim/templates/plugins/vista.j2 b/config/automatrop/roles/vim/templates/plugins/vista.j2 deleted file mode 100644 index 20cc836..0000000 --- a/config/automatrop/roles/vim/templates/plugins/vista.j2 +++ /dev/null @@ -1,12 +0,0 @@ -{# Tag bar #} -{{ add_source('liuchengxu/vista.vim') -}} -nmap s :Vista!! -let g:vista_icon_indent = ["▸ ", ""] - -let g:vista#renderer#enable_icon = 1 - -" The default icons can't be suitable for all the filetypes, you can extend it as you wish. -let g:vista#renderer#icons = { -\ "function": "f", -\ "variable": "x", -\ } diff --git a/config/automatrop/roles/vim/templates/plugins/vsnip.j2 b/config/automatrop/roles/vim/templates/plugins/vsnip.j2 deleted file mode 100644 index 2c710ca..0000000 --- a/config/automatrop/roles/vim/templates/plugins/vsnip.j2 +++ /dev/null @@ -1,4 +0,0 @@ -{{ add_source('hrsh7th/vim-vsnip') -}} -{{ add_source('hrsh7th/vim-vsnip-integ') -}} -{{ add_source('rafamadriz/friendly-snippets') -}} -{# TODO Ansible snippets? #} diff --git a/config/automatrop/roles/vim/templates/theme.j2 b/config/automatrop/roles/vim/templates/theme.j2 deleted file mode 100644 index 8300fcc..0000000 --- a/config/automatrop/roles/vim/templates/theme.j2 +++ /dev/null @@ -1 +0,0 @@ -colorscheme base16-{{ base16_scheme }} diff --git a/config/ccache.conf b/config/ccache.conf deleted file mode 100644 index ec8132c..0000000 --- a/config/ccache.conf +++ /dev/null @@ -1 +0,0 @@ -ccache_dir = $HOME/.cache/ccache diff --git a/config/dunst/.gitignore b/config/dunst/.gitignore deleted file mode 100644 index 93fb535..0000000 --- a/config/dunst/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -dunstrc -theme diff --git a/config/dunst/dunstrc.j2 b/config/dunst/dunstrc.j2 deleted file mode 100644 index 2fb355e..0000000 --- a/config/dunst/dunstrc.j2 +++ /dev/null @@ -1,65 +0,0 @@ -[global] - alignment = left - always_run_script = true - browser = /usr/bin/qutebrowser - class = Dunst - dmenu = /usr/bin/dmenu -p dunst: - ellipsize = middle - follow = none - font = DejaVu Sans 10 - force_xinerama = false - format = "%s %p\n%b" - frame_color = "#A6E22E" - frame_width = 3 - geometry = "500x5-30+20" - hide_duplicate_count = false - history_length = 20 - horizontal_padding = 8 - icon_path = /usr/share/icons/gnome/256x256/actions/:/usr/share/icons/gnome/256x256/status/:/usr/share/icons/gnome/256x256/devices/ - icon_position = left - idle_threshold = 120 - ignore_newline = no - indicate_hidden = yes - line_height = 0 - markup = full - max_icon_size = 48 - monitor = 0 - notification_height = 0 - padding = 8 - separator_color = frame - separator_height = 2 - show_age_threshold = 60 - show_indicators = yes - shrink = no - sort = yes - stack_duplicates = true - startup_notification = false - sticky_history = yes - title = Dunst - transparency = 0 - verbosity = mesg - word_wrap = yes -[experimental] - per_monitor_dpi = false -[shortcuts] - close_all = ctrl+mod4+n - close = mod4+n - context = mod1+mod4+n - history = shift+mod4+n -[urgency_low] - background = "#272822" - foreground = "#F8F8F2" - frame_color = "#A6E22E" - timeout = 10 -[urgency_normal] - background = "#272822" - foreground = "#F8F8F2" - frame_color = "#F4BF75" - timeout = 10 -[urgency_critical] - background = "#272822" - foreground = "#F8F8F2" - frame_color = "#F92672" - timeout = 0 -{{ base16_schemes['schemes'][base16_scheme]['dunst']['themes']['base16-' + base16_scheme + '.dunstrc'] }} -# TODO Not used. Not sure how it's supposed to be used :D diff --git a/config/flake8 b/config/flake8 deleted file mode 100644 index b66470c..0000000 --- a/config/flake8 +++ /dev/null @@ -1,3 +0,0 @@ -[flake8] -# Compatibility with Black -max-line-length = 88 diff --git a/config/gdbinit b/config/gdbinit deleted file mode 100644 index 9569b3d..0000000 --- a/config/gdbinit +++ /dev/null @@ -1,3 +0,0 @@ -define hook-quit - set confirm off -end diff --git a/config/git/.gitignore b/config/git/.gitignore deleted file mode 100644 index f5fff02..0000000 --- a/config/git/.gitignore +++ /dev/null @@ -1 +0,0 @@ -gitk diff --git a/config/git/config b/config/git/config deleted file mode 100644 index 436af10..0000000 --- a/config/git/config +++ /dev/null @@ -1,24 +0,0 @@ -[user] - name = Geoffrey “Frogeye” Preud'homme - email = geoffrey@frogeye.fr - signingkey = 0x8312C8CAC1BAC289 -[core] - editor = nvim - excludesfile = ~/.config/git/gitignore -[push] - default = matching -[alias] - git = !exec git -[filter "lfs"] - clean = git-lfs clean -- %f - smudge = git-lfs smudge -- %f - process = git-lfs filter-process - required = true -[pull] - ff = only -[diff] - tool = meld -[difftool] - prompt = false -[difftool "meld"] - cmd = meld "$LOCAL" "$REMOTE" diff --git a/config/git/gitignore b/config/git/gitignore deleted file mode 100644 index 97ef313..0000000 --- a/config/git/gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.swp -*.swo -*.ycm_extra_conf.py -tags -.mypy_cache diff --git a/config/gtk-3.0/.gitignore b/config/gtk-3.0/.gitignore deleted file mode 100644 index 7e1f6a7..0000000 --- a/config/gtk-3.0/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bookmarks diff --git a/config/gtk-3.0/settings.ini b/config/gtk-3.0/settings.ini deleted file mode 100644 index 8d29faa..0000000 --- a/config/gtk-3.0/settings.ini +++ /dev/null @@ -1,16 +0,0 @@ -[Settings] -gtk-theme-name=Greenbird -gtk-icon-theme-name=Faenza-Green -gtk-font-name=Sans 10 -gtk-cursor-theme-size=0 -gtk-toolbar-style=GTK_TOOLBAR_BOTH -gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR -gtk-button-images=1 -gtk-menu-images=1 -gtk-enable-event-sounds=1 -gtk-enable-input-feedback-sounds=1 -gtk-xft-antialias=1 -gtk-xft-hinting=1 -gtk-xft-hintstyle=hintslight -gtk-xft-rgba=rgb -gtk-cursor-theme-name=Menda-Cursor diff --git a/config/i3/.gitignore b/config/i3/.gitignore deleted file mode 100644 index d981efa..0000000 --- a/config/i3/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -config -theme diff --git a/config/i3/autorandrdefaultmenu b/config/i3/autorandrdefaultmenu deleted file mode 100755 index d2f2d25..0000000 --- a/config/i3/autorandrdefaultmenu +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -shopt -s nullglob globstar - -profile=$(echo -e "$(autorandr 2>&1 | cut -d' ' -f1)" | rofi -dmenu -p "Default profile" "$@") - -[[ -n $profile ]] || exit - -autorandr --default "$profile" - diff --git a/config/i3/autorandrloadmenu b/config/i3/autorandrloadmenu deleted file mode 100755 index 14c5a13..0000000 --- a/config/i3/autorandrloadmenu +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -shopt -s nullglob globstar - -profile=$(echo -e "common\nclone-largest\nhorizontal\nvertical\n$(autorandr 2>&1 | cut -d' ' -f1)" | rofi -dmenu -p "Load profile" "$@") - -[[ -n $profile ]] || exit - -autorandr --load "$profile" - diff --git a/config/i3/autorandrremovemenu b/config/i3/autorandrremovemenu deleted file mode 100755 index 323d72c..0000000 --- a/config/i3/autorandrremovemenu +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -shopt -s nullglob globstar - -profile=$(echo -e "$(autorandr 2>&1 | cut -d' ' -f1)" | rofi -dmenu -p "Remove profile" "$@") - -[[ -n $profile ]] || exit - -autorandr --remove "$profile" - diff --git a/config/i3/autorandrsavemenu b/config/i3/autorandrsavemenu deleted file mode 100755 index e24db48..0000000 --- a/config/i3/autorandrsavemenu +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -shopt -s nullglob globstar - -profile=$(echo -e "$(autorandr 2>&1 | cut -d' ' -f1)" | rofi -dmenu -p "Save profile" "$@") - -[[ -n $profile ]] || exit - -autorandr --save "$profile" - diff --git a/config/i3/config.j2 b/config/i3/config.j2 deleted file mode 100644 index 045126a..0000000 --- a/config/i3/config.j2 +++ /dev/null @@ -1,402 +0,0 @@ -# vi:syntax=conf -# i3 config file (v4) -# Please see http://i3wm.org/docs/userguide.html for a complete reference! - -# Set mod key (Mod1=, Mod4=) -set $mod Mod4 - -# set default desktop layout (default is tiling) -# workspace_layout tabbed - -# Configure border style -new_window pixel 2 -new_float normal - -# Hide borders -hide_edge_borders both - -# change borders -#bindsym $mod+u border none -#bindsym $mod+y border pixel 2 -#bindsym $mod+n border normal - -# Compatibility layer for people coming from other backgrounds -bindsym Mod1+Tab exec --no-startup-id rofi -modi window -show window -bindsym Mod1+F2 exec --no-startup-id rofi -modi drun -show drun -bindsym Mod1+F4 kill - -# Font for window titles. Will also be used by the bar unless a different font -# is used in the bar {} block below. - -font pango:DejaVu Sans 8 -font pango:Sans 8 - -# Use Mouse+$mod to drag floating windows -floating_modifier $mod - -# kill focused window -bindsym $mod+z kill -bindsym button2 kill - -bindsym $mod+c exec --no-startup-id rofi-pass --last-used -bindsym $mod+i exec --no-startup-id rofimoji -bindsym $mod+plus exec --no-startup-id rofi -modi ssh -show ssh -bindsym $mod+ù exec --no-startup-id rofi -modi ssh -show ssh -ssh-command '{terminal} -e {ssh-client} {host} -t "sudo -s -E"' -bindsym $mod+Tab exec --no-startup-id rofi -modi window -show window - -# start program launcher -bindsym $mod+d exec --no-startup-id rofi -modi run -show run -bindsym $mod+Shift+d exec --no-startup-id rofi -modi drun -show drun - -# Start Applications -# bindsym $mod+Return exec urxvtc -bindsym $mod+Return exec ~/.config/i3/terminal -bindsym $mod+Shift+Return exec urxvt -bindsym $mod+p exec thunar -bindsym $mod+m exec qutebrowser --override-restore --backend=webengine -# bindsym $mod+m exec firefox - -# Volume control -bindsym XF86AudioRaiseVolume exec pactl set-sink-mute @DEFAULT_SINK@ false; exec pactl set-sink-volume @DEFAULT_SINK@ +5% -bindsym XF86AudioLowerVolume exec pactl set-sink-mute @DEFAULT_SINK@ false; exec pactl set-sink-volume @DEFAULT_SINK@ -5% -bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ true -bindsym $mod+F7 exec pactl suspend-sink @DEFAULT_SINK@ 1; exec pactl suspend-sink @DEFAULT_SINK@ 0 -# Re-synchronize bluetooth headset -bindsym XF86AudioPrev exec mpc prev -bindsym XF86AudioPlay exec mpc toggle -bindsym XF86AudioNext exec mpc next -bindsym $mod+F10 exec ~/.config/scripts/showKeyboardLayout -bindsym $mod+F11 exec xterm -e 'pacmixer' -bindsym $mod+F12 exec xterm -e 'pacmixer' - -#Brightness control -bindsym XF86MonBrightnessDown exec xbacklight -dec 5 -time 0 -bindsym XF86MonBrightnessUp exec xbacklight -inc 5 -time 0 - -# Screenshots -bindsym Print exec scrot --focused --exec 'mv $f ~/Screenshots/ && optipng ~/Screenshots/$f' -bindsym $mod+Print exec scrot --exec 'mv $f ~/Screenshots/ && optipng ~/Screenshots/$f' -bindsym Ctrl+Print exec sleep 1 && scrot --select --exec 'mv $f ~/Screenshots/ && optipng ~/Screenshots/$f' - -focus_follows_mouse no -mouse_warping output - -# change focus -bindsym $mod+h focus left; exec ~/.config/i3/focus_windows -bindsym $mod+j focus down; exec ~/.config/i3/focus_windows -bindsym $mod+k focus up; exec ~/.config/i3/focus_windows -bindsym $mod+l focus right; exec ~/.config/i3/focus_windows - -## alternatively, you can use the cursor keys: -#bindsym $mod+Left focus left -#bindsym $mod+Down focus down -#bindsym $mod+Up focus up -#bindsym $mod+Right focus right - -# move focused window -bindsym $mod+Shift+h move left; exec ~/.config/i3/focus_windows -bindsym $mod+Shift+j move down; exec ~/.config/i3/focus_windows -bindsym $mod+Shift+k move up; exec ~/.config/i3/focus_windows -bindsym $mod+Shift+l move right; exec ~/.config/i3/focus_windows - -## alternatively, you can use the cursor keys: -#bindsym $mod+Shift+Left move left -#bindsym $mod+Shift+Down move down -#bindsym $mod+Shift+Up move up -#bindsym $mod+Shift+Right move right - -# workspace back and forth (with/without active container) -workspace_auto_back_and_forth no -bindsym $mod+b workspace back_and_forth; exec ~/.config/i3/focus_windows -bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth; exec ~/.config/i3/focus_windows - -# split in horizontal orientation -bindsym $mod+g split h; exec ~/.config/i3/focus_windows - -# split in vertical orientation -bindsym $mod+v split v; exec ~/.config/i3/focus_windows - -# toggle fullscreen mode for the focused container -bindsym $mod+f fullscreen toggle; exec ~/.config/i3/focus_windows - -# change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking; exec ~/.config/i3/focus_windows -bindsym $mod+w layout tabbed; exec ~/.config/i3/focus_windows -bindsym $mod+e layout toggle split; exec ~/.config/i3/focus_windows - -# toggle tiling / floating -bindsym $mod+Shift+space floating toggle; exec ~/.config/i3/focus_windows - -# change focus between tiling / floating windows -bindsym $mod+space focus mode_toggle; exec ~/.config/i3/focus_windows - -# focus the parent container -bindsym $mod+a focus parent; exec ~/.config/i3/focus_windows - -# focus the child container -bindsym $mod+q focus child; exec ~/.config/i3/focus_windows - -# Workspace names -set $WS1 1 -set $WS2 2 -set $WS3 3 -set $WS4 4 -set $WS5 5 -set $WS6 6 -set $WS7 7 -set $WS8 8 -set $WS9 9 -set $WS10 10 - -# Workspace output -{% set screens = x11_screens | default(['DEFAULT']) %} -{% for i in range(1, 11) %} -workspace "$WS{{ i }}" output {{ screens[(i - 1) % (screens | length)] }} -{% endfor %} - -# switch to workspace -bindsym $mod+1 workspace $WS1; exec ~/.config/i3/focus_windows -bindsym $mod+2 workspace $WS2; exec ~/.config/i3/focus_windows -bindsym $mod+3 workspace $WS3; exec ~/.config/i3/focus_windows -bindsym $mod+4 workspace $WS4; exec ~/.config/i3/focus_windows -bindsym $mod+5 workspace $WS5; exec ~/.config/i3/focus_windows -bindsym $mod+6 workspace $WS6; exec ~/.config/i3/focus_windows -bindsym $mod+7 workspace $WS7; exec ~/.config/i3/focus_windows -bindsym $mod+8 workspace $WS8; exec ~/.config/i3/focus_windows -bindsym $mod+9 workspace $WS9; exec ~/.config/i3/focus_windows -bindsym $mod+0 workspace $WS10; exec ~/.config/i3/focus_windows - -#navigate workspaces next / previous -bindsym $mod+Ctrl+h workspace prev_on_output; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+l workspace next_on_output; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+j workspace prev; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+k workspace next; exec ~/.config/i3/focus_windows - -##navigate workspaces next / previous (arrow keys) -#bindsym $mod+Ctrl+Left workspace prev_on_output -#bindsym $mod+Ctrl+Right workspace next_on_output -#bindsym $mod+Ctrl+Down workspace prev -#bindsym $mod+Ctrl+Up workspace next - -# Move to workspace next / previous with focused container -bindsym $mod+Ctrl+Shift+h move container to workspace prev_on_output; workspace prev_on_output; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+Shift+l move container to workspace next_on_output; workspace next_on_output; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+Shift+j move container to workspace prev; workspace prev; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+Shift+k move container to workspace next; workspace next; exec ~/.config/i3/focus_windows - -## Move to workspace next / previous with focused container (arrow keys) -#bindsym $mod+Ctrl+Shift+Left move container to workspace prev_on_output; workspace prev_on_output -#bindsym $mod+Ctrl+Shift+Right move container to workspace next_on_output; workspace next_on_output -#bindsym $mod+Ctrl+Shift+Down move container to workspace prev; workspace prev -#bindsym $mod+Ctrl+Shift+Up move container to workspace next; workspace next - -# move focused container to workspace -bindsym $mod+ctrl+1 move container to workspace $ws1; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+2 move container to workspace $ws2; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+3 move container to workspace $ws3; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+4 move container to workspace $ws4; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+5 move container to workspace $ws5; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+6 move container to workspace $ws6; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+7 move container to workspace $ws7; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+8 move container to workspace $ws8; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+9 move container to workspace $ws9; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+0 move container to workspace $ws10; exec ~/.config/i3/focus_windows - -# move to workspace with focused container -bindsym $mod+shift+1 move container to workspace $ws1; workspace $ws1; exec ~/.config/i3/focus_windows -bindsym $mod+shift+2 move container to workspace $ws2; workspace $ws2; exec ~/.config/i3/focus_windows -bindsym $mod+shift+3 move container to workspace $ws3; workspace $ws3; exec ~/.config/i3/focus_windows -bindsym $mod+shift+4 move container to workspace $ws4; workspace $ws4; exec ~/.config/i3/focus_windows -bindsym $mod+shift+5 move container to workspace $ws5; workspace $ws5; exec ~/.config/i3/focus_windows -bindsym $mod+shift+6 move container to workspace $ws6; workspace $ws6; exec ~/.config/i3/focus_windows -bindsym $mod+shift+7 move container to workspace $ws7; workspace $ws7; exec ~/.config/i3/focus_windows -bindsym $mod+shift+8 move container to workspace $ws8; workspace $ws8; exec ~/.config/i3/focus_windows -bindsym $mod+shift+9 move container to workspace $ws9; workspace $ws9; exec ~/.config/i3/focus_windows -bindsym $mod+shift+0 move container to workspace $ws10; workspace $ws10; exec ~/.config/i3/focus_windows - -## move workspaces to screen -#bindsym $mod+ctrl+shift+r move workspace to output right -#bindsym $mod+ctrl+shift+l move workspace to output left -#bindsym $mod+Ctrl+Shift+u move workspace to output above -#bindsym $mod+Ctrl+Shift+d move workspace to output below - -# move workspaces to screen (arrow keys) -bindsym $mod+ctrl+shift+Right move workspace to output right; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+shift+Left move workspace to output left; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+Shift+Up move workspace to output above; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+Shift+Down move workspace to output below; exec ~/.config/i3/focus_windows - -# Default layout = tabs, since I mostly exclusively use them -workspace_layout tabbed - -# Open specific applications in floating mode -for_window [title="pacmixer"] floating enable border pixel 2 -for_window [class="Firefox"] layout tabbed # Doesn't seem to work anymore -for_window [class="qutebrowser"] layout tabbed - -for_window [window_role="pop-up"] floating enable -for_window [window_role="task_dialog"] floating enable -for_window [ title="^pdfpc.*" window_role="presenter" ] move to output left, fullscreen -for_window [ title="^pdfpc.*" window_role="presentation" ] move to output right, fullscreen - -# switch to workspace with urgent window automatically -for_window [urgent=latest] focus - -# focus urgent window -#bindsym $mod+x [urgent=latest] focus - -# reload the configuration file -bindsym $mod+Shift+c reload - -# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -bindsym $mod+Shift+r restart - -# exit i3 (logs you out of your X session) -bindsym $mod+Shift+e exit - -# Set shut down, restart and locking features -set $mode_kblock Keyboard lock -mode "$mode_kblock" { - bindsym $mod+Shift+Escape mode "$mode_kblock" -} -bindsym $mod+Shift+Escape mode "$mode_kblock" - -# Set shut down, restart and locking features -set $locker $HOME/.config/i3/lock -set $mode_system [L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction -mode "$mode_system" { - bindsym l exec --no-startup-id $locker, mode "default" - bindsym e exit, mode "default" - bindsym s exec --no-startup-id $locker & systemctl suspend --check-inhibitors=no, mode "default" - bindsym h exec --no-startup-id $locker & systemctl hibernate, mode "default" - bindsym r exec --no-startup-id systemctl reboot, mode "default" - bindsym p exec --no-startup-id systemctl poweroff -i, mode "default" - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} -bindsym $mod+Escape mode "$mode_system" - -# resize window (you can also use the mouse for that) -mode "Resize" { - # These bindings trigger as soon as you enter the resize mode - - # Pressing left will shrink the window’s width. - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s height. - bindsym h resize shrink width 10 px or 10 ppt; exec ~/.config/i3/focus_windows - bindsym j resize grow height 10 px or 10 ppt; exec ~/.config/i3/focus_windows - bindsym k resize shrink height 10 px or 10 ppt; exec ~/.config/i3/focus_windows - bindsym l resize grow width 10 px or 10 ppt; exec ~/.config/i3/focus_windows - - ## same bindings, but for the arrow keys - #bindsym Left resize shrink width 10 px or 10 ppt - #bindsym Down resize grow height 10 px or 10 ppt - #bindsym Up resize shrink height 10 px or 10 ppt - #bindsym Right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} - -bindsym $mod+r mode "Resize" - -set $mode_pres_main "Presentation (main display)" -mode $mode_pres_main { - bindsym b workspace $WS3, workspace $WS4, mode $mode_pres_sec - - # back to normal: Enter or Escape - bindsym q mode "default" - # bindsym Escape mode "default" - bindsym Return mode "default" -} -set $mode_pres_sec "Presentation (secondary display)" -mode $mode_pres_sec { - bindsym b workspace $WS2, workspace $WS1, mode $mode_pres_main - - # back to normal: Enter or Escape - bindsym q mode "default" - # bindsym Escape mode "default" - bindsym Return mode "default" -} - -bindsym $mod+Shift+p mode $mode_pres_main - -set $mode_screen Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default -bindsym $mod+t mode "$mode_screen" -mode "$mode_screen" { - bindsym a exec autorandr --change --force, mode "default" - bindsym l exec ~/.config/i3/autorandrloadmenu, mode "default" - bindsym s exec ~/.config/i3/autorandrsavemenu, mode "default" - bindsym r exec ~/.config/i3/autorandrremovemenu, mode "default" - bindsym d exec ~/.config/i3/autorandrdefaultmenu, mode "default" - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} - -# Screen temperature ("redness") setting -bindsym $mod+y mode "$mode_temp" -set $mode_temp Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue -mode "$mode_temp" { - bindsym r exec sct 1000 - bindsym d exec sct 2000 - bindsym c exec sct 4500 - bindsym o exec sct - bindsym a exec sct 8000 - bindsym b exec sct 10000 - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} - - -# Inactivity settings -exec --no-startup-id xautolock -time 10 -locker 'xset dpms force standby' -killtime 1 -killer '$locker' -bindsym $mod+F1 exec --no-startup-id sh -c "sleep .25 && xset dpms force off" -bindsym $mod+F4 exec --no-startup-id xautolock -disable -bindsym $mod+F5 exec --no-startup-id xautolock -enable - - -# Autostart applications -#exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 # Password remembering -#exec --no-startup-id gnome-keyring-daemon # Password remembering -# exec --no-startup-id urxvtd -q -f # urxvt daemon -{% if auto_numlock %} -exec --no-startup-id numlockx on # Activate Num lock -{% endif %} -exec --no-startup-id unclutter -root # Hide mouse cursor after some time -#exec --no-startup-id dunst # Notifications (handled by systemd) -exec --no-startup-id keynav # Keyboard cursor controller -#exec --no-startup-id mpd # Music Player Daemon (handled by systemd) -exec --no-startup-id autorandr --change --force # Screen configuration and everything that depends on it -{% if has_battery %} -exec --no-startup-id ~/.config/i3/batteryNotify -d # Battery state notification -{% endif %} - - -{{ base16_schemes['schemes'][base16_scheme]['i3']['colors']['base16-' + base16_scheme + '.config'] }} -set $ignore #ff00ff - -# Basic color configuration using the Base16 variables for windows and borders. -# Property Name Border BG Text Indicator Child Border -client.focused $base0B $base0B $base00 $base00 $base0B -client.focused_inactive $base02 $base02 $base05 $base02 $base02 -client.unfocused $base05 $base04 $base00 $base04 $base00 -client.urgent $base0F $base08 $base00 $base08 $base0F -client.placeholder $ignore $base00 $base05 $ignore $base00 -client.background $base07 - -# I set the color of the active tab as the the background color -# of the terminal so they merge together. This is the opposite -# of what I used before: unfocused color was the terminal -# background color. Either I get used to it, or I should revert. - -# bar { -# i3bar_command ~/.config/lemonbar/bar.py -# } diff --git a/config/i3/focus_windows b/config/i3/focus_windows deleted file mode 100755 index bd06f3a..0000000 --- a/config/i3/focus_windows +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -XDT=/usr/bin/xdotool - -WINDOW=`$XDT getwindowfocus` - -# this brings in variables WIDTH and HEIGHT -eval `xdotool getwindowgeometry --shell $WINDOW` - -TX=`expr $WIDTH / 2` -TY=`expr $HEIGHT / 2` - -$XDT mousemove -window $WINDOW $TX $TY diff --git a/config/i3/lock b/config/i3/lock deleted file mode 100755 index 5ca0609..0000000 --- a/config/i3/lock +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -# Remove SSH and GPG keys from keystores -ssh-add -D -echo RELOADAGENT | gpg-connect-agent -rm -rf "/tmp/cached_pass_$UID" - - -dm-tool lock -if [ $? -ne 0 ]; then - if [ -d ~/.cache/lockpatterns ] - then - pattern=$(find ~/.cache/lockpatterns/ | sort -R | head -1) - else - pattern=$HOME/.config/i3/lock.png - fi - revert() { - xset dpms 0 0 0 - } - trap revert SIGHUP SIGINT SIGTERM - xset dpms 5 5 5 - i3lock --nofork --color 648901 --image=$pattern --tiling --ignore-empty-password - revert -fi diff --git a/config/i3/lock.png b/config/i3/lock.png deleted file mode 100644 index 70cc80b..0000000 Binary files a/config/i3/lock.png and /dev/null differ diff --git a/config/i3/lock.svg b/config/i3/lock.svg deleted file mode 100644 index 8eac69f..0000000 --- a/config/i3/lock.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/config/i3/terminal b/config/i3/terminal deleted file mode 100755 index 8426c9b..0000000 --- a/config/i3/terminal +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -alacritty msg create-window || exec alacritty -e zsh diff --git a/config/iftoprc b/config/iftoprc deleted file mode 100644 index 7867980..0000000 --- a/config/iftoprc +++ /dev/null @@ -1,61 +0,0 @@ -# interface: if -# Sets the network interface to if. - -dns-resolution: yes -# Controls reverse lookup of IP addresses. - -port-resolution: no -# Controls conversion of port numbers to service names. - -# filter-code: bpf -# Sets the filter code to bpf. - -show-bars: yes -# Controls display of bar graphs. - -promiscuous: no -# Puts the interface into promiscuous mode. - -port-display: on -# Controls display of port numbers. - -link-local: yes -# Determines displaying of link-local IPv6 addresses. - -hide-source: no -# Hides source host names. - -hide-destination: no -# Hides destination host names. - -use-bytes: yes -# Use bytes for bandwidth display, rather than bits. - -sort: 10s -# Sets which column is used to sort the display. - -line-display: two-line -# Controls the appearance of each item in the display. - -show-totals: yes -# Shows cumulative total for each item. - -log-scale: yes -# Use a logarithmic scale for bar graphs. - -# max-bandwidth: bw -# Fixes the maximum for the bar graph scale to bw, e.g. "10M". -# Note that the value has to always be in bits, regardless if the -# option to display in bytes has been chosen. - -# net-filter: net/mask -# Defines an IP network boundary for determining packet direc‐ -# tion. - -# net-filter6: net6/mask6 -# Defines an IPv6 network boundary for determining packet direc‐ -# tion. - -# screen-filter: regexp -# Sets a regular expression to filter screen output. - diff --git a/config/lemonbar/launch.sh b/config/lemonbar/launch.sh deleted file mode 100755 index 42c747e..0000000 --- a/config/lemonbar/launch.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env sh - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -ex="$DIR/bar.py" - -# Terminate already running bar instances -ps x | grep "python3 $ex" | grep -v grep | awk '{print $1}' | while read p; do kill $p; done -killall -q lemonbar - -$ex - - diff --git a/config/lemonbar/requirements.txt b/config/lemonbar/requirements.txt deleted file mode 100644 index 33e73b9..0000000 --- a/config/lemonbar/requirements.txt +++ /dev/null @@ -1,13 +0,0 @@ -coloredlogs==10.0 -enum-compat==0.0.2 -humanfriendly==4.16.1 -i3ipc==1.6.0 -ifaddr==0.1.4 -ipaddress==1.0.22 -psutil==5.4.7 -pulsectl>=23.5.2<24 -pyinotify==0.9.6 -python-mpd2>=3.0.0<4 -python-uinput==0.11.2 -yoke==0.1.1 -zeroconf==0.21.3 diff --git a/config/llpp.conf b/config/llpp.conf deleted file mode 100644 index 298f180..0000000 --- a/config/llpp.conf +++ /dev/null @@ -1 +0,0 @@ -savepath-command='echo %s' diff --git a/config/mpd/.dfrecur b/config/mpd/.dfrecur deleted file mode 100644 index e69de29..0000000 diff --git a/config/mpd/mpd.conf b/config/mpd/mpd.conf deleted file mode 100644 index 07db98a..0000000 --- a/config/mpd/mpd.conf +++ /dev/null @@ -1,413 +0,0 @@ -# An example configuration file for MPD. -# Read the user manual for documentation: http://www.musicpd.org/doc/user/ - - -# Files and directories ####################################################### -# -# This setting controls the top directory which MPD will search to discover the -# available audio files and add them to the daemon's online database. This -# setting defaults to the XDG directory, otherwise the music directory will be -# be disabled and audio files will only be accepted over ipc socket (using -# file:// protocol) or streaming files over an accepted protocol. -# -music_directory "~/Musiques" -# -# This setting sets the MPD internal playlist directory. The purpose of this -# directory is storage for playlists created by MPD. The server will use -# playlist files not created by the server but only if they are in the MPD -# format. This setting defaults to playlist saving being disabled. -# -playlist_directory "~/.config/mpd/playlists" -# -# This setting sets the location of the MPD database. This file is used to -# load the database at server start up and store the database while the -# server is not up. This setting defaults to disabled which will allow -# MPD to accept files over ipc socket (using file:// protocol) or streaming -# files over an accepted protocol. -# -db_file "~/.cache/mpd/database" -# -# These settings are the locations for the daemon log files for the daemon. -# These logs are great for troubleshooting, depending on your log_level -# settings. -# -# The special value "syslog" makes MPD use the local syslog daemon. This -# setting defaults to logging to syslog, otherwise logging is disabled. -# -log_file "~/.cache/mpd/log" -# -# This setting sets the location of the file which stores the process ID -# for use of mpd --kill and some init scripts. This setting is disabled by -# default and the pid file will not be stored. -# -pid_file "~/.cache/mpd/pid" -# -# This setting sets the location of the file which contains information about -# most variables to get MPD back into the same general shape it was in before -# it was brought down. This setting is disabled by default and the server -# state will be reset on server start up. -# -state_file "~/.cache/mpd/state" -# -# The location of the sticker database. This is a database which -# manages dynamic information attached to songs. -# -sticker_file "~/.cache/mpd/sticker.sql" -# -############################################################################### - - -# General music daemon options ################################################ -# -# This setting specifies the user that MPD will run as. MPD should never run as -# root and you may use this setting to make MPD change its user ID after -# initialization. This setting is disabled by default and MPD is run as the -# current user. -# -#user "nobody" -# -# This setting specifies the group that MPD will run as. If not specified -# primary group of user specified with "user" setting will be used (if set). -# This is useful if MPD needs to be a member of group such as "audio" to -# have permission to use sound card. -# -#group "nogroup" -# -# This setting sets the address for the daemon to listen on. Careful attention -# should be paid if this is assigned to anything other then the default, any. -# This setting can deny access to control of the daemon. -# -# For network -#bind_to_address "any" -# -# And for Unix Socket -#bind_to_address "~/.mpd/socket" -# -# This setting is the TCP port that is desired for the daemon to get assigned -# to. -# -#port "6600" -# -# This setting controls the type of information which is logged. Available -# setting arguments are "default", "secure" or "verbose". The "verbose" setting -# argument is recommended for troubleshooting, though can quickly stretch -# available resources on limited hardware storage. -# -log_level "default" -# -# If you have a problem with your MP3s ending abruptly it is recommended that -# you set this argument to "no" to attempt to fix the problem. If this solves -# the problem, it is highly recommended to fix the MP3 files with vbrfix -# (available from ), at which -# point gapless MP3 playback can be enabled. -# -#gapless_mp3_playback "yes" -# -# Setting "restore_paused" to "yes" puts MPD into pause mode instead -# of starting playback after startup. -# -restore_paused "yes" -# -# This setting enables MPD to create playlists in a format usable by other -# music players. -# -#save_absolute_paths_in_playlists "no" -# -# This setting defines a list of tag types that will be extracted during the -# audio file discovery process. The complete list of possible values can be -# found in the user manual. -#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc" -# -# This setting enables automatic update of MPD's database when files in -# music_directory are changed. -# -auto_update "yes" -# -# Limit the depth of the directories being watched, 0 means only watch -# the music directory itself. There is no limit by default. -# -#auto_update_depth "3" -# -############################################################################### - - -# Symbolic link behavior ###################################################### -# -# If this setting is set to "yes", MPD will discover audio files by following -# symbolic links outside of the configured music_directory. -# -#follow_outside_symlinks "yes" -# -# If this setting is set to "yes", MPD will discover audio files by following -# symbolic links inside of the configured music_directory. -# -#follow_inside_symlinks "yes" -# -############################################################################### - - -# Zeroconf / Avahi Service Discovery ########################################## -# -# If this setting is set to "yes", service information will be published with -# Zeroconf / Avahi. -# -#zeroconf_enabled "yes" -# -# The argument to this setting will be the Zeroconf / Avahi unique name for -# this MPD server on the network. -# -#zeroconf_name "Music Player" -# -############################################################################### - - -# Permissions ################################################################# -# -# If this setting is set, MPD will require password authorization. The password -# can setting can be specified multiple times for different password profiles. -# -#password "password@read,add,control,admin" -# -# This setting specifies the permissions a user has who has not yet logged in. -# -#default_permissions "read,add,control,admin" -# -############################################################################### - - -# Database ####################################################################### -# - -#database { -# plugin "proxy" -# host "other.mpd.host" -# port "6600" -#} - -# Input ####################################################################### -# - -input { - plugin "curl" -# proxy "proxy.isp.com:8080" -# proxy_user "user" -# proxy_password "password" -} - -# -############################################################################### - -# Audio Output ################################################################ -# -# MPD supports various audio output types, as well as playing through multiple -# audio outputs at the same time, through multiple audio_output settings -# blocks. Setting this block is optional, though the server will only attempt -# autodetection for one sound card. -# -# An example of an ALSA output: -# -#audio_output { -# type "alsa" -# name "My ALSA Device" -## device "hw:0,0" # optional -## mixer_type "hardware" # optional -## mixer_device "default" # optional -## mixer_control "PCM" # optional -## mixer_index "0" # optional -#} -# -# An example of an OSS output: -# -#audio_output { -# type "oss" -# name "My OSS Device" -## device "/dev/dsp" # optional -## mixer_type "hardware" # optional -## mixer_device "/dev/mixer" # optional -## mixer_control "PCM" # optional -#} -# -# An example of a shout output (for streaming to Icecast): -# -#audio_output { -# type "shout" -# encoding "ogg" # optional -# name "My Shout Stream" -# host "localhost" -# port "8000" -# mount "/mpd.ogg" -# password "hackme" -# quality "5.0" -# bitrate "128" -# format "44100:16:1" -## protocol "icecast2" # optional -## user "source" # optional -## description "My Stream Description" # optional -## url "http://example.com" # optional -## genre "jazz" # optional -## public "no" # optional -## timeout "2" # optional -## mixer_type "software" # optional -#} -# -# An example of a recorder output: -# -#audio_output { -# type "recorder" -# name "My recorder" -# encoder "vorbis" # optional, vorbis or lame -# path "/var/lib/mpd/recorder/mpd.ogg" -## quality "5.0" # do not define if bitrate is defined -# bitrate "128" # do not define if quality is defined -# format "44100:16:1" -#} -# -# An example of a httpd output (built-in HTTP streaming server): -# -audio_output { - type "httpd" - name "geoffrey-music-httpd" - encoder "vorbis" # optional, vorbis or lame - port "8600" - bind_to_address "0.0.0.0" # optional, IPv4 or IPv6 -# quality "5.0" # do not define if bitrate is defined - bitrate "128" # do not define if quality is defined - format "44100:16:1" - max_clients "0" # optional 0=no limit -} -# -# An example of a pulseaudio output (streaming to a remote pulseaudio server) -# -audio_output { - type "pulse" - name "geoffrey-music-pulse" -## server "remote_server" # optional -## sink "remote_server_sink" # optional -} -# -# An example of a winmm output (Windows multimedia API). -# -#audio_output { -# type "winmm" -# name "My WinMM output" -## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional -# or -## device "0" # optional -## mixer_type "hardware" # optional -#} -# -# An example of an openal output. -# -#audio_output { -# type "openal" -# name "My OpenAL output" -## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional -#} -# -## Example "pipe" output: -# -#audio_output { -# type "pipe" -# name "my pipe" -# command "aplay -f cd 2>/dev/null" -## Or if you're want to use AudioCompress -# command "AudioCompress -m | aplay -f cd 2>/dev/null" -## Or to send raw PCM stream through PCM: -# command "nc example.org 8765" -# format "44100:16:2" -#} -# -## An example of a null output (for no audio output): -# -#audio_output { -# type "null" -# name "My Null Output" -# mixer_type "none" # optional -#} -# -# If MPD has been compiled with libsamplerate support, this setting specifies -# the sample rate converter to use. Possible values can be found in the -# mpd.conf man page or the libsamplerate documentation. By default, this is -# setting is disabled. -# -#samplerate_converter "Fastest Sinc Interpolator" -# -############################################################################### - - -# Normalization automatic volume adjustments ################################## -# -# This setting specifies the type of ReplayGain to use. This setting can have -# the argument "off", "album", "track" or "auto". "auto" is a special mode that -# chooses between "track" and "album" depending on the current state of -# random playback. If random playback is enabled then "track" mode is used. -# See for more details about ReplayGain. -# This setting is off by default. -# -replaygain "auto" -# -# This setting sets the pre-amp used for files that have ReplayGain tags. By -# default this setting is disabled. -# -#replaygain_preamp "0" -# -# This setting sets the pre-amp used for files that do NOT have ReplayGain tags. -# By default this setting is disabled. -# -#replaygain_missing_preamp "0" -# -# This setting enables or disables ReplayGain limiting. -# MPD calculates actual amplification based on the ReplayGain tags -# and replaygain_preamp / replaygain_missing_preamp setting. -# If replaygain_limit is enabled MPD will never amplify audio signal -# above its original level. If replaygain_limit is disabled such amplification -# might occur. By default this setting is enabled. -# -#replaygain_limit "yes" -# -# This setting enables on-the-fly normalization volume adjustment. This will -# result in the volume of all playing audio to be adjusted so the output has -# equal "loudness". This setting is disabled by default. -# -#volume_normalization "no" -# -############################################################################### - -# Character Encoding ########################################################## -# -# If file or directory names do not display correctly for your locale then you -# may need to modify this setting. -# -#filesystem_charset "UTF-8" -# -# This setting controls the encoding that ID3v1 tags should be converted from. -# -#id3v1_encoding "ISO-8859-1" -# -############################################################################### - - -# SIDPlay decoder ############################################################# -# -# songlength_database: -# Location of your songlengths file, as distributed with the HVSC. -# The sidplay plugin checks this for matching MD5 fingerprints. -# See http://www.c64.org/HVSC/DOCUMENTS/Songlengths.faq -# -# default_songlength: -# This is the default playing time in seconds for songs not in the -# songlength database, or in case you're not using a database. -# A value of 0 means play indefinitely. -# -# filter: -# Turns the SID filter emulation on or off. -# -#decoder { -# plugin "sidplay" -# songlength_database "/media/C64Music/DOCUMENTS/Songlengths.txt" -# default_songlength "120" -# filter "true" -#} -# -############################################################################### - diff --git a/config/mpv/.dfrecur b/config/mpv/.dfrecur deleted file mode 100644 index e69de29..0000000 diff --git a/config/mpv/lua-settings/mpv_thumbnail_script.conf b/config/mpv/lua-settings/mpv_thumbnail_script.conf deleted file mode 100644 index c132e4f..0000000 --- a/config/mpv/lua-settings/mpv_thumbnail_script.conf +++ /dev/null @@ -1,71 +0,0 @@ -# The thumbnail cache directory. -# On Windows this defaults to %TEMP%\mpv_thumbs_cache, -# and on other platforms to /tmp/mpv_thumbs_cache. -# The directory will be created automatically, but must be writeable! -# Use absolute paths, and take note that environment variables like %TEMP% are unsupported (despite the default)! -# cache_directory=%HOME%/.cache/mpv/thumbnails -cache_directory=/tmp/my_mpv_thumbnails -# THIS IS NOT A WINDOWS PATH. COMMENT IT OUT OR ADJUST IT YOURSELF. - -# Whether to generate thumbnails automatically on video load, without a keypress -# Defaults to yes -autogenerate=no - -# Only automatically thumbnail videos shorter than this (in seconds) -# You will have to press T (or your own keybind) to enable the thumbnail previews -# Set to 0 to disable the check, ie. thumbnail videos no matter how long they are -# Defaults to 3600 (one hour) -autogenerate_max_duration=3600 - -# Use mpv to generate thumbnail even if ffmpeg is found in PATH -# ffmpeg is slightly faster than mpv but lacks support for ordered chapters in MKVs, -# which can break the resulting thumbnails. You have been warned. -# Defaults to yes (don't use ffmpeg) -prefer_mpv=no - -# Explicitly disable subtitles on the mpv sub-calls -# mpv can and will by default render subtitles into the thumbnails. -# If this is not what you wish, set mpv_no_sub to yes -# Defaults to no -mpv_no_sub=no - -# Enable to disable the built-in keybind ("T") to add your own, see after the block -disable_keybinds=no - -# The maximum dimensions of the thumbnails, in pixels -# Defaults to 200 and 200 -thumbnail_width=200 -thumbnail_height=200 - -# The thumbnail count target -# (This will result in a thumbnail every ~10 seconds for a 25 minute video) -thumbnail_count=150 - -# The above target count will be adjusted by the minimum and -# maximum time difference between thumbnails. -# The thumbnail_count will be used to calculate a target separation, -# and min/max_delta will be used to constrict it. - -# In other words, thumbnails will be: -# - at least min_delta seconds apart (limiting the amount) -# - at most max_delta seconds apart (raising the amount if needed) -# Defaults to 5 and 90, values are seconds -min_delta=5 -max_delta=90 -# 120 seconds aka 2 minutes will add more thumbnails only when the video is over 5 hours long! - -# Below are overrides for remote urls (you generally want less thumbnails, because it's slow!) -# Thumbnailing network paths will be done with mpv (leveraging youtube-dl) - -# Allow thumbnailing network paths (naive check for "://") -# Defaults to no -thumbnail_network=no -# Override thumbnail count, min/max delta, as above -remote_thumbnail_count=60 -remote_min_delta=15 -remote_max_delta=120 - -# Try to grab the raw stream and disable ytdl for the mpv subcalls -# Much faster than passing the url to ytdl again, but may cause problems with some sites -# Defaults to yes -remote_direct_stream=yes diff --git a/config/mpv/mpv.conf b/config/mpv/mpv.conf deleted file mode 100644 index b5f1c61..0000000 --- a/config/mpv/mpv.conf +++ /dev/null @@ -1,4 +0,0 @@ -no-audio-display -save-position-on-quit -# Required by thumbnails script -osc=no diff --git a/config/mpv/scripts/mpv_thumbnail_script_client_osc.lua b/config/mpv/scripts/mpv_thumbnail_script_client_osc.lua deleted file mode 120000 index 533c030..0000000 --- a/config/mpv/scripts/mpv_thumbnail_script_client_osc.lua +++ /dev/null @@ -1 +0,0 @@ -/usr/share/mpv/scripts/mpv_thumbnail_script_client_osc.lua \ No newline at end of file diff --git a/config/mpv/scripts/mpv_thumbnail_script_server.lua b/config/mpv/scripts/mpv_thumbnail_script_server.lua deleted file mode 120000 index b8c2ab0..0000000 --- a/config/mpv/scripts/mpv_thumbnail_script_server.lua +++ /dev/null @@ -1 +0,0 @@ -/usr/share/mpv/scripts/mpv_thumbnail_script_server.lua \ No newline at end of file diff --git a/config/mypy/config b/config/mypy/config deleted file mode 100644 index 8352875..0000000 --- a/config/mypy/config +++ /dev/null @@ -1,7 +0,0 @@ -[mypy] -cache_dir = ~/.cache/mypy -ignore_missing_imports = True -disallow_untyped_defs = True -disallow_untyped_calls = True -disallow_incomplete_defs = True -disallow_untyped_decorators = True diff --git a/config/pulse/.dfrecur b/config/pulse/.dfrecur deleted file mode 100644 index e69de29..0000000 diff --git a/config/pulse/client.conf b/config/pulse/client.conf deleted file mode 100644 index 199bd83..0000000 --- a/config/pulse/client.conf +++ /dev/null @@ -1 +0,0 @@ -cookie-file = .config/pulse/pulse-cookie diff --git a/config/pycodestyle b/config/pycodestyle deleted file mode 100644 index c89fb1c..0000000 --- a/config/pycodestyle +++ /dev/null @@ -1,3 +0,0 @@ -[pycodestyle] -# Compatibility with Black -max-line-length = 88 diff --git a/config/qutebrowser/.dfrecur b/config/qutebrowser/.dfrecur deleted file mode 100644 index e69de29..0000000 diff --git a/config/qutebrowser/config.py b/config/qutebrowser/config.py deleted file mode 100644 index 82d5b3b..0000000 --- a/config/qutebrowser/config.py +++ /dev/null @@ -1,81 +0,0 @@ -import os - -# Public static configuration for qutebrowser -# Note that private stuff (permissions, per-site rules) -# are in autoconfig in gdotfiles - -# Prompt the user for the download location. If set to false, -# `downloads.location.directory` will be used. -# Type: Bool -c.downloads.location.prompt = False - -# When to show the tab bar. -# Type: String -# Valid values: -# - always: Always show the tab bar. -# - never: Always hide the tab bar. -# - multiple: Hide the tab bar if only one tab is open. -# - switching: Show the tab bar when switching tabs. -c.tabs.show = "never" - -# Open a new window for every tab. -# Type: Bool -c.tabs.tabs_are_windows = True - -# Open base URL of the searchengine if a searchengine shortcut is -# invoked without parameters. -# Type: Bool -c.url.open_base_url = True - -# Search engines which can be used via the address bar. Maps a search -# engine name (such as `DEFAULT`, or `ddg`) to a URL with a `{}` -# placeholder. The placeholder will be replaced by the search term, use -# `{{` and `}}` for literal `{`/`}` signs. The search engine named -# `DEFAULT` is used when `url.auto_search` is turned on and something -# else than a URL was entered to be opened. Other search engines can be -# used by prepending the search engine name to the search term, e.g. -# `:open google qutebrowser`. -# Type: Dict -c.url.searchengines = { - "DEFAULT": "https://www.ecosia.org/search?q={}", - "aw": "http://www.amp-what.com/unicode/search/{}", - "ddg": "https://duckduckgo.com/?q={}&ia=web", - "duckduckgo": "https://duckduckgo.com/?q={}&ia=web", - "ecosia": "https://www.ecosia.org/search?q={}", - "github": "https://github.com/search?q={}", - "google": "https://www.google.fr/search?q={}", - "npm": "https://www.npmjs.com/search?q={}", - "q": "https://www.qwant.com/?t=web&q={}", - "qwant": "https://www.qwant.com/?t=web&q={}", - "wolfram": "https://www.wolframalpha.com/input/?i={}", - "youtube": "https://www.youtube.com/results?search_query={}", -} - -# Only allow first party cookies -config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*") - -# Request websites to reduce non-essential motion/animations -config.set("content.prefers_reduced_motion", True) - -# Page(s) to open at the start. -# Type: List of FuzzyUrl, or FuzzyUrl -c.url.start_pages = "https://geoffrey.frogeye.fr/blank.html" - -# Bindings for normal mode -config.bind("H", "tab-prev") -config.bind("J", "back") -config.bind("K", "forward") -config.bind("L", "tab-next") -config.unbind("T") -config.bind("af", "spawn --userscript freshrss") -config.bind("as", "spawn --userscript shaarli") -config.bind("u", "undo --window") - -dirname = os.path.dirname(__file__) -filename = os.path.join(dirname, "theme.py") -if os.path.exists(filename): - with open(filename) as file: - exec(file.read()) - -# Uncomment this to still load settings configured via autoconfig.yml -config.load_autoconfig() diff --git a/config/rofi/.gitignore b/config/rofi/.gitignore deleted file mode 100644 index ba58f6e..0000000 --- a/config/rofi/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -theme.config -theme.rasi diff --git a/config/rofi/config b/config/rofi/config deleted file mode 100644 index fc193ca..0000000 --- a/config/rofi/config +++ /dev/null @@ -1,4 +0,0 @@ -#include "theme.config" -rofi.theme: theme -rofi.lazy-grab: false -rofi.matching: regex diff --git a/config/rofi/config.rasi b/config/rofi/config.rasi deleted file mode 100644 index 9843b5f..0000000 --- a/config/rofi/config.rasi +++ /dev/null @@ -1,5 +0,0 @@ -configuration { - lazy-grab: false; - matching: "regex"; -} -@theme "theme" diff --git a/config/rofimoji.rc b/config/rofimoji.rc deleted file mode 100644 index 25e7911..0000000 --- a/config/rofimoji.rc +++ /dev/null @@ -1,3 +0,0 @@ -skin-tone = neutral -files = [emojis, math] -action = clipboard diff --git a/config/scripts/arch-rankmirrors b/config/scripts/arch-rankmirrors deleted file mode 100755 index 939eb56..0000000 --- a/config/scripts/arch-rankmirrors +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [ $USER != root ] -then - echo "This script should be run as root." - exit 1 -fi - -if ! pacman -Qq pacman-mirrorlist &> /dev/null -then - pacman -S pacman-mirrorlist -fi - -if [ ! -f /etc/pacman.d/mirrorlist.pacnew ] -then - cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.pacnew -fi - -egrep -o 'Server = .+' /etc/pacman.d/mirrorlist.pacnew | /usr/bin/rankmirrors -n 6 - > /etc/pacman.d/mirrorlist diff --git a/config/scripts/automatrop b/config/scripts/automatrop deleted file mode 100755 index d463b74..0000000 --- a/config/scripts/automatrop +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -cd ~/.dotfiles/config/automatrop -if [ -f ~/.config/automatrop/self_name ] -then - hostname=$(cat ~/.config/automatrop/self_name) -else - hostname="$HOSTNAME" -fi -ansible-playbook --diff playbooks/default.yml --limit $hostname --connection local "$@" diff --git a/config/scripts/beep b/config/scripts/beep deleted file mode 100755 index 5cd87e2..0000000 --- a/config/scripts/beep +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env sh -play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null -# echo  diff --git a/config/scripts/crepuscule b/config/scripts/crepuscule deleted file mode 100755 index abf456b..0000000 --- a/config/scripts/crepuscule +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] -then - echo 10000 | sudo tee /sys/class/backlight/intel_backlight/brightness -elif [ "$(cat /etc/hostname)" = "pindakaas.geoffrey.frogeye.fr" ] -then - echo 3000 | sudo tee /sys/class/backlight/edp-backlight/brightness -fi -automatrop -e base16_scheme=solarized-dark --tags color diff --git a/config/scripts/dotfiles b/config/scripts/dotfiles deleted file mode 100755 index 4d6cddf..0000000 --- a/config/scripts/dotfiles +++ /dev/null @@ -1,190 +0,0 @@ -#!/usr/bin/env bash - -# Handles dotfiles -# Yes there are tons of similar scipts yet I wanted no more nor less than what I needed - -# Config - -if [ -z "$DOTHOME" ]; then - DOTHOME="$HOME" -fi -if [ -z "$DOTREPO" ]; then - DOTREPO="$HOME/.dotfiles" -fi - -# Common functions - -# From http://stackoverflow.com/a/12498485 -function relativePath { - # both $1 and $2 are absolute paths beginning with / - # returns relative path to $2/$target from $1/$source - source=$1 - target=$2 - - common_part=$source # for now - result="" # for now - - while [[ "${target#$common_part}" == "${target}" ]]; do - # no match, means that candidate common part is not correct - # go up one level (reduce common part) - common_part="$(dirname $common_part)" - # and record that we went back, with correct / handling - if [[ -z $result ]]; then - result=".." - else - result="../$result" - fi - done - - if [[ $common_part == "/" ]]; then - # special case for root (no common path) - result="$result/" - fi - - # since we now have identified the common part, - # compute the non-common part - forward_part="${target#$common_part}" - - - # and now stick all parts together - if [[ -n $result ]] && [[ -n $forward_part ]]; then - result="$result$forward_part" - elif [[ -n $forward_part ]]; then - # extra slash removal - # result="${forward_part:1}" # Removes the . in the beginning... - result="${forward_part#/}" - fi - - echo "$result" -} - - -# Script common functions - -function _dotfiles-install-dir { # dir - local dir - local absSource - local absTarget - local relTarget - - dir="${1%/}" - dir="${dir#/}" - - ls -A "$DOTREPO/$dir" | while read file; do - if [[ -z "$dir" && $(echo $file | grep '^\(\.\|LICENSE\|README\)') ]]; then - continue - fi - if [[ $(echo $file | grep '^.dfrecur$') ]]; then - continue - fi - - if [ -z "$dir" ]; then - absSource="$DOTHOME/.$file" - absTarget="$DOTREPO/$file" - else - absSource="$DOTHOME/.$dir/$file" - absTarget="$DOTREPO/$dir/$file" - fi - relTarget="$(relativePath "$DOTHOME/$dir" "$absTarget")" - recurIndicator="$absTarget/.dfrecur" - - if [[ -h "$absTarget" ]]; then - if [ -e "$absSource" ]; then - if [ -h "$absSource" ]; then - cmd="cp --no-dereference --force $absTarget $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - yes | $cmd - fi - else - echo "[ERROR] $absSource already exists, but is not a link" - fi - else - cmd="cp --no-dereference --force $absTarget $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - yes | $cmd - fi - fi - elif [[ -f "$absTarget" || ( -d $absTarget && ! -f $recurIndicator ) ]]; then - if [ -e "$absSource" ]; then - if [ -h "$absSource" ]; then - cmd="ln --symbolic --no-dereference --force $relTarget $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - $cmd - fi - else - echo "[ERROR] $absSource already exists, but is not a symbolic link" - fi - else - cmd="ln --symbolic --no-dereference $relTarget $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - $cmd - fi - fi - elif [[ -d "$absTarget" && -f $recurIndicator ]]; then - if [ -e "$absSource" ]; then - if [ -d "$absSource" ]; then - # echo "Directory $absSource already exists" - _dotfiles-install-dir $dir/$file - else - echo "[ERROR] $absSource already exists, but is not a directory" - fi - else - cmd="mkdir $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - $cmd - fi - _dotfiles-install-dir $dir/$file - fi - else - echo "[WARNING] Skipped $absTarget" - fi - done - -} - -# Script functions - -function dotfiles_install { - _dotfiles-install-dir / -} - -function dotfiles_help { - command="$1" - if [ -n "$command" ]; then - if type "dotfiles_${command}_help" &> /dev/null; then - shift - "dotfiles_${command}_help" "$@" - return $? - fi - fi - echo "Usage: $0 COMMAND" - echo - echo "Commands:" - echo " install Install dotfiles from repository" - echo " help Get help with commands" - echo - echo "Environment variables:" - echo " DOTHOME Where to install dotfiles" - echo " DOTREPO Where do the dotfiles comes from" - return 0 -} - -# MAIN -command="$1" -shift -if type "dotfiles_$command" &> /dev/null; then - "dotfiles_$command" "$@" -else - dotfiles_help -fi - diff --git a/config/scripts/emergency-clean b/config/scripts/emergency-clean deleted file mode 100755 index be88836..0000000 --- a/config/scripts/emergency-clean +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# Clears everything it can to save space - -rm -rf $HOME/.cache -if which pacman &> /dev/null; then - sudo pacman -Scc -elif which apt-get &> /deb/null; then - sudo apt-get clean -fi -if which journalctl &> /dev/null; then - sudo journalctl --vacuum-size=100M -fi diff --git a/config/scripts/heavyPackages b/config/scripts/heavyPackages deleted file mode 100755 index 8235b61..0000000 --- a/config/scripts/heavyPackages +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Return a list of packages sorted by size - -(echo PACKAGE SIZE; \ - for A in /var/lib/pacman/local/*/desc; do - (sed -n 2p $A; (grep '^%SIZE%$' $A -A1 | tail -1)) | tr '\n' ' '; echo - done \ - | sort -nrk2) \ -| column -t diff --git a/config/scripts/jour b/config/scripts/jour deleted file mode 100755 index 72e9cbf..0000000 --- a/config/scripts/jour +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] -then - echo 40000 | sudo tee /sys/class/backlight/intel_backlight/brightness -elif [ "$(cat /etc/hostname)" = "pindakaas.geoffrey.frogeye.fr" ] -then - echo 3500 | sudo tee /sys/class/backlight/edp-backlight/brightness -fi -automatrop -e base16_scheme=solarized-light --tags color diff --git a/config/scripts/newestFile b/config/scripts/newestFile deleted file mode 100755 index 508a762..0000000 --- a/config/scripts/newestFile +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -find -type f -printf '%T+ %p\n' | sort | tail "$@" diff --git a/config/scripts/noise b/config/scripts/noise deleted file mode 100755 index eeb8ac8..0000000 --- a/config/scripts/noise +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -play -c 2 -n synth ${1}noise diff --git a/config/scripts/nuit b/config/scripts/nuit deleted file mode 100755 index 9666d97..0000000 --- a/config/scripts/nuit +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] -then - echo 1 | sudo tee /sys/class/backlight/intel_backlight/brightness -elif [ "$(cat /etc/hostname)" = "pindakaas.geoffrey.frogeye.fr" ] -then - echo 700 | sudo tee /sys/class/backlight/edp-backlight/brightness -fi -automatrop -e base16_scheme=solarized-dark --tags color diff --git a/config/scripts/oldestFile b/config/scripts/oldestFile deleted file mode 100755 index 4f90f83..0000000 --- a/config/scripts/oldestFile +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -find -type f -printf '%T+ %p\n' | sort | head "$@" diff --git a/config/scripts/ovhcli b/config/scripts/ovhcli deleted file mode 100755 index 880dc62..0000000 --- a/config/scripts/ovhcli +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import json -import logging -import os -import urllib.request -from pprint import pprint - -import coloredlogs -import ovh -import xdg.BaseDirectory - -coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s") -log = logging.getLogger() - -debug = None - - -class OvhCli: - ROOT = "https://api.ovh.com/1.0?null" - - def __init__(self): - self.cacheDir = os.path.join(xdg.BaseDirectory.xdg_cache_home, "ovhcli") - # TODO Corner cases: links, cache dir not done, configurable cache - if not os.path.isdir(self.cacheDir): - assert not os.path.exists(self.cacheDir) - os.makedirs(self.cacheDir) - - def updateCache(self): - log.info("Downloading the API description") - rootJsonPath = os.path.join(self.cacheDir, "root.json") - log.debug(f"{self.ROOT} -> {rootJsonPath}") - urllib.request.urlretrieve(self.ROOT, rootJsonPath) - with open(rootJsonPath, "rt") as rootJson: - root = json.load(rootJson) - basePath = root["basePath"] - - for apiRoot in root["apis"]: - fmt = "json" - assert fmt in apiRoot["format"] - path = apiRoot["path"] - schema = apiRoot["schema"].format(format=fmt, path=path) - apiJsonPath = os.path.join(self.cacheDir, schema[1:]) - apiJsonUrl = basePath + schema - log.debug(f"{apiJsonUrl} -> {apiJsonPath}") - apiJsonPathDir = os.path.dirname(apiJsonPath) - if not os.path.isdir(apiJsonPathDir): - os.makedirs(apiJsonPathDir) - urllib.request.urlretrieve(apiJsonUrl, apiJsonPath) - - def createParser(self): - parser = argparse.ArgumentParser(description="Access the OVH API") - return parser - - -if __name__ == "__main__": - cli = OvhCli() - # cli.updateCache() - parser = cli.createParser() - args = parser.parse_args() - print(args) diff --git a/config/scripts/pw b/config/scripts/pw deleted file mode 100755 index e1dd8c4..0000000 --- a/config/scripts/pw +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# Generate strong enough password(s) - -# This generates a password with ln((26*2+10)**32)/ln(2) ≅ 190 bits of entropy, -# which is a bit above the recommended standars (128 bits) while still having -# a 0 probability that the service will break because of incompatible character - -pwgen 32 -y diff --git a/config/scripts/requirements.txt b/config/scripts/requirements.txt deleted file mode 100644 index f806981..0000000 --- a/config/scripts/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -coloredlogs>=10.0<11 -progressbar2>=3.47.0<4 -yt-dlp>=2021.10.22 -ConfigArgParse>=1.5<2 -asyncinotify -ffmpeg -r128gain diff --git a/config/scripts/rms b/config/scripts/rms deleted file mode 100755 index 885b287..0000000 --- a/config/scripts/rms +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -find . -name "*.sync-conflict-*" -delete diff --git a/config/scripts/sedrename b/config/scripts/sedrename deleted file mode 100755 index 42a6f23..0000000 --- a/config/scripts/sedrename +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -# Rename a list of files with a sed pattern - -usage() { - echo "Usage: $0 PATTERN [-d] < filelist" - echo - echo "Arguments:" - echo " PATTERN Sed pattern to apply" - echo - echo "Options:" - echo " -d Dry run" - exit 1 -} - -if [[ -z "$1" ]]; then - usage -fi - -pattern="$1" - -dry=1 -if [[ -n "$2" ]]; then - if [[ "$2" = '-d' ]]; then - dry=0 - else - usage - fi -fi - -while read src -do - dst="$(echo "$src" | sed "$pattern")" - if [[ $? != 0 ]]; then - echo "ERREUR Invalid sed pattern" - exit 2 - fi - if [[ $dry == 0 ]]; then - echo "$src" → "$dst" - else - mv -- "$src" "$dst" - fi - -done - - - diff --git a/config/scripts/showKeyboardLayout b/config/scripts/showKeyboardLayout deleted file mode 100755 index 379ca37..0000000 --- a/config/scripts/showKeyboardLayout +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/bash -layout=`setxkbmap -query | grep layout | tr -s ' ' | cut -d ' ' -f2` -variant=`setxkbmap -query | grep variant | tr -s ' ' | cut -d ' ' -f2` -gkbd-keyboard-display -l ${layout}$'\t'${variant} diff --git a/config/scripts/tracefiles b/config/scripts/tracefiles deleted file mode 100755 index 662f59e..0000000 --- a/config/scripts/tracefiles +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -strace -f -t -e trace=file $@ diff --git a/config/scripts/transfer b/config/scripts/transfer deleted file mode 100755 index a937228..0000000 --- a/config/scripts/transfer +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env sh - -if [ $# -eq 0 ] -then - echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md" - return 1 -fi - -tmpfile=$( mktemp -t transferXXX ) - -if tty -s -then - basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g') - curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile -else - curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile -fi - -cat $tmpfile -rm -f $tmpfile diff --git a/config/scripts/vidcmp b/config/scripts/vidcmp deleted file mode 100755 index 7a284b9..0000000 --- a/config/scripts/vidcmp +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python3 - -# Compresses video using FFMPEG using -# FFMPEG's reasonable default settings - -import os -import subprocess -import sys - -files = sys.argv[1:] - -remove = False -if "-r" in files: - files.remove("-r") - remove = True - -for f in files: - print(os.path.splitext(f)) diff --git a/config/shell/.dfrecur b/config/shell/.dfrecur deleted file mode 100644 index e69de29..0000000 diff --git a/config/shell/.gitignore b/config/shell/.gitignore deleted file mode 100644 index 3cb575e..0000000 --- a/config/shell/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -extrc -*.zwc -.zcompdump diff --git a/config/shell/.zprofile b/config/shell/.zprofile deleted file mode 100644 index ff174ee..0000000 --- a/config/shell/.zprofile +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env zsh - -source ~/.config/shell/shenv -source ~/.config/shell/commonenv diff --git a/config/shell/.zshrc b/config/shell/.zshrc deleted file mode 100644 index c6a82e6..0000000 --- a/config/shell/.zshrc +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env zsh - -source ~/.config/shell/shrc -source ~/.config/shell/commonrc -source ~/.config/shell/zshrc diff --git a/config/shell/bashrc b/config/shell/bashrc deleted file mode 100644 index 3288858..0000000 --- a/config/shell/bashrc +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash - -# -# Bash aliases and customizations -# - -# Shell options - -shopt -s expand_aliases -shopt -s histappend - -HISTCONTROL=ignoreboth:erasedups - -# Prompt customization - -if command -v powerline-go > /dev/null -then - INTERACTIVE_BASHPID_TIMER="${HOME}/.cache/bash_timer_$$" - - PS0='$(echo $SECONDS > "$INTERACTIVE_BASHPID_TIMER")' - - function _update_ps1() { - local __ERRCODE=$? - - local __DURATION=0 - if [ -e "$INTERACTIVE_BASHPID_TIMER" ]; then - local __END=$SECONDS - local __START=$(cat "$INTERACTIVE_BASHPID_TIMER") - __DURATION="$(($__END - ${__START:-__END}))" - \rm -f "$INTERACTIVE_BASHPID_TIMER" - fi - - echo -en "\033]0; ${USER}@${HOSTNAME} $PWD\007" - # echo -en "… $\r" - eval "$(powerline-go -shell bash -eval -duration $__DURATION -error $__ERRCODE "${POWERLINE_GO_DEFAULT_OPTS[@]}")" - } - - PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" - -else - export PS1="\[\e]2;\u@\H \w\a\]\[\e[0;37m\][\[\e[0;${col}m\]\u\[\e[0;37m\]@\[\e[0;34m\]\h \[\e[0;36m\]\W\[\e[0;37m\]]\$\[\e[0m\] " -fi - -# Completion -trysource /usr/share/bash-completion/bash_completion - -# Fuzzy matching all the way -trysource /usr/share/fzf/completion.bash -trysource /usr/share/fzf/key-bindings.bash diff --git a/config/shell/commonenv b/config/shell/commonenv deleted file mode 100644 index 20ad15c..0000000 --- a/config/shell/commonenv +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env sh - -# -# Bash / ZSH common environment variables and functions -# - -export TIME_STYLE='+%Y-%m-%d %H:%M:%S' -export LESS=-R -export LESS_TERMCAP_mb=$'\E[1;31m' # begin blink -export LESS_TERMCAP_md=$'\E[1;36m' # begin bold -export LESS_TERMCAP_me=$'\E[0m' # reset bold/blink -export LESS_TERMCAP_so=$'\E[01;44;33m' # begin reverse video -export LESS_TERMCAP_se=$'\E[0m' # reset reverse video -export LESS_TERMCAP_us=$'\E[1;32m' # begin underline -export LESS_TERMCAP_ue=$'\E[0m' # reset underline -eval $(dircolors --sh) diff --git a/config/shell/commonrc b/config/shell/commonrc deleted file mode 100644 index a0bf99e..0000000 --- a/config/shell/commonrc +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env sh - -# -# Bash / ZSH aliases and customizations -# - -# Shell options - -HISTSIZE=100000 -HISTFILE="$HOME/.cache/shell_history" - -## COMMAND CONFIGURATION - -# Completion for existing commands - -alias cp="cp -i --reflink=auto" -alias grep="grep --color=auto" -alias dd='dd status=progress' -alias rm='rm -v --one-file-system' -alias free='free -m' -alias diff='diff --color=auto' -alias dmesg='dmesg --ctime' -alias wget='wget --hsts-file $HOME/.cache/wget-hsts' - -# [ -f ~/.local/bin/colorSchemeApplyFzf ] && . ~/.local/bin/colorSchemeApplyFzf # Only applies RGB colors... -POWERLINE_GO_DEFAULT_OPTS=(-colorize-hostname -max-width 25 -cwd-max-dir-size 10 -modules 'user,host,venv,cwd,perms,git' -modules-right 'jobs,exit,duration,load') # For reading by shell profiles -FZF_DEFAULT_OPTS="--height 40% --layout=default" -FZF_CTRL_T_OPTS="--preview '[[ -d {} ]] && ls -l --color=always {} || [[ \$(file --mime {}) =~ binary ]] && file --brief {} || (highlight -O ansi -l {} || coderay {} || rougify {} || cat {}) 2> /dev/null | head -500'" -FZF_COMPLETION_OPTS="${FZF_CTRL_T_OPTS}" - -# Colored ls -_colored_ls() { - \ls -lh --color=always $@ | awk ' - BEGIN { - FPAT = "([[:space:]]*[^[:space:]]+)"; - OFS = ""; - } - { - $1 = "\033[36m" $1 "\033[0m"; - $2 = "\033[31m" $2 "\033[0m"; - $3 = "\033[32m" $3 "\033[0m"; - $4 = "\033[32m" $4 "\033[0m"; - $5 = "\033[31m" $5 "\033[0m"; - $6 = "\033[34m" $6 "\033[0m"; - $7 = "\033[34m" $7 "\033[0m"; - print - } - ' -} -alias ll="_colored_ls" -alias la="_colored_ls -a" - -# To keep until https://github.com/openssh/openssh-portable/commit/f64f8c00d158acc1359b8a096835849b23aa2e86 -# is merged -function _ssh { - if [ "${TERM}" = "alacritty" ] - then - TERM=xterm-256color ssh "$@" - else - ssh "$@" - fi -} -alias ssh='_ssh' - -## FUNCTIONS diff --git a/config/shell/shenv b/config/shell/shenv deleted file mode 100644 index d28d5f0..0000000 --- a/config/shell/shenv +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/env sh - -# -# Shell common environment variables and functions (BusyBox compatible) -# - -# Favourite commands -export PAGER=less -export EDITOR=nvim -export VISUAL=nvim -export BROWSER=qutebrowser - -direnv() { # environment variable name, path - export "$1"="$2" - mkdir -p "$2" -} - -# Program-specific - -export JAVA_FONTS=/usr/share/fonts/TTF # 2019-04-25 Attempt to remove .java/fonts remove if it didn't work -# export ANDROID_HOME=/opt/android-sdk -# export ARDUINO=/usr/share/arduino -# export ARDUINO_DIR=$ARDUINO -# export ARDMK_VENDOR=archlinux-arduino - -# Get out of my $HOME! -export BOOT9_PATH="$HOME/.local/share/citra-emu/sysdata/boot9.bin" -direnv CARGOHOME "$HOME/.cache/cargo" # There are config in there that we can version if one want -export CCACHE_CONFIGPATH="$HOME/.config/ccache.conf" -direnv CCACHE_DIR "$HOME/.cache/ccache" # The config file alone seems to be not enough -direnv DASHT_DOCSETS_DIR "$HOME/.cache/dash_docsets" -direnv GNUPGHOME "$HOME/.config/gnupg" -direnv GOPATH "$HOME/.cache/go" -direnv GRADLE_USER_HOME "$HOME/.cache/gradle" -export INPUTRC="$HOME/.config/inputrc" -export LESSHISTFILE="$HOME/.cache/lesshst" -direnv MIX_ARCHIVES "$HOME/.cache/mix/archives" -direnv MONO_GAC_PREFIX "$HOME/.cache/mono" -export NODE_REPL_HISTORY="$HOME/.cache/node_repl_history" -direnv npm_config_cache "$HOME/.cache/npm" -direnv PARALLEL_HOME "$HOME/.cache/parallel" -export PYTHONSTARTUP="$HOME/.config/pythonstartup.py" -export SCREENRC="$HOME/.config/screenrc" -export SQLITE_HISTFILE="$HOME/.cache/sqlite_history" -direnv TERMINFO "$HOME/.config/terminfo" -export RXVT_SOCKET="$HOME/.cache/urxvtd-$HOST" -export VIMINIT="source $HOME/.config/vim/loader.vim" -direnv WINEPREFIX "$HOME/.cache/wineprefix/default" -direnv YARN_CACHE_FOLDER "$HOME/.cache/yarn" -export YARN_DISABLE_SELF_UPDATE_CHECK=true # This also disable the creation of a ~/.yarnrc file -# Disabled since this causes lockups with DMs -# export XAUTHORITY="$HOME/.config/Xauthority" - -# And for the rest, see aliases -direnv JUNKHOME "$HOME/.cache/junkhome" - -# For software that did not understand that XDG variables have defaults -direnv XDG_DATA_HOME "$HOME/.local/share" -direnv XDG_CONFIG_HOME "$HOME/.config" -export XDG_DATA_DIRS="/usr/local/share/:/usr/share/" -export XDG_CONFIG_DIRS="/etc/xdg" -direnv XDG_CACHE_HOME "$HOME/.cache" -# Please don't set XDG_RUNTIME_DIR as it -# screw with user daemons such as PulseAudio - -# Path - -# Function stolen from Arch Linux /etc/profile -appendpath() { - if [ ! -d "$1" ]; then - return - fi - case ":$PATH:" in - *:"$1":*) ;; - - *) - export PATH="${PATH:+$PATH:}$1" - ;; - esac -} - -prependpath() { - if [ ! -d "$1" ]; then - return - fi - case ":$PATH:" in - *:"$1":*) ;; - - *) - export PATH="$1${PATH:+:$PATH}" - ;; - esac -} - -prependpath '/usr/lib/ccache/bin' -prependpath "${GOPATH}/bin" -prependpath "$HOME/.local/bin" -prependpath "$HOME/.config/scripts" - -# If running on termux, load those extra scripts -[ -d /data/data/com.termux/ ] && ( - prependpath "$HOME/.termux/scripts" - prependpath "$HOME/.termux/bin" -) - -# For superseding commands with better ones if they are present - -# SSH Agent - - -# If GPG agent is configured for SSH -if grep -q ^enable-ssh-support$ $GNUPGHOME/gpg-agent.conf 2> /dev/null -then - # Load GPG agent - unset SSH_AGENT_PID - if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then - export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" - fi - -else - # Start regular SSH agent if not already started - SSH_ENV="$HOME/.ssh/agent" - - start_agent() { - ssh-agent > "${SSH_ENV}" - chmod 600 "${SSH_ENV}" - . "${SSH_ENV}" > /dev/null - } - - if [ -f "${SSH_ENV}" ] - then - . "${SSH_ENV}" > /dev/null - if [ ! -d "/proc/${SSH_AGENT_PID}" ] || [ "$(cat "/proc/${SSH_AGENT_PID}/comm")" != "ssh-agent" ] - then - start_agent - fi - else - start_agent - fi -fi - -# TODO Service sytem that works without systemd, -# and can stop processes on logout diff --git a/config/shell/shrc b/config/shell/shrc deleted file mode 100644 index 7be4a5e..0000000 --- a/config/shell/shrc +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/env sh - -# -# Shell common aliases and customizations (BusyBox compatible) -# - -## COMMAND CONFIGURATION - -# Completion for existing commands -alias ls='ls -h --color=auto' -alias mkdir='mkdir -v' -alias cp="cp -i" -alias mv="mv -iv" -alias free='free -h' -alias df='df -h' - -alias ffmpeg='ffmpeg -hide_banner' -alias ffprobe='ffprobe -hide_banner' -alias ffplay='ffplay -hide_banner' - -# ALIASES - -# Frequent mistakes -alias sl=ls -alias al=la -alias mdkir=mkdir -alias systemclt=systemctl -alias please=sudo - -# Shortcuts for commonly used commands -alias ll="ls -l" -alias la="ls -la" -alias s='sudo -s -E' -alias n='$HOME/.config/i3/terminal & disown' -alias x='startx $HOME/.config/xinitrc; logout' -alias nx='nvidia-xrun $HOME/.config/xinitrc; sudo systemctl start nvidia-xrun-pm; logout' - -# For programs that think $HOME is a reasonable place to put their junk -# and don't allow the user to change those questionable choices -alias adb='HOME=$JUNKHOME adb' -alias audacity='HOME=$JUNKHOME audacity' -alias binwalk='HOME=$JUNKHOME binwalk' # Should use .config according to the GitHub code though -alias cabal='HOME=$JUNKHOME cabal' # TODO May have options but last time I tried it it crashed -alias cmake='HOME=$JUNKHOME cmake' -alias ddd='HOME=$JUNKHOME ddd' -alias ghidra='HOME=$JUNKHOME ghidra' -alias itch='HOME=$JUNKHOME itch' -alias simplescreenrecorder='HOME=$JUNKHOME simplescreenrecorder' # Easy fix https://github.com/MaartenBaert/ssr/blob/1556ae456e833992fb6d39d40f7c7d7c337a4160/src/Main.cpp#L252 -alias vd='HOME=$JUNKHOME vd' -alias wpa_cli='HOME=$JUNKHOME wpa_cli' -# TODO Maybe we can do something about node-gyp - -alias bower='bower --config.storage.packages=~/.cache/bower/packages --config.storage.registry=~/.cache/bower/registry --config.storage.links=~/.cache/bower/links' -alias gdb='gdb -x $HOME/.config/gdbinit' -alias iftop='iftop -c $HOME/.config/iftoprc' -alias lmms='lmms --config $HOME/.config/lmmsrc.xml' -alias tmux='tmux -f $HOME/.config/tmux/tmux.conf' - -# TODO ruby's gem when I find a use for it - -# FUNCTIONS -trysource() { - if [ -f "$1" ] - then - . "$1" - else - return 1 - fi -} - -_i_prefer() { # executables... - for candidate in "$@" - do - if [ -x "$(command -v "$candidate")" ] - then - choice="$candidate" - break - fi - done - if [ -z "$choice" ] - then - return - fi - for candidate in "$@" - do - if [ "$candidate" != "$choice" ] - then - alias "$candidate"="$choice" - fi - done -} -_i_prefer nvim vim vi -_i_prefer gopass pass -_i_prefer wakeonlan wol -_i_prefer neomutt mutt -unset _i_prefer - -## COLORS - -# trysource ~/.local/bin/colorSchemeApply -# Needed because xterm/urxvt won't use the last color, needed for vim - -## GPG -# Makes the last open terminal the ones that receives the pinentry message (if -# not run from a terminal with DESKTOP) -# TODO Only run if gpg-agent is started? -# TODO Make a command out of this for easy management (and maybe remove the below) -export GPG_TTY=$(tty) -gpg-connect-agent updatestartuptty /bye >/dev/null - -## EXTENSIONS -trysource ~/.config/shell/extrc diff --git a/config/shell/zshrc b/config/shell/zshrc deleted file mode 100644 index cc92c3b..0000000 --- a/config/shell/zshrc +++ /dev/null @@ -1,211 +0,0 @@ -#!/usr/bin/env zsh - -# -# ZSH aliases and customizations -# - -# TODO Learn `setopt extendedglob` -# TODO Add asdf (oh-my-zsh plugin is air, git clone is the way (aur package outdated)) - -# Approximate RGB colors by terminal colors -[[ "$COLORTERM" == (24bit|truecolor) || "${terminfo[colors]}" -eq '16777216' ]] || zmodload zsh/nearcolor - -# Plugins -ADOTDIR=~/.cache/antigen -mkdir -p $ADOTDIR -typeset -a ANTIGEN_CHECK_FILES=(~/.config/shell/zshrc) - -if [ -f /usr/share/zsh/share/antigen.zsh ] -then - source /usr/share/zsh/share/antigen.zsh -else - [ -f ~/.local/share/zsh/antigen.zsh ] || (mkdir -p ~/.local/share/zsh/ && curl -L git.io/antigen > ~/.local/share/zsh/antigen.zsh) - # TODO If the downloaded file is wrong then we're doomed - source ~/.local/share/zsh/antigen.zsh -fi - -# This is better to have them installed as system since we can use them as root -# pacman -S zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting zsh-completions --needed -function plugin() { - if [ -d "/usr/share/licenses/$2" ] - then - trysource "/usr/share/zsh/plugins/$2/$2.zsh" - # It's ok if it fails - else - antigen bundle "$1/$2" - fi -} -plugin zsh-users zsh-completions -plugin zsh-users zsh-syntax-highlighting -plugin zsh-users zsh-autosuggestions -plugin zsh-users zsh-history-substring-search -antigen apply - -# Prompt customization -zmodload zsh/datetime - -function preexec() { - __TIMER=$EPOCHREALTIME -} - -if command -v powerline-go > /dev/null -then - function powerline_precmd() { - local __ERRCODE=$? - local __DURATION=0 - - if [ -n $__TIMER ]; then - local __ERT=$EPOCHREALTIME - __DURATION="$(($__ERT - ${__TIMER:-__ERT}))" - fi - - echo -en "\033]0; ${USER}@${HOST} $PWD\007" - # echo -en "… $\r" - eval "$(powerline-go -shell zsh -eval -duration $__DURATION -error $__ERRCODE "${POWERLINE_GO_DEFAULT_OPTS[@]}")" - unset __TIMER - } - - function install_powerline_precmd() { - for s in "${precmd_functions[@]}"; do - if [ "$s" = "powerline_precmd" ]; then - return - fi - done - precmd_functions+=(powerline_precmd) - } - - install_powerline_precmd -else - export PS1="\[\e]2;\u@\H \w\a\]\[\e[0;37m\][\[\e[0;${col}m\]\u\[\e[0;37m\]@\[\e[0;34m\]\h \[\e[0;36m\]\W\[\e[0;37m\]]\$\[\e[0m\] " -fi - -# Cursor based on mode -if [ $TERM = "linux" ]; then - _LINE_CURSOR="\e[?0c" - _BLOCK_CURSOR="\e[?8c" -else - _LINE_CURSOR="\e[6 q" - _BLOCK_CURSOR="\e[2 q" -fi -function zle-keymap-select zle-line-init -{ - case $KEYMAP in - vicmd) print -n -- "$_BLOCK_CURSOR";; - viins|main) print -n -- "$_LINE_CURSOR";; - esac - - # zle reset-prompt - # zle -R -} - -function zle-line-finish -{ - print -n -- "$_BLOCK_CURSOR" -} - -zle -N zle-line-init -zle -N zle-line-finish -zle -N zle-keymap-select - -# Should I really put a comment to explain what this does? -bindkey 'jk' vi-cmd-mode - -# Edit command line -autoload edit-command-line -zle -N edit-command-line -bindkey -M vicmd v edit-command-line - -# History search -# bind UP and DOWN arrow keys -zmodload zsh/terminfo -bindkey "$terminfo[kcuu1]" history-substring-search-up -bindkey "$terminfo[kcud1]" history-substring-search-down - -# bind UP and DOWN arrow keys (compatibility fallback -# for Ubuntu 12.04, Fedora 21, and MacOSX 10.9 users) -bindkey '^[[A' history-substring-search-up -bindkey '^[[B' history-substring-search-down - -# bind P and N for EMACS mode -bindkey -M emacs '^P' history-substring-search-up -bindkey -M emacs '^N' history-substring-search-down - -# bind k and j for VI mode -bindkey -M vicmd 'k' history-substring-search-up -bindkey -M vicmd 'j' history-substring-search-down - -# Autocompletion -autoload -Uz promptinit -promptinit - -# Color common prefix -zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==35=00}:${(s.:.)LS_COLORS}")' - -setopt GLOBDOTS # Complete hidden files - -setopt NO_BEEP # that annoying beep goes away -# setopt NO_LIST_BEEP # beeping is only turned off for ambiguous completions -setopt AUTO_LIST # when the completion is ambiguous you get a list without having to type ^D -# setopt BASH_AUTO_LIST # the list only happens the second time you hit tab on an ambiguous completion -# setopt LIST_AMBIGUOUS # this is modified so that nothing is listed if there is an unambiguous prefix or suffix to be inserted --- this can be combined with BASH_AUTO_LIST, so that where both are applicable you need to hit tab three times for a listing -unsetopt REC_EXACT # if the string on the command line exactly matches one of the possible completions, it is accepted, even if there is another completion (i.e. that string with something else added) that also matches -unsetopt MENU_COMPLETE # one completion is always inserted completely, then when you hit TAB it changes to the next, and so on until you get back to where you started -unsetopt AUTO_MENU # you only get the menu behaviour when you hit TAB again on the ambiguous completion. -unsetopt AUTO_REMOVE_SLASH - -# Fuzzy matching all the way -# trysource /usr/share/fzf/completion.zsh -trysource /usr/share/fzf/key-bindings.zsh - -# Help -# TODO Doesn't work (how ironic) -autoload -Uz run-help -unalias run-help -alias help=run-help -autoload -Uz run-help-git -autoload -Uz run-help-ip -autoload -Uz run-help-openssl -autoload -Uz run-help-p4 -autoload -Uz run-help-sudo -autoload -Uz run-help-svk -autoload -Uz run-help-svn - -# Dir stack -DIRSTACKFILE="$HOME/.cache/zsh/dirs" -if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then - dirstack=( ${(f)"$(< $DIRSTACKFILE)"} ) - # [[ -d $dirstack[1] ]] && cd $dirstack[1] -fi -chpwd() { - print -l $PWD ${(u)dirstack} >$DIRSTACKFILE -} - -DIRSTACKSIZE=20 - -setopt AUTO_PUSHD PUSHD_SILENT PUSHD_TO_HOME -setopt PUSHD_IGNORE_DUPS # Remove duplicate entries -setopt PUSHD_MINUS # This reverts the +/- operators. - - -# Command not found -# (since we have syntax highlighting we are not forced to wait to see that we typed crap) -trysource /usr/share/doc/pkgfile/command-not-found.zsh - -# History - -# From https://unix.stackexchange.com/a/273863 -SAVEHIST=$HISTSIZE -setopt BANG_HIST # Treat the '!' character specially during expansion. -unsetopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format. -setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits. -setopt SHARE_HISTORY # Share history between all sessions. -setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history. -setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again. -setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate. -setopt HIST_FIND_NO_DUPS # Do not display a line previously found. -setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space. -setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file. -setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry. -unsetopt HIST_VERIFY # Don't execute immediately upon history expansion. -unsetopt HIST_BEEP # Beep when accessing nonexistent history. - diff --git a/config/terminfo/a/alacritty b/config/terminfo/a/alacritty deleted file mode 100644 index d02394c..0000000 Binary files a/config/terminfo/a/alacritty and /dev/null differ diff --git a/config/terminfo/a/alacritty-256color b/config/terminfo/a/alacritty-256color deleted file mode 100644 index a76418f..0000000 Binary files a/config/terminfo/a/alacritty-256color and /dev/null differ diff --git a/config/terminfo/r/rxvt-unicode b/config/terminfo/r/rxvt-unicode deleted file mode 100644 index 7650d3c..0000000 Binary files a/config/terminfo/r/rxvt-unicode and /dev/null differ diff --git a/config/terminfo/r/rxvt-unicode-256color b/config/terminfo/r/rxvt-unicode-256color deleted file mode 100644 index 3f43d0d..0000000 Binary files a/config/terminfo/r/rxvt-unicode-256color and /dev/null differ diff --git a/config/user-dirs.dirs b/config/user-dirs.dirs deleted file mode 100644 index 0958aae..0000000 --- a/config/user-dirs.dirs +++ /dev/null @@ -1,15 +0,0 @@ -# This file is written by xdg-user-dirs-update -# If you want to change or add directories, just edit the line you're -# interested in. All local changes will be retained on the next run -# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped -# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an -# absolute path. No other format is supported. -# -XDG_DESKTOP_DIR="$HOME/Bureau" -XDG_DOWNLOAD_DIR="$HOME/Téléchargements" -XDG_TEMPLATES_DIR="$HOME/Modèles" -XDG_PUBLICSHARE_DIR="$HOME/Public" -XDG_DOCUMENTS_DIR="$HOME/Documents" -XDG_MUSIC_DIR="$HOME/Musique" -XDG_PICTURES_DIR="$HOME/Images" -XDG_VIDEOS_DIR="$HOME/Vidéos" diff --git a/config/user-dirs.locale b/config/user-dirs.locale deleted file mode 100755 index 9f0da78..0000000 --- a/config/user-dirs.locale +++ /dev/null @@ -1 +0,0 @@ -fr_FR \ No newline at end of file diff --git a/config/vdirsyncer/.dfrecur b/config/vdirsyncer/.dfrecur deleted file mode 100644 index e69de29..0000000 diff --git a/config/ycm_extra_conf.py b/config/ycm_extra_conf.py deleted file mode 100644 index 31b416f..0000000 --- a/config/ycm_extra_conf.py +++ /dev/null @@ -1,4 +0,0 @@ -def FlagsForFile(filename, **kwargs): - return { - 'flags': ['-Wall', '-Wextra', '-lm'], - } diff --git a/curacao/hardware.nix b/curacao/hardware.nix new file mode 100644 index 0000000..996cf10 --- /dev/null +++ b/curacao/hardware.nix @@ -0,0 +1,15 @@ +{ lib, ... }: +{ + imports = [ + + ]; + + # UEFI works here, and variables can be touched + boot.loader = { + efi.canTouchEfiVariables = lib.mkDefault true; + grub = { + enable = true; + efiSupport = true; + }; + }; +} diff --git a/curacao/options.nix b/curacao/options.nix new file mode 100644 index 0000000..6bed395 --- /dev/null +++ b/curacao/options.nix @@ -0,0 +1,23 @@ +{ ... }: +{ + frogeye = { + desktop = { + xorg = true; + x11_screens = [ "HDMI-1-0" "eDP1" ]; + maxVideoHeight = 1440; + numlock = true; + phasesBrightness = { + enable = true; + backlight = "intel_backlight"; + jour = 40000; + crepuscule = 10000; + nuit = 1; + }; + }; + dev = { + docker = true; + }; + extra = true; + gaming = true; + }; +} diff --git a/curacao/os.nix b/curacao/os.nix new file mode 100644 index 0000000..3bd283d --- /dev/null +++ b/curacao/os.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + imports = [ + ../os + ./options.nix + ./hardware.nix + ./dk.nix + ]; + + networking.hostName = "curacao"; +} diff --git a/curacao_test/hm.nix b/curacao_test/hm.nix new file mode 100644 index 0000000..b6f615d --- /dev/null +++ b/curacao_test/hm.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + imports = [ + ../hm + ../curacao/options.nix + ]; + + home.username = "gnix"; + home.homeDirectory = "/home/gnix"; + + frogeye.desktop.nixGLIntel = true; +} diff --git a/curacao_usb/dk.nix b/curacao_usb/dk.nix new file mode 100644 index 0000000..afcae03 --- /dev/null +++ b/curacao_usb/dk.nix @@ -0,0 +1,2 @@ +{ ... } @ args: +import ../dk/single_uefi_btrfs.nix (args // { id = "usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; name = "curacao_usb"; }) diff --git a/curacao_usb/os.nix b/curacao_usb/os.nix new file mode 100644 index 0000000..59d3b3d --- /dev/null +++ b/curacao_usb/os.nix @@ -0,0 +1,22 @@ +{ pkgs, config, ... }: +{ + imports = [ + ../os + ../curacao/options.nix + ../curacao/hardware.nix + ./dk.nix + ]; + + networking.hostName = "curacao_usb"; + + # It's a removable drive, so no touching EFI vars + # (quite a lot of stuff to set for that!) + boot.loader = { + efi.canTouchEfiVariables = false; + grub = { + efiInstallAsRemovable = true; + device = "nodev"; + }; + }; + +} diff --git a/dk/single_uefi_btrfs.nix b/dk/single_uefi_btrfs.nix new file mode 100644 index 0000000..965cc5b --- /dev/null +++ b/dk/single_uefi_btrfs.nix @@ -0,0 +1,66 @@ +{ id, name, passwordFile ? "/should_not_be_needed_in_this_context", ... }: +{ + disko.devices = { + disk = { + "${name}" = { + type = "disk"; + device = "/dev/disk/by-id/${id}"; + content = { + type = "gpt"; + partitions = { + ESP = { + # Needs enough to store multiple kernel generations + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "${name}"; + passwordFile = passwordFile; + settings = { + # Not having SSDs die fast is more important than crypto + # nerds that could potentially discover which filesystem I + # use from TRIM patterns + allowDiscards = true; + }; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/nixos" = { + mountpoint = "/"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = [ "compress=zstd" "relatime" ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + # Maybe later + # "/swap" = { + # mountpoint = "/.swapvol"; + # swap.swapfile.size = "20M"; + # }; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/face b/face deleted file mode 100644 index 8e4514c..0000000 Binary files a/face and /dev/null differ diff --git a/full/README.md b/full/README.md new file mode 100644 index 0000000..0f087b5 --- /dev/null +++ b/full/README.md @@ -0,0 +1,6 @@ +# full profile + +Fake configuration that contains everything I could ever need, +used for debugging. +Can't build a full system due to not having a filesystem / bootloader configuration, +build as a VM (without bootloader). diff --git a/full/options.nix b/full/options.nix new file mode 100644 index 0000000..3592025 --- /dev/null +++ b/full/options.nix @@ -0,0 +1,17 @@ +{ ... }: +{ + frogeye = { + desktop.xorg = true; + dev = { + ansible = true; + c = true; + docker = true; + fpga = true; + perl = true; + php = true; + python = true; + }; + extra = true; + gaming = true; + }; +} diff --git a/full/os.nix b/full/os.nix new file mode 100644 index 0000000..e74e854 --- /dev/null +++ b/full/os.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + imports = [ + ../os + ./options.nix + ]; + + # Create a different disk image depending on the architecture + networking.hostName = "${builtins.currentSystem}"; +} diff --git a/config/i3/batteryNotify b/hm/batteryNotify.sh similarity index 92% rename from config/i3/batteryNotify rename to hm/batteryNotify.sh index a6a1ed2..73376a5 100755 --- a/config/i3/batteryNotify +++ b/hm/batteryNotify.sh @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - BATT="/sys/class/power_supply/BAT0" LOW=10 CRIT=3 @@ -25,10 +23,10 @@ function computeState() { if [ "$acpiStatus" == "Discharging" ] then - if [ $acpiCapacity -le $CRIT ] + if [ "$acpiCapacity" -le $CRIT ] then setState "CRIT" -u critical -i battery-caution "Battery level is critical" "$acpiCapacity %" - elif [ $acpiCapacity -le $LOW ] + elif [ "$acpiCapacity" -le $LOW ] then setState "LOW" -u critical -i battery-low "Battery level is low" "$acpiCapacity %" else diff --git a/hm/common.nix b/hm/common.nix new file mode 100644 index 0000000..746ac95 --- /dev/null +++ b/hm/common.nix @@ -0,0 +1,492 @@ +{ pkgs, config, lib, ... }: +let + direnv = { + # Environment variables making programs stay out of $HOME, but also needing we create a directory for them + CARGOHOME = "${config.xdg.cacheHome}/cargo"; # There are config in there that we can version if one want + CCACHE_DIR = "${config.xdg.cacheHome}/ccache"; # The config file alone seems to be not enough + DASHT_DOCSETS_DIR = "${config.xdg.cacheHome}/dash_docsets"; + GOPATH = "${config.xdg.cacheHome}/go"; + GRADLE_USER_HOME = "${config.xdg.cacheHome}/gradle"; + MIX_ARCHIVES = "${config.xdg.cacheHome}/mix/archives"; + MONO_GAC_PREFIX = "${config.xdg.cacheHome}/mono"; + npm_config_cache = "${config.xdg.cacheHome}/npm"; + PARALLEL_HOME = "${config.xdg.cacheHome}/parallel"; + TERMINFO = "${config.xdg.configHome}/terminfo"; + WINEPREFIX = "${config.xdg.stateHome}/wineprefix/default"; + YARN_CACHE_FOLDER = "${config.xdg.cacheHome}/yarn"; + # TODO Some of that stuff is not really relavant any more + }; +in +{ + + nixpkgs.config.allowUnfree = true; + + programs = + let + commonRc = lib.strings.concatLines ([ + '' + # Colored ls + # TODO Doesn't allow completion. Check out lsd instead + _colored_ls() { + ${pkgs.coreutils}/bin/ls -lh --color=always $@ | ${pkgs.gawk}/bin/awk ' + BEGIN { + FPAT = "([[:space:]]*[^[:space:]]+)"; + OFS = ""; + } + { + $1 = "\033[36m" $1 "\033[0m"; + $2 = "\033[31m" $2 "\033[0m"; + $3 = "\033[32m" $3 "\033[0m"; + $4 = "\033[32m" $4 "\033[0m"; + $5 = "\033[31m" $5 "\033[0m"; + $6 = "\033[34m" $6 "\033[0m"; + $7 = "\033[34m" $7 "\033[0m"; + print + } + ' + } + alias ll="_colored_ls" + alias la="_colored_ls -a" + '' + ] ++ map (d: "mkdir -p ${d}") (builtins.attrValues direnv)); + # TODO Those directory creations should probably done on home-manager activation + commonSessionVariables = { + TIME_STYLE = "+%Y-%m-%d %H:%M:%S"; + # Less colors + LESS = "-R"; + LESS_TERMCAP_mb = "$'\E[1;31m'"; # begin blink + LESS_TERMCAP_md = "$'\E[1;36m'"; # begin bold + LESS_TERMCAP_me = "$'\E[0m'"; # reset bold/blink + LESS_TERMCAP_so = "$'\E[01;44;33m'"; # begin reverse video + LESS_TERMCAP_se = "$'\E[0m'"; # reset reverse video + LESS_TERMCAP_us = "$'\E[1;32m'"; # begin underline + LESS_TERMCAP_ue = "$'\E[0m'"; # reset underline + # Fzf + FZF_COMPLETION_OPTS = "${lib.strings.concatStringsSep " " config.programs.fzf.fileWidgetOptions}"; + }; + treatsHomeAsJunk = [ + # Programs that think $HOME is a reasonable place to put their junk + # and don't allow the user to change those questionable choices + "adb" + "audacity" + "binwalk" # Should use .config according to the GitHub code though + "cabal" # TODO May have options but last time I tried it it crashed + "cmake" + "ddd" + "ghidra" + "itch" + "simplescreenrecorder" # Easy fix https://github.com/MaartenBaert/ssr/blob/1556ae456e833992fb6d39d40f7c7d7c337a4160/src/Main.cpp#L252 + "vd" + "wpa_cli" + # TODO Maybe we can do something about node-gyp + ]; + commonShellAliases = { + # Completion for existing commands + ls = "ls -h --color=auto"; + mkdir = "mkdir -v"; + # cp = "cp -i"; # Disabled because conflicts with the ZSH/Bash one. This separation is confusing I swear. + mv = "mv -iv"; + free = "free -h"; + df = "df -h"; + ffmpeg = "ffmpeg -hide_banner"; + ffprobe = "ffprobe -hide_banner"; + ffplay = "ffplay -hide_banner"; + # TODO Add ipython --no-confirm-exit --pdb + + # Frequent mistakes + sl = "ls"; + al = "la"; + mdkir = "mkdir"; + systemclt = "systemctl"; + please = "sudo"; + + # Shortcuts for commonly used commands + # ll = "ls -l"; # Disabled because would overwrite the colored one + # la = "ls -la"; # Eh maybe it's not that bad, but for now let's keep compatibility + s = "sudo -s -E"; + + + # Give additional config to those programs, and not have them in my path + bower = "bower --config.storage.packages=${config.xdg.cacheHome}/bower/packages --config.storage.registry=${config.xdg.cacheHome}/bower/registry --config.storage.links=${config.xdg.cacheHome}/bower/links"; + gdb = "gdb -x ${config.xdg.configHome}/gdbinit"; + iftop = "iftop -c ${config.xdg.configHome}/iftoprc"; + lmms = "lmms --config ${config.xdg.configHome}/lmmsrc.xml"; + + # Preference + vi = "nvim"; + vim = "nvim"; + wol = "wakeonlan"; # TODO Really, isn't wol better? Also wtf Arch aliases to pass because neither is installed anyways x) + mutt = "neomutt"; + + # Bash/Zsh only + cp = "cp -i --reflink=auto"; + grep = "grep --color=auto"; + dd = "dd status=progress"; + rm = "rm -v --one-file-system"; + # free = "free -m"; # Disabled because... no? Why? + diff = "diff --color=auto"; + dmesg = "dmesg --ctime"; + wget = "wget --hsts-file ${config.xdg.cacheHome}/wget-hsts"; + + # Imported from scripts + rms = ''${pkgs.findutils}/bin/find . -name "*.sync-conflict-*" -delete''; # Remove syncthing conflict files + pw = ''${pkgs.pwgen}/bin/pwgen 32 -y''; # Generate passwords. ln((26*2+10)**32)/ln(2) ≅ 190 bits of entropy + newestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | tail''; + oldestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | head''; + tracefiles = ''${pkgs.strace}/bin/strace -f -t -e trace=file''; + } // lib.attrsets.mergeAttrsList (map (p: { "${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}"; }) treatsHomeAsJunk); + # TODO Maybe make nixpkg wrapper instead? So it also works from dmenu + # Could also accept my fate... Home-manager doesn't necessarily make it easy to put things out of the home directory + historySize = 100000; + historyFile = "${config.xdg.cacheHome}/shell_history"; + in + { + + home-manager.enable = true; + bash = { + enable = true; + bashrcExtra = lib.strings.concatLines [ + commonRc + '' + shopt -s expand_aliases + shopt -s histappend + '' + ]; + sessionVariables = commonSessionVariables; + historySize = historySize; + historyFile = historyFile; + historyFileSize = historySize; + historyControl = [ "erasedups" "ignoredups" "ignorespace" ]; + shellAliases = commonShellAliases // config.frogeye.shellAliases; + }; + zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + syntaxHighlighting.enable = true; + historySubstringSearch.enable = true; + initExtra = lib.strings.concatLines [ + commonRc + (builtins.readFile ./zshrc.sh) + ]; + defaultKeymap = "viins"; + history = { + size = historySize; + save = historySize; + path = historyFile; + expireDuplicatesFirst = true; + }; + sessionVariables = commonSessionVariables; + shellAliases = commonShellAliases // config.frogeye.shellAliases; + }; + dircolors = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + # UPST This thing put stuff in .dircolors when it actually doesn't have to + }; + powerline-go = { + enable = true; + modules = [ "user" "host" "venv" "cwd" "perms" "git" ]; + modulesRight = [ "jobs" "exit" "duration" "load" ]; + settings = { + colorize-hostname = true; + max-width = 25; + cwd-max-dir-size = 10; + duration = "$( test -n \"$__TIMER\" && echo $(( $EPOCHREALTIME - $\{__TIMER:-EPOCHREALTIME})) || echo 0 )"; + # UPST Implement this properly in home-manager, would allow for bash support + }; + extraUpdatePS1 = ''unset __TIMER''; + }; + gpg = { + enable = true; + homedir = "${config.xdg.stateHome}/gnupg"; + settings = { + # Remove fluff + no-greeting = true; + no-emit-version = true; + no-comments = true; + # Output format that I prefer + keyid-format = "0xlong"; + # Show fingerprints + with-fingerprint = true; + # Make sure to show if key is invalid + # (should be default on most platform, + # but just to be sure) + list-options = "show-uid-validity"; + verify-options = "show-uid-validity"; + # Stronger algorithm (https://wiki.archlinux.org/title/GnuPG#Different_algorithm) + personal-digest-preferences = "SHA512"; + cert-digest-algo = "SHA512"; + default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed"; + personal-cipher-preferences = "TWOFISH CAMELLIA256 AES 3DES"; + }; + publicKeys = [{ + source = builtins.fetchurl { + url = "https://keys.openpgp.org/vks/v1/by-fingerprint/4FBA930D314A03215E2CDB0A8312C8CAC1BAC289"; + sha256 = "sha256:10y9xqcy1vyk2p8baay14p3vwdnlwynk0fvfbika65hz2z8yw2cm"; + }; + trust = "ultimate"; + }]; + }; + fzf = { + enable = true; + enableZshIntegration = true; + defaultOptions = [ "--height 40%" "--layout=default" ]; + fileWidgetOptions = [ "--preview '[[ -d {} ]] && ${pkgs.coreutils}/bin/ls -l --color=always {} || [[ \$(${pkgs.file}/bin/file --mime {}) =~ binary ]] && ${pkgs.file}/bin/file --brief {} || (${pkgs.highlight}/bin/highlight -O ansi -l {} || coderay {} || rougify {} || ${pkgs.coreutils}/bin/cat {}) 2> /dev/null | head -500'" ]; + # file and friends are not in PATH by default... so here we want aboslute paths, which means those won't get reloaded. Meh. + }; + # TODO highlight or bat + nix-index = { + enable = false; # TODO Index is impossible to generate, should use https://github.com/nix-community/nix-index-database + # but got no luck without flakes + enableZshIntegration = true; + }; + less.enable = true; + git = { + enable = true; + aliases = { + "git" = "!exec git"; # In case I write one too many git + }; + ignores = [ + "*.swp" + "*.swo" + "*.ycm_extra_conf.py" + "tags" + ".mypy_cache" + ]; + lfs.enable = true; + userEmail = lib.mkDefault "geoffrey@frogeye.fr"; + userName = lib.mkDefault "Geoffrey Frogeye"; + extraConfig = { + core = { + editor = "nvim"; + }; + push = { + default = "matching"; + }; + pull = { + ff = "only"; + }; + } // lib.optionalAttrs config.frogeye.desktop.xorg { + diff.tool = "meld"; + difftool.prompt = false; + "difftool \"meld\"".cmd = "${pkgs.meld}/bin/meld \"$LOCAL\" \"$REMOTE\""; + # This escapes quotes, which isn't the case in the original, hoping this isn't an issue. + }; + # TODO Delta syntax highlighter... and other cool-looking options? + }; + readline = { + enable = true; + variables = { + "bell-style" = "none"; + "colored-completion-prefix" = true; + "colored-stats" = true; + "completion-ignore-case" = true; + "completion-query-items" = 200; + "editing-mode" = "vi"; + "history-preserve-point" = true; + "history-size" = 10000; + "horizontal-scroll-mode" = false; + "mark-directories" = true; + "mark-modified-lines" = false; + "mark-symlinked-directories" = true; + "match-hidden-files" = true; + "menu-complete-display-prefix" = true; + "page-completions" = true; + "print-completions-horizontally" = false; + "revert-all-at-newline" = false; + "show-all-if-ambiguous" = true; + "show-all-if-unmodified" = true; + "show-mode-in-prompt" = true; + "skip-completed-text" = true; + "visible-stats" = false; + }; + extraConfig = builtins.readFile ./inputrc; + }; + tmux = + let + themepack = pkgs.tmuxPlugins.mkTmuxPlugin + rec { + pluginName = "tmux-themepack"; + version = "1.1.0"; + rtpFilePath = "themepack.tmux"; + src = pkgs.fetchFromGitHub { + owner = "jimeh"; + repo = "tmux-themepack"; + rev = "${version}"; + sha256 = "f6y92kYsKDFanNx5ATx4BkaB/E7UrmyIHU/5Z01otQE="; + }; + }; + in + { + enable = true; + mouse = false; + clock24 = true; + # TODO Vim mode? + plugins = with pkgs.tmuxPlugins; [ + sensible + ]; + extraConfig = builtins.readFile ./tmux.conf + "source-file ${themepack}/share/tmux-plugins/tmux-themepack/powerline/default/green.tmuxtheme\n"; + }; + translate-shell.enable = true; # TODO Cool config? + }; + services = { + gpg-agent = { + enable = true; # TODO Consider not enabling it when not having any private key + enableBashIntegration = true; + enableZshIntegration = true; + pinentryFlavor = "gtk2"; # Falls back to curses when needed + }; + }; + xdg = { + configFile = { + "ccache.conf" = { + text = "ccache_dir = ${config.xdg.cacheHome}/ccache"; + }; + "gdbinit" = { + text = '' + define hook-quit + set confirm off + end + ''; + }; + "iftoprc" = { + text = '' + port-resolution: no + promiscuous: no + port-display: on + link-local: yes + use-bytes: yes + show-totals: yes + log-scale: yes + ''; + }; + "pythonstartup.py" = { + text = (builtins.readFile ./pythonstartup.py); + }; + "screenrc" = { + text = (builtins.readFile ./screenrc); + }; + }; + }; + home = { + stateVersion = "23.11"; + language = { + base = "en_US.UTF-8"; + # time = "en_DK.UTF-8"; # TODO Disabled because complaints during nixos-rebuild switch + }; + packages = with pkgs; [ + # dotfiles dependencies + coreutils + bash + gnugrep + gnused + gnutar + openssl + wget + curl + python3Packages.pip + rename + which + + # shell + zsh-completions + nix-zsh-completions + zsh-history-substring-search + powerline-go + + # terminal essentials + moreutils + man + unzip + unrar + p7zip + + # remote + openssh + rsync + borgbackup + + # cleanup + ncdu + jdupes + duperemove + + # local monitoring + htop + iotop + iftop + lsof + strace + pv + progress + speedtest-cli + + # multimedia toolbox + sox + imagemagick + + # password + pass + pwgen + + # Mail + isync + msmtp + notmuch + neomutt + lynx + + # Organisation + vdirsyncer + khard + khal + todoman + syncthing + + # TODO Lots of redundancy with other way things are defined here + + ] ++ lib.optionals pkgs.stdenv.isx86_64 [ + nodePackages.insect + # TODO Use whatever replaces insect, hopefully that works on aarch64 + ]; + sessionVariables = { + # Favourite commands + PAGER = "${pkgs.less}/bin/less"; + EDITOR = "${pkgs.neovim}/bin/nvim"; + + # Extra config + BOOT9_PATH = "${config.xdg.dataHome}/citra-emu/sysdata/boot9.bin"; + CCACHE_CONFIGPATH = "${config.xdg.configHome}/ccache.conf"; + # INPUTRC = "${config.xdg.configHome}/inputrc"; # UPST Will use programs.readline, but doesn't allow path setting + LESSHISTFILE = "${config.xdg.stateHome}/lesshst"; + NODE_REPL_HISTORY = "${config.xdg.cacheHome}/node_repl_history"; + PYTHONSTARTUP = "${config.xdg.configHome}/pythonstartup.py"; + # TODO I think we're not using the urxvt daemon on purpose? + # TODO this should be desktop only, as a few things are too. + SCREENRC = "${config.xdg.configHome}/screenrc"; + SQLITE_HISTFILE = "${config.xdg.stateHome}/sqlite_history"; + YARN_DISABLE_SELF_UPDATE_CHECK = "true"; # This also disable the creation of a ~/.yarnrc file + } // lib.optionalAttrs config.frogeye.desktop.xorg { + # Favourite commands + VISUAL = "${pkgs.neovim}/bin/nvim"; + BROWSER = "${config.programs.qutebrowser.package}/bin/qutebrowser"; + + # Extra config + RXVT_SOCKET = "${config.xdg.stateHome}/urxvtd"; # Used to want -$HOME suffix, hopefullt this isn't needed + # XAUTHORITY = "${config.xdg.configHome}/Xauthority"; # Disabled as this causes lock-ups with DMs + } // direnv; + # TODO Session variables only get reloaded on login I think. + sessionPath = [ + "${config.home.homeDirectory}/.local/bin" + "${config.home.sessionVariables.GOPATH}" + (builtins.toString ./scripts) + ]; + file = { + ".face" = { + source = pkgs.runCommand "face.png" { } "${pkgs.inkscape}/bin/inkscape ${./face.svg} -w 1024 -o $out"; + }; + }; + }; +} diff --git a/hm/default.nix b/hm/default.nix new file mode 100644 index 0000000..13087c4 --- /dev/null +++ b/hm/default.nix @@ -0,0 +1,14 @@ +{ ... }: +{ + imports = [ + ../options.nix + ./common.nix + ./desktop.nix + ./dev.nix + ./extra.nix + ./gaming + ./ssh.nix + ./style.nix + ./vim.nix + ]; +} diff --git a/hm/desktop.nix b/hm/desktop.nix new file mode 100644 index 0000000..e6a720e --- /dev/null +++ b/hm/desktop.nix @@ -0,0 +1,691 @@ +{ pkgs, config, lib, ... }: +let + nixgl = import + (builtins.fetchGit { + url = "https://github.com/nix-community/nixGL"; + rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5"; + }) + { }; + nixGLIntelPrefix = "${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel "; + wmPrefix = "${lib.optionalString config.frogeye.desktop.nixGLIntel nixGLIntelPrefix}"; +in +{ + imports = [ + ./frobar + ]; + config = lib.mkIf config.frogeye.desktop.xorg { + frogeye.shellAliases = { + noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise''; + beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null''; + + # n = "$HOME/.config/i3/terminal & disown"; # Not used anymore since alacritty daemon mode doesn't preserve environment variables + x = "startx ${config.home.homeDirectory}/${config.xsession.scriptPath}; logout"; + # TODO Is it possible to not start nvidia stuff on nixOS? + # nx = "nvidia-xrun ${config.xsession.scriptPath}; sudo systemctl start nvidia-xrun-pm; logout"; + }; + xsession = { + enable = true; + # Not using config.xdg.configHome because it needs to be $HOME-relative paths and path manipulation is hard + scriptPath = ".config/xsession"; + profilePath = ".config/xprofile"; + windowManager = { + command = lib.mkForce "${wmPrefix} ${config.xsession.windowManager.i3.package}/bin/i3"; + i3 = { + enable = true; + config = + let + # lockColors = with config.lib.stylix.colors.withHashtag; { a = base00; b = base01; d = base00; }; # Black or White, depending on current theme + # lockColors = with config.lib.stylix.colors.withHashtag; { a = base0A; b = base0B; d = base00; }; # Green + Yellow + lockColors = { a = "#82a401"; b = "#466c01"; d = "#648901"; }; # Old + lockSvg = pkgs.writeText "lock.svg" ""; + lockPng = pkgs.runCommand "lock.png" { } "${pkgs.imagemagick}/bin/convert ${lockSvg} $out"; + locker = pkgs.writeShellScript "i3-locker" + '' + # Remove SSH and GPG keys from keystores + ${pkgs.openssh}/bin/ssh-add -D + echo RELOADAGENT | ${pkgs.gnupg}/bin/gpg-connect-agent + ${pkgs.coreutils}/bin/rm -rf "/tmp/cached_pass_$UID" + + ${pkgs.lightdm}/bin/dm-tool lock + # TODO Does that work for all DMs? + if [ $? -ne 0 ]; then + if [ -d ${config.xdg.cacheHome}/lockpatterns ] + then + pattern=$(${pkgs.findutils} ${config.xdg.cacheHome}/lockpatterns | sort -R | head -1) + else + pattern=${lockPng} + fi + revert() { + ${pkgs.xorg.xset}/bin/xset dpms 0 0 0 + } + trap revert SIGHUP SIGINT SIGTERM + ${pkgs.xorg.xset}/bin/xset dpms 5 5 5 + ${pkgs.i3lock}/bin/i3lock --nofork --color ${builtins.substring 1 6 lockColors.d} --image=$pattern --tiling --ignore-empty-password + revert + fi + ''; + focus = "exec ${ pkgs.writeShellScript "i3-focus-window" + '' + WINDOW=`${pkgs.xdotool}/bin/xdotool getwindowfocus` + eval `${pkgs.xdotool}/bin/xdotool getwindowgeometry --shell $WINDOW` # this brings in variables WIDTH and HEIGHT + TX=`${pkgs.coreutils}/bin/expr $WIDTH / 2` + TY=`${pkgs.coreutils}/bin/expr $HEIGHT / 2` + ${pkgs.xdotool}/bin/xdotool mousemove -window $WINDOW $TX $TY + '' + }"; + mode_system = "[L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction"; + mode_resize = "Resize"; + mode_pres_main = "Presentation (main display)"; + mode_pres_sec = "Presentation (secondary display)"; + mode_screen = "Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default"; + mode_temp = "Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue"; + in + { + modifier = "Mod4"; + terminal = "alacritty"; + colors = let ignore = "#ff00ff"; in + with config.lib.stylix.colors.withHashtag; lib.mkForce { + focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; }; + focusedInactive = { border = base02; background = base02; text = base05; indicator = base02; childBorder = base02; }; + unfocused = { border = base05; background = base04; text = base00; indicator = base04; childBorder = base00; }; + urgent = { border = base0F; background = base08; text = base00; indicator = base08; childBorder = base0F; }; + placeholder = { border = ignore; background = base00; text = base05; indicator = ignore; childBorder = base00; }; + background = base07; + # I set the color of the active tab as the the background color of the terminal so they merge together. + }; + focus.followMouse = false; + keybindings = + let + mod = config.xsession.windowManager.i3.config.modifier; + rofi = "exec --no-startup-id ${config.programs.rofi.package}/bin/rofi"; + pactl = "exec ${pkgs.pulseaudio}/bin/pactl"; # TODO Use NixOS package if using NixOS + screenshots_dir = config.xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR; + scrot = "${pkgs.scrot}/bin/scrot --exec '${pkgs.coreutils}/bin/mv $f ${screenshots_dir}/ && ${pkgs.optipng}/bin/optipng ${screenshots_dir}/$f'"; + in + { + # Compatibility layer for people coming from other backgrounds + "Mod1+Tab" = "${rofi} -modi window -show window"; + "Mod1+F2" = "${rofi} -modi drun -show drun"; + "Mod1+F4" = "kill"; + # kill focused window + "${mod}+z" = "kill"; + button2 = "kill"; + # Rofi + "${mod}+c" = "exec --no-startup-id ${pkgs.rofi-pass}/bin/rofi-pass --last-used"; + # TODO Try autopass.cr + # 23.11 config.programs.rofi.pass.package + "${mod}+i" = "exec --no-startup-id ${pkgs.rofimoji}/bin/rofimoji"; + "${mod}+plus" = "${rofi} -modi ssh -show ssh"; + "${mod}+ù" = "${rofi} -modi ssh -show ssh -ssh-command '{terminal} -e {ssh-client} {host} -t \"sudo -s -E\"'"; + # TODO In which keyboard layout? + "${mod}+Tab" = "${rofi} -modi window -show window"; + # start program launcher + "${mod}+d" = "${rofi} -modi run -show run"; + "${mod}+Shift+d" = "${rofi} -modi drun -show drun"; + # Start Applications + "${mod}+Return" = "exec ${ + pkgs.writeShellScript "terminal" "${config.programs.alacritty.package}/bin/alacritty msg create-window || exec ${config.programs.alacritty.package}/bin/alacritty -e zsh" + # -e zsh is for systems where I can't configure my user's shell + # TODO Is a shell script even required? + }"; + "${mod}+Shift+Return" = "exec ${config.programs.urxvt.package}/bin/urxvt"; + "${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/thunar"; + "${mod}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore --backend=webengine"; + # TODO --backend not useful anymore + # Volume control + "XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioLowerVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; + "XF86AudioMute" = "${pactl} set-sink-mute @DEFAULT_SINK@ true"; + "${mod}+F7" = "${pactl} suspend-sink @DEFAULT_SINK@ 1; ${pactl} suspend-sink @DEFAULT_SINK@ 0"; # Re-synchronize bluetooth headset + "${mod}+F11" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; + "${mod}+F12" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; + # TODO Find pacmixer? + # Media control + "XF86AudioPrev" = "exec ${pkgs.mpc-cli}/bin/mpc prev"; + "XF86AudioPlay" = "exec ${pkgs.mpc-cli}/bin/mpc toggle"; + "XF86AudioNext" = "exec ${pkgs.mpc-cli}/bin/mpc next"; + # Misc + "${mod}+F10" = "exec ${ pkgs.writeShellScript "show-keyboard-layout" + '' + layout=`${pkgs.xorg.setxkbmap}/bin/setxkbmap -query | ${pkgs.gnugrep}/bin/grep ^layout: | ${pkgs.gawk}/bin/awk '{ print $2 }'` + ${pkgs.libgnomekbd}/bin/gkbd-keyboard-display -l $layout + '' + }"; + # Screenshots + "Print" = "exec ${scrot} --focused"; + "${mod}+Print" = "exec ${scrot}"; + "Ctrl+Print" = "exec ${pkgs.coreutils}/bin/sleep 1 && ${scrot} --select"; + # TODO Try using bindsym --release instead of sleep + # change focus + "${mod}+h" = "focus left; ${focus}"; + "${mod}+j" = "focus down; ${focus}"; + "${mod}+k" = "focus up; ${focus}"; + "${mod}+l" = "focus right; ${focus}"; + # move focused window + "${mod}+Shift+h" = "move left; ${focus}"; + "${mod}+Shift+j" = "move down; ${focus}"; + "${mod}+Shift+k" = "move up; ${focus}"; + "${mod}+Shift+l" = "move right; ${focus}"; + # workspace back and forth (with/without active container) + "${mod}+b" = "workspace back_and_forth; ${focus}"; + "${mod}+Shift+b" = "move container to workspace back_and_forth; workspace back_and_forth; ${focus}"; + # Change container layout + "${mod}+g" = "split h; ${focus}"; + "${mod}+v" = "split v; ${focus}"; + "${mod}+f" = "fullscreen toggle; ${focus}"; + "${mod}+s" = "layout stacking; ${focus}"; + "${mod}+w" = "layout tabbed; ${focus}"; + "${mod}+e" = "layout toggle split; ${focus}"; + "${mod}+Shift+space" = "floating toggle; ${focus}"; + # Focus container + "${mod}+space" = "focus mode_toggle; ${focus}"; + "${mod}+a" = "focus parent; ${focus}"; + "${mod}+q" = "focus child; ${focus}"; + # Switch to workspace + "${mod}+1" = "workspace 1; ${focus}"; + "${mod}+2" = "workspace 2; ${focus}"; + "${mod}+3" = "workspace 3; ${focus}"; + "${mod}+4" = "workspace 4; ${focus}"; + "${mod}+5" = "workspace 5; ${focus}"; + "${mod}+6" = "workspace 6; ${focus}"; + "${mod}+7" = "workspace 7; ${focus}"; + "${mod}+8" = "workspace 8; ${focus}"; + "${mod}+9" = "workspace 9; ${focus}"; + "${mod}+0" = "workspace 10; ${focus}"; + # TODO Prevent repetitions, see workspace assignation for example + #navigate workspaces next / previous + "${mod}+Ctrl+h" = "workspace prev_on_output; ${focus}"; + "${mod}+Ctrl+l" = "workspace next_on_output; ${focus}"; + "${mod}+Ctrl+j" = "workspace prev; ${focus}"; + "${mod}+Ctrl+k" = "workspace next; ${focus}"; + # Move to workspace next / previous with focused container + "${mod}+Ctrl+Shift+h" = "move container to workspace prev_on_output; workspace prev_on_output; ${focus}"; + "${mod}+Ctrl+Shift+l" = "move container to workspace next_on_output; workspace next_on_output; ${focus}"; + "${mod}+Ctrl+Shift+j" = "move container to workspace prev; workspace prev; ${focus}"; + "${mod}+Ctrl+Shift+k" = "move container to workspace next; workspace next; ${focus}"; + # move focused container to workspace + "${mod}+ctrl+1" = "move container to workspace 1; ${focus}"; + "${mod}+ctrl+2" = "move container to workspace 2; ${focus}"; + "${mod}+ctrl+3" = "move container to workspace 3; ${focus}"; + "${mod}+ctrl+4" = "move container to workspace 4; ${focus}"; + "${mod}+ctrl+5" = "move container to workspace 5; ${focus}"; + "${mod}+ctrl+6" = "move container to workspace 6; ${focus}"; + "${mod}+ctrl+7" = "move container to workspace 7; ${focus}"; + "${mod}+ctrl+8" = "move container to workspace 8; ${focus}"; + "${mod}+ctrl+9" = "move container to workspace 9; ${focus}"; + "${mod}+ctrl+0" = "move container to workspace 10; ${focus}"; + # move to workspace with focused container + "${mod}+shift+1" = "move container to workspace 1; workspace 1; ${focus}"; + "${mod}+shift+2" = "move container to workspace 2; workspace 2; ${focus}"; + "${mod}+shift+3" = "move container to workspace 3; workspace 3; ${focus}"; + "${mod}+shift+4" = "move container to workspace 4; workspace 4; ${focus}"; + "${mod}+shift+5" = "move container to workspace 5; workspace 5; ${focus}"; + "${mod}+shift+6" = "move container to workspace 6; workspace 6; ${focus}"; + "${mod}+shift+7" = "move container to workspace 7; workspace 7; ${focus}"; + "${mod}+shift+8" = "move container to workspace 8; workspace 8; ${focus}"; + "${mod}+shift+9" = "move container to workspace 9; workspace 9; ${focus}"; + "${mod}+shift+0" = "move container to workspace 10; workspace 10; ${focus}"; + # move workspaces to screen (arrow keys) + "${mod}+ctrl+shift+Right" = "move workspace to output right; ${focus}"; + "${mod}+ctrl+shift+Left" = "move workspace to output left; ${focus}"; + "${mod}+Ctrl+Shift+Up" = "move workspace to output above; ${focus}"; + "${mod}+Ctrl+Shift+Down" = "move workspace to output below; ${focus}"; + # i3 control + "${mod}+Shift+c" = "reload"; + "${mod}+Shift+r" = "restart"; + "${mod}+Shift+e" = "exit"; + # Screen off commands + "${mod}+F1" = "exec --no-startup-id ${pkgs.bash}/bin/sh -c \"${pkgs.coreutils}/bin/sleep .25 && ${pkgs.xorg.xset}/bin/xset dpms force off\""; + # TODO --release? + "${mod}+F4" = "exec --no-startup-id ${pkgs.xautolock}/bin/xautolock -disable"; + "${mod}+F5" = "exec --no-startup-id ${pkgs.xautolock}/bin/xautolock -enable"; + # Modes + "${mod}+Escape" = "mode ${mode_system}"; + "${mod}+r" = "mode ${mode_resize}"; + "${mod}+Shift+p" = "mode ${mode_pres_main}"; + "${mod}+t" = "mode ${mode_screen}"; + "${mod}+y" = "mode ${mode_temp}"; + }; + modes = let return_bindings = { + "Return" = "mode default"; + "Escape" = "mode default"; + }; in + { + "${mode_system}" = { + "l" = "exec --no-startup-id exec ${locker}, mode default"; + "e" = "exit, mode default"; + "s" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl suspend --check-inhibitors=no, mode default"; + "h" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl hibernate, mode default"; + "r" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl reboot, mode default"; + "p" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl poweroff -i, mode default"; + } // return_bindings; + "${mode_resize}" = { + "h" = "resize shrink width 10 px or 10 ppt; ${focus}"; + "j" = "resize grow height 10 px or 10 ppt; ${focus}"; + "k" = "resize shrink height 10 px or 10 ppt; ${focus}"; + "l" = "resize grow width 10 px or 10 ppt; ${focus}"; + } // return_bindings; + "${mode_pres_main}" = { + "b" = "workspace 3, workspace 4, mode ${mode_pres_sec}"; + "q" = "mode default"; + "Return" = "mode default"; + }; + "${mode_pres_sec}" = { + "b" = "workspace 1, workspace 2, mode ${mode_pres_main}"; + "q" = "mode default"; + "Return" = "mode default"; + }; + "${mode_screen}" = + let + builtin_configs = [ "off" "common" "clone-largest" "horizontal" "vertical" "horizontal-reverse" "vertical-reverse" ]; + autorandrmenu = { title, option, builtin ? false }: pkgs.writeShellScript "autorandrmenu" + '' + shopt -s nullglob globstar + profiles="${if builtin then lib.strings.concatLines builtin_configs else ""}$(${pkgs.autorandr}/bin/autorandr | ${pkgs.gawk}/bin/awk '{ print $1 }')" + profile="$(echo "$profiles" | ${config.programs.rofi.package}/bin/rofi -dmenu -p "${title}")" + [[ -n "$profile" ]] || exit + ${pkgs.autorandr}/bin/autorandr ${option} "$profile" + ''; + in + { + "a" = "exec ${pkgs.autorandr}/bin/autorandr --change --force, mode default"; + "l" = "exec ${autorandrmenu {title="Load profile"; option="--load"; builtin = true;}}, mode default"; + "s" = "exec ${autorandrmenu {title="Save profile"; option="--save";}}, mode default"; + "r" = "exec ${autorandrmenu {title="Remove profile"; option="--remove";}}, mode default"; + "d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default"; + } // return_bindings; + "${mode_temp}" = { + "r" = "exec ${pkgs.sct}/bin/sct 1000"; + "d" = "exec ${pkgs.sct}/bin/sct 2000"; + "c" = "exec ${pkgs.sct}/bin/sct 4500"; + "o" = "exec ${pkgs.sct}/bin/sct"; + "a" = "exec ${pkgs.sct}/bin/sct 8000"; + "b" = "exec ${pkgs.sct}/bin/sct 10000"; + } // return_bindings; + }; + window = { + hideEdgeBorders = "both"; + titlebar = false; # So that single-container screens are basically almost fullscreen + commands = [ + # Open specific applications in floating mode + { criteria = { class = "Firefox"; }; command = "layout tabbed"; } # Doesn't seem to work anymore + { criteria = { class = "qutebrowser"; }; command = "layout tabbed"; } + { criteria = { title = "^pdfpc.*"; window_role = "presenter"; }; command = "move to output left, fullscreen"; } + { criteria = { title = "^pdfpc.*"; window_role = "presentation"; }; command = "move to output right, fullscreen"; } + # switch to workspace with urgent window automatically + { criteria = { urgent = "latest"; }; command = "focus"; } + ]; + }; + floating = { + criteria = [ + { title = "pacmixer"; } + { window_role = "pop-up"; } + { window_role = "task_dialog"; } + ]; + }; + startup = [ + # Lock screen after 10 minutes + { notification = false; command = "${pkgs.xautolock}/bin/xautolock -time 10 -locker '${pkgs.xorg.xset}/bin/xset dpms force standby' -killtime 1 -killer ${locker}"; } + { + notification = false; + command = "${pkgs.writeShellApplication { + name = "batteryNotify"; + runtimeInputs = with pkgs; [coreutils libnotify]; + text = builtins.readFile ./batteryNotify.sh; + # TODO Use batsignal instead? + # TODO Only on computers with battery + }}/bin/batteryNotify"; + } + # TODO There's a services.screen-locker.xautolock but not sure it can match the above command + ]; + workspaceLayout = "tabbed"; + focus.mouseWarping = true; # i3 only supports warping to workspace, hence ${focus} + workspaceOutputAssign = + let + x11_screens = config.frogeye.desktop.x11_screens; + workspaces = map (i: { name = toString i; key = toString (lib.mod i 10); }) (lib.lists.range 1 10); + forEachWorkspace = f: map (w: f { w = w; workspace = ((builtins.elemAt workspaces w)); }) (lib.lists.range 0 ((builtins.length workspaces) - 1)); + in + forEachWorkspace ({ w, workspace }: { output = builtins.elemAt x11_screens (lib.mod w (builtins.length x11_screens)); workspace = workspace.name; }); + }; + }; + }; + numlock.enable = config.frogeye.desktop.numlock; + }; + + programs = { + # Browser + qutebrowser = { + enable = true; + keyBindings = { + normal = { + # Match tab behaviour to i3. Not that I use them. + "H" = "tab-prev"; + "J" = "back"; + "K" = "forward"; + "L" = "tab-next"; + # "T" = null; + "af" = "spawn --userscript freshrss"; # TODO Broken? + "as" = "spawn --userscript shaarli"; # TODO I don't use shaarli anymore + # "d" = null; + "u" = "undo --window"; + # TODO Unbind d and T (?) + }; + }; + loadAutoconfig = true; + searchEngines = rec { + DEFAULT = ecosia; + alpinep = "https://pkgs.alpinelinux.org/packages?name={}&branch=edge"; + ampwhat = "http://www.amp-what.com/unicode/search/{}"; + arch = "https://wiki.archlinux.org/?search={}"; + archp = "https://www.archlinux.org/packages/?q={}"; + aur = "https://aur.archlinux.org/packages/?K={}"; + aw = ampwhat; + ddg = duckduckgo; + dockerhub = "https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q={}&starCount=0"; + duckduckgo = "https://duckduckgo.com/?q={}&ia=web"; + ecosia = "https://www.ecosia.org/search?q={}"; + gfr = "https://www.google.fr/search?hl=fr&q={}"; + g = google; + gh = github; + gi = "http://images.google.com/search?q={}"; + giphy = "https://giphy.com/search/{}"; + github = "https://github.com/search?q={}"; + google = "https://www.google.fr/search?q={}"; + invidious = "https://invidious.frogeye.fr/search?q={}"; + inv = invidious; + npm = "https://www.npmjs.com/search?q={}"; + q = qwant; + qwant = "https://www.qwant.com/?t=web&q={}"; + wolfram = "https://www.wolframalpha.com/input/?i={}"; + youtube = "https://www.youtube.com/results?search_query={}"; + yt = youtube; + }; + settings = { + downloads.location.prompt = false; + tabs = { + show = "never"; + tabs_are_windows = true; + }; + url = rec { + open_base_url = true; + start_pages = lib.mkDefault "https://geoffrey.frogeye.fr/blank.html"; + default_page = start_pages; + }; + content = { + # I had this setting below, not sure if it did something special + # config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*") + cookies.accept = "no-3rdparty"; + prefers_reduced_motion = true; + headers.accept_language = "fr-FR, fr;q=0.9, en-GB;q=0.8, en-US;q=0.7, en;q=0.6"; + tls.certificate_errors = "ask-block-thirdparty"; + }; + editor.command = [ "${pkgs.neovide}/bin/neovide" "--" "-f" "{file}" "-c" "normal {line}G{column0}l" ]; + # TODO Doesn't work on Arch. Does it even load the right profile on Nix? + # TODO spellcheck.languages = ["fr-FR" "en-GB" "en-US"]; + + }; + }; + + # Terminal + alacritty = { + # TODO Emojis. Or maybe they work on NixOS? + # Arch (working) shows this with alacritty -vvv: + # [TRACE] [crossfont] Got font path="/usr/share/fonts/twemoji/twemoji.ttf", index=0 + # [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: MONOCHROME | TARGET_MONO | COLOR, render_mode: "Mono", lcd_filter: 1 } + # Nix (not working) shows this: + # [TRACE] [crossfont] Got font path="/nix/store/872g3w9vcr5nh93r0m83a3yzmpvd2qrj-home-manager-path/share/fonts/truetype/TwitterColorEmoji-SVGinOT.ttf", index=0 + # [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT | COLOR, render_mode: "Lcd", lcd_filter: 1 } + + enable = true; + settings = { + bell = { + animation = "EaseOutExpo"; + color = "#000000"; + command = { program = "${pkgs.sox}/bin/play"; args = [ "-n" "synth" "sine" "C5" "sine" "E4" "remix" "1-2" "fade" "0.1" "0.2" "0.1" ]; }; + duration = 100; + }; + cursor = { vi_mode_style = "Underline"; }; + env = { + WINIT_X11_SCALE_FACTOR = "1"; + # Prevents Alacritty from resizing from one monitor to another. + # Might cause issue on HiDPI screens but we'll get there when we get there + }; + hints = { + enabled = [ + { + binding = { mods = "Control|Alt"; key = "F"; }; + command = "${pkgs.xdg-utils}/bin/xdg-open"; + mouse = { enabled = true; mods = "Control"; }; + post_processing = true; + regex = "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\\u0000-\\u001F\\u007F-\\u009F<>\"\\\\s{-}\\\\^⟨⟩`]+"; + } + ]; + }; + key_bindings = [ + { mode = "~Search"; mods = "Alt|Control"; key = "Space"; action = "ToggleViMode"; } + { mode = "Vi|~Search"; mods = "Control"; key = "K"; action = "ScrollHalfPageUp"; } + { mode = "Vi|~Search"; mods = "Control"; key = "J"; action = "ScrollHalfPageDown"; } + { mode = "~Vi"; mods = "Control|Alt"; key = "V"; action = "Paste"; } + { mods = "Control|Alt"; key = "C"; action = "Copy"; } + { mode = "~Search"; mods = "Control|Alt"; key = "F"; action = "SearchForward"; } + { mode = "~Search"; mods = "Control|Alt"; key = "B"; action = "SearchBackward"; } + { mode = "Vi|~Search"; mods = "Control|Alt"; key = "C"; action = "ClearSelection"; } + ]; + window = { + dynamic_padding = false; + dynamic_title = true; + }; + }; + }; + # Backup terminal + urxvt = { + enable = true; + package = pkgs.rxvt-unicode-emoji; + scroll = { + bar.enable = false; + }; + iso14755 = false; # Disable Ctrl+Shift default bindings + keybindings = { + "Shift-Control-C" = "eval:selection_to_clipboard"; + "Shift-Control-V" = "eval:paste_clipboard"; + # TODO Not sure resizing works, Nix doesn't have the package (urxvt-resize-font-git on Arch) + "Control-KP_Subtract" = "resize-font:smaller"; + "Control-KP_Add" = "resize-font:bigger"; + }; + extraConfig = { + "letterSpace" = 0; + "perl-ext-common" = "resize-font,bell-command,readline,selection"; + "bell-command" = "${pkgs.sox}/bin/play -n synth sine C5 sine E4 remix 1-2 fade 0.1 0.2 0.1 &> /dev/null"; + }; + }; + rofi = { + # TODO This theme template, that was used for Arch, looks much better: + # https://gitlab.com/jordiorlando/base16-rofi/-/blob/master/templates/default.mustache + enable = true; + pass.enable = true; + extraConfig = { + lazy-grab = false; + matching = "regex"; + }; + }; + autorandr = { + enable = true; + hooks.postswitch = { + background = "${pkgs.feh}/bin/feh --no-fehbg --bg-fill ${config.stylix.image}"; + }; + }; + mpv = { + enable = true; + config = { + audio-display = false; + save-position-on-quit = true; + osc = false; # # Required by thumbnail script + }; + scripts = with pkgs.mpvScripts; [ thumbnail ]; + scriptOpts = { + mpv_thumbnail_script = { + cache_directory = "/tmp/mpv_thumbs_${config.home.username}"; + }; + }; + }; + }; + + xdg = { + mimeApps = { + enable = true; + associations.added = { + "text/html" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop"; + }; + }; + userDirs = { + enable = true; # TODO Which ones do we want? + createDirectories = true; + # French, because then it there's a different initial for each, making navigation easier + desktop = null; + download = "${config.home.homeDirectory}/Téléchargements"; + music = "${config.home.homeDirectory}/Musiques"; + pictures = "${config.home.homeDirectory}/Images"; + publicShare = null; + templates = null; + videos = "${config.home.homeDirectory}/Vidéos"; + extraConfig = { + XDG_SCREENSHOTS_DIR = "${config.home.homeDirectory}/Screenshots"; + }; + }; + configFile = { + "pulse/client.conf" = { + text = ''cookie-file = .config/pulse/pulse-cookie''; + }; + "rofimoji.rc" = { + text = '' + skin-tone = neutral + files = [emojis, math] + action = clipboard + ''; + }; + "vimpc/vimpcrc" = { + text = '' + map FF :browsegg/ + map à :set add nexta:set add end + map @ :set add nexta:set add end:next + map ° D:browseA:shuffle:play:playlist + set songformat {%a - %b: %t}|{%f}$E$R $H[$H%l$H]$H + set libraryformat %n \| {%t}|{%f}$E$R $H[$H%l$H]$H + set ignorecase + set sort library + ''; + }; + }; + }; + services = { + unclutter.enable = true; + dunst = + { + enable = true; + settings = + # TODO Change dmenu for rofi, so we can use context + with config.lib.stylix.colors.withHashtag; { + global = { + separator_color = lib.mkForce base05; + idle_threshold = 120; + markup = "full"; + max_icon_size = 48; + # TODO Those shortcuts don't seem to work, maybe try: + # > define shortcuts inside your window manager and bind them to dunstctl(1) commands + close_all = "ctrl+mod4+n"; + close = "mod4+n"; + context = "mod1+mod4+n"; + history = "shift+mod4+n"; + }; + + urgency_low = { + background = lib.mkForce base01; + foreground = lib.mkForce base03; + frame_color = lib.mkForce base05; + }; + urgency_normal = { + background = lib.mkForce base02; + foreground = lib.mkForce base05; + frame_color = lib.mkForce base05; + }; + urgency_critical = { + background = lib.mkForce base08; + foreground = lib.mkForce base06; + frame_color = lib.mkForce base05; + }; + }; + }; + mpd = { + enable = true; + network = { + listenAddress = "0.0.0.0"; # So it can be controlled from home + # TODO ... and whoever is the Wi-Fi network I'm using, which, not great + port = 8601; # FIXME Chose a different one for testing, should revert + startWhenNeeded = true; + }; + extraConfig = '' + restore_paused "yes" + ''; + }; + autorandr.enable = true; + }; + + home = { + packages = with pkgs; [ + # remote + tigervnc + + # music + mpc-cli + ashuffle + vimpc + + # multimedia common + gimp + inkscape + libreoffice + + # data management + freefilesync + + # browsers + firefox + + # fonts + dejavu_fonts + twemoji-color-font + gnome.gedit + feh + zbar + zathura + meld + python3Packages.magic + + # x11-exclusive + numlockx + simplescreenrecorder + trayer + xclip + keynav + xorg.xinit + xorg.xbacklight + # TODO Make this clean. Service? + + + # organisation + pass + thunderbird + ]; + sessionVariables = { + MPD_PORT = "${toString config.services.mpd.network.port}"; + ALSA_PLUGIN_DIR = "${pkgs.alsa-plugins}/lib/alsa-lib"; # Fixes an issue with sox (Cannot open shared library libasound_module_pcm_pulse.so) + # UPST Patch this upstream like: https://github.com/NixOS/nixpkgs/blob/216b111fb87091632d077898df647d1438fc2edb/pkgs/applications/audio/espeak-ng/default.nix#L84 + }; + }; + }; +} diff --git a/hm/dev.nix b/hm/dev.nix new file mode 100644 index 0000000..f98bcf9 --- /dev/null +++ b/hm/dev.nix @@ -0,0 +1,66 @@ +{ pkgs, config, ... }: { + # TODO Maybe should be per-directory dotenv + # Or not, for neovim + + # Always on + home.packages = with pkgs; [ + # Common + perf-tools + git + jq + yq + universal-ctags + highlight + + # Network + socat + dig + whois + nmap + tcpdump + + # nix + nix + + # Always on (graphical) + ] ++ lib.optionals config.frogeye.desktop.xorg [ + # Common + zeal-qt6 # Offline documentation + + # Network + wireshark-qt + + # Ansible + ] ++ lib.optionals config.frogeye.dev.ansible [ + ansible + ansible-lint + + # C/C++ + ] ++ lib.optionals config.frogeye.dev.c [ + cmake + clang + ccache + gdb + + # Docker + ] ++ lib.optionals config.frogeye.dev.docker [ + docker + docker-compose + + # FPGA + ] ++ lib.optionals config.frogeye.dev.fpga [ + verilog + # ghdl # TODO Not on aarch64 + + # FPGA (graphical) + ] ++ lib.optionals (config.frogeye.desktop.xorg && config.frogeye.dev.fpga) [ + yosys + gtkwave + + # Python + ] ++ lib.optionals config.frogeye.dev.python [ + python3Packages.ipython + + ]; + +} diff --git a/hm/extra.nix b/hm/extra.nix new file mode 100644 index 0000000..b346f05 --- /dev/null +++ b/hm/extra.nix @@ -0,0 +1,65 @@ +{ pkgs, lib, config, ... }: +{ + config = lib.mkIf config.frogeye.extra { + programs = { + pandoc.enable = true; + yt-dlp = { + enable = true; + settings = { + format = "bestvideo[height<=${builtins.toString config.frogeye.desktop.maxVideoHeight}]+bestaudio/best"; + sponsorblock-mark = "all"; + sponsorblock-remove = "intro,outro,sponsor,selfpromo,preview,interaction,music_offtopic"; + sub-langs = "en,fr"; + write-auto-subs = true; + write-subs = true; + }; + }; + }; + home.packages = with pkgs; ([ + # android tools + android-tools + + # downloading + # transmission TODO Collision if both transmissions are active? + + # Multimedia toolbox + ffmpeg + + # documents + visidata + # texlive.combined.scheme-full + # TODO Convert existing LaTeX documents into using Nix build system + # texlive is big and not that much used, sooo + pdftk + hunspell + hunspellDicts.en_GB-ize + hunspellDicts.en_US + hunspellDicts.fr-moderne + hunspellDicts.nl_NL + # TODO libreoffice-extension-languagetool or libreoffice-extension-grammalecte-fr + + ] ++ lib.optionals config.frogeye.desktop.xorg [ + + # multimedia editors + gimp + inkscape + darktable + puddletag + audacity + + # downloading + transmission-qt + # wine only makes sense on x86_64 + ] ++ lib.optionals pkgs.stdenv.isx86_64 [ + wine + # TODO wine-gecko wine-mono lib32-libpulse (?) + + ] ++ lib.optionals (!stdenv.isAarch64) [ + # Musescore is broken on aarch64 + musescore + # Blender 4.0.1 can't compile on aarch64 + # https://hydra.nixos.org/job/nixos/release-23.11/nixpkgs.blender.aarch64-linux + blender + ]); + }; +} diff --git a/hm/face.svg b/hm/face.svg new file mode 100644 index 0000000..28e7708 --- /dev/null +++ b/hm/face.svg @@ -0,0 +1,192 @@ + + + +image/svg+xml diff --git a/config/lemonbar/barng.py b/hm/frobar/.dev/barng.py similarity index 100% rename from config/lemonbar/barng.py rename to hm/frobar/.dev/barng.py diff --git a/config/lemonbar/oldbar.py b/hm/frobar/.dev/oldbar.py similarity index 100% rename from config/lemonbar/oldbar.py rename to hm/frobar/.dev/oldbar.py diff --git a/config/lemonbar/pip.py b/hm/frobar/.dev/pip.py similarity index 100% rename from config/lemonbar/pip.py rename to hm/frobar/.dev/pip.py diff --git a/config/lemonbar/x.py b/hm/frobar/.dev/x.py similarity index 100% rename from config/lemonbar/x.py rename to hm/frobar/.dev/x.py diff --git a/hm/frobar/.gitignore b/hm/frobar/.gitignore new file mode 100644 index 0000000..d9ae3ac --- /dev/null +++ b/hm/frobar/.gitignore @@ -0,0 +1,3 @@ +dist/* +frobar.egg-info/* +__pycache__ diff --git a/hm/frobar/default.nix b/hm/frobar/default.nix new file mode 100644 index 0000000..1cf4ec4 --- /dev/null +++ b/hm/frobar/default.nix @@ -0,0 +1,48 @@ +{ pkgs ? import { config = { }; overlays = [ ]; }, ... }: +# Tried using pyproject.nix but mpd2 dependency wouldn't resolve, +# is called pyton-mpd2 on PyPi but mpd2 in nixpkgs. +let + frobar = pkgs.python3Packages.buildPythonApplication { + pname = "frobar"; + version = "2.0"; + + runtimeInputs = with pkgs; [ lemonbar-xft wirelesstools ]; + propagatedBuildInputs = with pkgs.python3Packages; [ + coloredlogs + notmuch + i3ipc + mpd2 + psutil + pulsectl + pyinotify + ]; + makeWrapperArgs = [ "--prefix PATH : ${pkgs.lib.makeBinPath (with pkgs; [ lemonbar-xft wirelesstools ])}" ]; + + src = ./.; + }; +in +{ + config = { + xsession.windowManager.i3.config.bars = [ ]; + programs.autorandr.hooks.postswitch = { + frobar = "${pkgs.systemd}/bin/systemctl --user restart frobar"; + }; + systemd.user.services.frobar = { + Unit = { + Description = "frobar"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Service = { + # Wait for i3 to start. Can't use ExecStartPre because otherwise it blocks graphical-session.target, and there's nothing i3/systemd + # TODO Do that better + ExecStart = ''${pkgs.bash}/bin/bash -c "while ! ${pkgs.i3}/bin/i3-msg; do ${pkgs.coreutils}/bin/sleep 1; done; ${frobar}/bin/frobar"''; + }; + + Install = { WantedBy = [ "graphical-session.target" ]; }; + }; + }; +} +# TODO Connection with i3 is lost on start sometimes, more often than with Arch? +# TODO Restore ability to build frobar with nix-build diff --git a/config/lemonbar/bar.py b/hm/frobar/frobar/__init__.py old mode 100755 new mode 100644 similarity index 97% rename from config/lemonbar/bar.py rename to hm/frobar/frobar/__init__.py index 9854fe7..a54813e --- a/config/lemonbar/bar.py +++ b/hm/frobar/frobar/__init__.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 -from providers import * +from frobar.providers import * # TODO If multiple screen, expand the sections and share them # TODO Graceful exit -if __name__ == "__main__": +def run(): Bar.init() Updater.init() diff --git a/config/lemonbar/display.py b/hm/frobar/frobar/display.py old mode 100755 new mode 100644 similarity index 99% rename from config/lemonbar/display.py rename to hm/frobar/frobar/display.py index fecdae1..d6113c3 --- a/config/lemonbar/display.py +++ b/hm/frobar/frobar/display.py @@ -1,15 +1,17 @@ #!/usr/bin/env python3 import enum -import threading -import time -import i3ipc +import logging import os import signal import subprocess -import logging +import threading +import time + import coloredlogs -import updaters +import i3ipc + +from frobar.notbusy import notBusy coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s") log = logging.getLogger() @@ -54,7 +56,7 @@ class Bar: """ # Constants - FONTS = ["DejaVuSansMono Nerd Font Mono", "Font Awesome"] + FONTS = ["DejaVuSansM Nerd Font"] FONTSIZE = 10 @staticmethod @@ -168,7 +170,6 @@ class Bar: @staticmethod def updateAll(): - if Bar.running: Bar.string = "" for bar in Bar.everyone: @@ -295,7 +296,7 @@ class SectionThread(threading.Thread): def run(self): while Section.somethingChanged.wait(): - updaters.notBusy.wait() + notBusy.wait() Section.updateAll() animTime = self.ANIMATION_START frameTime = time.perf_counter() @@ -311,7 +312,6 @@ class SectionThread(threading.Thread): class Section: - # TODO Update all of that to base16 # COLORS = ['#272822', '#383830', '#49483e', '#75715e', '#a59f85', '#f8f8f2', # '#f5f4f1', '#f9f8f5', '#f92672', '#fd971f', '#f4bf75', '#a6e22e', diff --git a/hm/frobar/frobar/notbusy.py b/hm/frobar/frobar/notbusy.py new file mode 100644 index 0000000..690e304 --- /dev/null +++ b/hm/frobar/frobar/notbusy.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 + +import threading + +notBusy = threading.Event() diff --git a/config/lemonbar/providers.py b/hm/frobar/frobar/providers.py old mode 100755 new mode 100644 similarity index 99% rename from config/lemonbar/providers.py rename to hm/frobar/frobar/providers.py index c65f528..219fd20 --- a/config/lemonbar/providers.py +++ b/hm/frobar/frobar/providers.py @@ -1,20 +1,21 @@ #!/usr/bin/env python3 import datetime -from updaters import * -from display import * -import pulsectl -import psutil -import subprocess -import socket import ipaddress -import logging -import coloredlogs import json -import notmuch -import mpd +import logging import random -import math +import socket +import subprocess + +import coloredlogs +import mpd +import notmuch +import psutil +import pulsectl + +from frobar.display import * +from frobar.updaters import * coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s") log = logging.getLogger() @@ -43,7 +44,6 @@ def randomColor(seed=0): class TimeProvider(StatefulSection, PeriodicUpdater): - FORMATS = ["%H:%M", "%m-%d %H:%M:%S", "%a %y-%m-%d %H:%M:%S"] NUMBER_STATES = len(FORMATS) DEFAULT_STATE = 1 @@ -257,7 +257,6 @@ class PulseaudioProvider(StatefulSection, ThreadedUpdater): class NetworkProviderSection(StatefulSection, Updater): - NUMBER_STATES = 5 DEFAULT_STATE = 1 diff --git a/config/lemonbar/updaters.py b/hm/frobar/frobar/updaters.py old mode 100755 new mode 100644 similarity index 99% rename from config/lemonbar/updaters.py rename to hm/frobar/frobar/updaters.py index d3e5986..06b65f3 --- a/config/lemonbar/updaters.py +++ b/hm/frobar/frobar/updaters.py @@ -1,22 +1,24 @@ #!/usr/bin/env python3 -import math import functools -import threading -import pyinotify -import os -import time import logging +import math +import os +import threading +import time + import coloredlogs import i3ipc -from display import Text +import pyinotify + +from frobar.display import Text +from frobar.notbusy import notBusy coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s") log = logging.getLogger() # TODO Sync bar update with PeriodicUpdater updates -notBusy = threading.Event() class Updater: @@ -241,7 +243,6 @@ class I3Updater(ThreadedUpdater): class MergedUpdater(Updater): - # TODO OPTI Do not update until end of periodic batch def fetcher(self): text = Text() diff --git a/hm/frobar/setup.py b/hm/frobar/setup.py new file mode 100644 index 0000000..275440c --- /dev/null +++ b/hm/frobar/setup.py @@ -0,0 +1,20 @@ +from setuptools import setup + +setup( + name="frobar", + version="2.0", + install_requires=[ + "coloredlogs", + "notmuch", + "i3ipc", + "python-mpd2", + "psutil", + "pulsectl", + "pyinotify", + ], + entry_points={ + "console_scripts": [ + "frobar = frobar:run", + ] + }, +) diff --git a/hm/gaming/default.nix b/hm/gaming/default.nix new file mode 100644 index 0000000..3eaf8c2 --- /dev/null +++ b/hm/gaming/default.nix @@ -0,0 +1,15 @@ +{ pkgs, lib, config, ... }: +{ + config = lib.mkIf config.frogeye.gaming { + # Using config.nixpkgs. creates an infinite recursion, + # but the above might not be correct in case of cross-compiling? + home.packages = with pkgs; [ + # gaming + yuzu-mainline + minecraft + # TODO factorio + + steam # Common pitfall: https://github.com/NixOS/nixpkgs/issues/86506#issuecomment-623746883 + ]; + }; +} diff --git a/config/scripts/.bsh/inputrc b/hm/inputrc similarity index 52% rename from config/scripts/.bsh/inputrc rename to hm/inputrc index b6fe014..8f5b381 100644 --- a/config/scripts/.bsh/inputrc +++ b/hm/inputrc @@ -1,27 +1,3 @@ -$include /etc/inputrc -set bell-style none -set colored-completion-prefix on -set colored-stats on -set completion-ignore-case on -set completion-query-items 200 -set editing-mode vi -set history-preserve-point on -set history-size 10000 -set horizontal-scroll-mode off -set mark-directories on -set mark-modified-lines off -set mark-symlinked-directories on -set match-hidden-files on -set menu-complete-display-prefix on -set page-completions on -set print-completions-horizontally off -set revert-all-at-newline off -set show-all-if-ambiguous on -set show-all-if-unmodified on -set show-mode-in-prompt on -set skip-completed-text on -set visible-stats off - $if mode=vi # these are for vi-command mode set keymap vi-command diff --git a/config/pythonstartup.py b/hm/pythonstartup.py similarity index 96% rename from config/pythonstartup.py rename to hm/pythonstartup.py index b2837ad..61f068c 100644 --- a/config/pythonstartup.py +++ b/hm/pythonstartup.py @@ -1,10 +1,11 @@ -import rlcompleter +#!/usr/bin/env python3 + import sys import os # From https://github.com/python/cpython/blob/v3.7.0b5/Lib/site.py#L436 # Changing the history file -def register_readline(): +def register_readline() -> None: import atexit try: import readline diff --git a/config/screenrc b/hm/screenrc similarity index 100% rename from config/screenrc rename to hm/screenrc diff --git a/config/scripts/.bsh/bashrc b/hm/scripts/.bsh/bashrc similarity index 100% rename from config/scripts/.bsh/bashrc rename to hm/scripts/.bsh/bashrc diff --git a/config/scripts/.bsh/bashrc_unsortable b/hm/scripts/.bsh/bashrc_unsortable similarity index 100% rename from config/scripts/.bsh/bashrc_unsortable rename to hm/scripts/.bsh/bashrc_unsortable diff --git a/config/inputrc b/hm/scripts/.bsh/inputrc similarity index 100% rename from config/inputrc rename to hm/scripts/.bsh/inputrc diff --git a/config/scripts/.bsh/vimrc b/hm/scripts/.bsh/vimrc similarity index 100% rename from config/scripts/.bsh/vimrc rename to hm/scripts/.bsh/vimrc diff --git a/config/scripts/.gitignore b/hm/scripts/.gitignore similarity index 100% rename from config/scripts/.gitignore rename to hm/scripts/.gitignore diff --git a/config/scripts/archive b/hm/scripts/archive similarity index 98% rename from config/scripts/archive rename to hm/scripts/archive index 8ac60ee..c53e962 100755 --- a/config/scripts/archive +++ b/hm/scripts/archive @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs import argparse import logging diff --git a/config/scripts/bsh b/hm/scripts/bsh similarity index 95% rename from config/scripts/bsh rename to hm/scripts/bsh index 45e21a7..9ad639b 100755 --- a/config/scripts/bsh +++ b/hm/scripts/bsh @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash openssh coreutils gawk gnused # TODO More integrated with current config diff --git a/config/scripts/cached_pass b/hm/scripts/cached_pass similarity index 83% rename from config/scripts/cached_pass rename to hm/scripts/cached_pass index 401b797..d52ecfd 100755 --- a/config/scripts/cached_pass +++ b/hm/scripts/cached_pass @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash +#! nix-shell -p bash pass libnotify # TODO Password changed? diff --git a/config/scripts/camera_name_date b/hm/scripts/camera_name_date similarity index 96% rename from config/scripts/camera_name_date rename to hm/scripts/camera_name_date index 0001baa..55bb9e2 100755 --- a/config/scripts/camera_name_date +++ b/hm/scripts/camera_name_date @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs """ Same as picture_name_date diff --git a/config/scripts/cleandev b/hm/scripts/cleandev similarity index 82% rename from config/scripts/cleandev rename to hm/scripts/cleandev index 1beff42..4f7886d 100755 --- a/config/scripts/cleandev +++ b/hm/scripts/cleandev @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash findutils git gnumake # Removes files that can be regenerated # from a dev environment diff --git a/config/scripts/compressPictureMovies b/hm/scripts/compressPictureMovies similarity index 98% rename from config/scripts/compressPictureMovies rename to hm/scripts/compressPictureMovies index 79701e9..16c4a4c 100755 --- a/config/scripts/compressPictureMovies +++ b/hm/scripts/compressPictureMovies @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.progressbar2 ffmpeg import datetime import hashlib diff --git a/config/scripts/docker-image-childs b/hm/scripts/docker-image-childs similarity index 69% rename from config/scripts/docker-image-childs rename to hm/scripts/docker-image-childs index cf72ad1..c463d29 100755 --- a/config/scripts/docker-image-childs +++ b/hm/scripts/docker-image-childs @@ -1,4 +1,6 @@ -#!/usr/bin/env sh +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash docker gnugrep coreutils # Find the dependent child image from an image diff --git a/config/scripts/docker-rm b/hm/scripts/docker-rm similarity index 57% rename from config/scripts/docker-rm rename to hm/scripts/docker-rm index aadc6fb..ffa1ea8 100755 --- a/config/scripts/docker-rm +++ b/hm/scripts/docker-rm @@ -1,4 +1,7 @@ -#!/usr/bin/env sh +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash docker + docker unpause $(docker ps -q) docker kill $(docker ps -q) docker container prune -f diff --git a/config/scripts/dummy b/hm/scripts/dummy similarity index 76% rename from config/scripts/dummy rename to hm/scripts/dummy index 1423b2a..c723378 100755 --- a/config/scripts/dummy +++ b/hm/scripts/dummy @@ -1,4 +1,6 @@ -#!/usr/bin/bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash tree coreutils # Remplace le contenu d'un dossier par un fichier texte # relatant son arborescense diff --git a/hm/scripts/emergency-clean b/hm/scripts/emergency-clean new file mode 100755 index 0000000..f8fb79d --- /dev/null +++ b/hm/scripts/emergency-clean @@ -0,0 +1,19 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash + +# Clears everything it can to save space + +rm -rf $HOME/.cache +if command -v pacman > /dev/null; then + sudo pacman -Scc +fi +if command -v apt-get > /dev/null; then + sudo apt-get clean +fi +if command -v nix-store > /dev/null; then + sudo journalctl --vacuum-size=100M +fi +if command -v journalctl > /dev/null; then + sudo journalctl --vacuum-size=100M +fi diff --git a/config/scripts/gitCheckoutModes b/hm/scripts/gitCheckoutModes similarity index 70% rename from config/scripts/gitCheckoutModes rename to hm/scripts/gitCheckoutModes index f4bdbb2..dfc1e72 100755 --- a/config/scripts/gitCheckoutModes +++ b/hm/scripts/gitCheckoutModes @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash git gnugrep coreutils findutils # From https://stackoverflow.com/a/2083563 diff --git a/config/scripts/gitghost b/hm/scripts/gitghost similarity index 93% rename from config/scripts/gitghost rename to hm/scripts/gitghost index dc24cf1..6a89c6e 100755 --- a/config/scripts/gitghost +++ b/hm/scripts/gitghost @@ -1,4 +1,6 @@ -#!/usr/bin/bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash coreutils git gnused # Replace git folders with a placeholder containing the remote and the commit diff --git a/config/scripts/lestrte b/hm/scripts/lestrte similarity index 83% rename from config/scripts/lestrte rename to hm/scripts/lestrte index 65a16cb..8ade6c6 100755 --- a/config/scripts/lestrte +++ b/hm/scripts/lestrte @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import random import sys diff --git a/config/scripts/letrtes b/hm/scripts/letrtes similarity index 84% rename from config/scripts/letrtes rename to hm/scripts/letrtes index 2124fdc..5636e84 100755 --- a/config/scripts/letrtes +++ b/hm/scripts/letrtes @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import random import sys diff --git a/config/scripts/lip b/hm/scripts/lip similarity index 81% rename from config/scripts/lip rename to hm/scripts/lip index 66a0b1d..3663bd2 100755 --- a/config/scripts/lip +++ b/hm/scripts/lip @@ -1,4 +1,6 @@ -#!/usr/bin/env sh +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash jq curl findutils coreutils set -euo pipefail diff --git a/config/scripts/lorem b/hm/scripts/lorem similarity index 96% rename from config/scripts/lorem rename to hm/scripts/lorem index 77e3998..771c67b 100755 --- a/config/scripts/lorem +++ b/hm/scripts/lorem @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash # Generates Lorem Ipsum diff --git a/config/scripts/mediaDuration b/hm/scripts/mediaDuration similarity index 91% rename from config/scripts/mediaDuration rename to hm/scripts/mediaDuration index 6ae8d70..0c8f9ee 100755 --- a/config/scripts/mediaDuration +++ b/hm/scripts/mediaDuration @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs ffmpeg import logging import os diff --git a/config/scripts/music_remove_dashes b/hm/scripts/music_remove_dashes similarity index 90% rename from config/scripts/music_remove_dashes rename to hm/scripts/music_remove_dashes index 2693a5b..25101d2 100755 --- a/config/scripts/music_remove_dashes +++ b/hm/scripts/music_remove_dashes @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 """ Small script to convert music files in the form: diff --git a/config/scripts/o b/hm/scripts/o similarity index 93% rename from config/scripts/o rename to hm/scripts/o index f427b8a..94d5e78 100755 --- a/config/scripts/o +++ b/hm/scripts/o @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 +#! nix-shell -p python3 python3Packages.magic xdg-utils feh zathura # pylint: disable=C0103 """ diff --git a/config/scripts/optimize b/hm/scripts/optimize similarity index 91% rename from config/scripts/optimize rename to hm/scripts/optimize index c2ef705..fbbfa36 100755 --- a/config/scripts/optimize +++ b/hm/scripts/optimize @@ -1,4 +1,7 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash coreutils imagemagick libjpeg optipng ffmpeg diffutils + # Optimizes everything the script can find in a folder, # meaning it will compress files as much as possible, @@ -8,7 +11,9 @@ # TODO Run in parallel # TODO Lots of dupplicated code there +# TODO Maybe replace part with https://github.com/toy/image_optim? +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) dir=${1:-$PWD} total=$(mktemp) echo -n 0 > $total @@ -146,20 +151,18 @@ do done <<< "$(find "$dir/" -type f -iname "*.png")" -# FLAC (requires reflac) +# FLAC (requires ffmpeg) while read music do if [ -z "$music" ]; then continue; fi echo Processing $music - temp_dir=$(mktemp --directory) - temp="$temp_dir/to_optimize.flac" + temp=$(mktemp --suffix .flac) cp "$music" "$temp" - reflac --best "$temp_dir" + ffmpeg -8 -o "$temp" echo "→ Optimize done" replace "$temp" "$music" - rm -rf "$temp_dir" done <<< "$(find "$dir/" -type f -iname "*.flac")" @@ -184,6 +187,6 @@ done <<< "$(find "$dir/" -type f -iname "*.flac")" # - I might want to keep editor data and/or ids for some of them # So rather use scour explicitely when needed -cleandev +${SCRIPT_DIR}/cleandev showtotal diff --git a/config/scripts/overpdf b/hm/scripts/overpdf similarity index 95% rename from config/scripts/overpdf rename to hm/scripts/overpdf index 1fb9752..32cbcd6 100755 --- a/config/scripts/overpdf +++ b/hm/scripts/overpdf @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash pdftk inkscape gnused coreutils file # Utility to write over a PDF file pages diff --git a/config/scripts/pdfpages b/hm/scripts/pdfpages similarity index 63% rename from config/scripts/pdfpages rename to hm/scripts/pdfpages index 1b86e2d..969fcf5 100755 --- a/config/scripts/pdfpages +++ b/hm/scripts/pdfpages @@ -1,4 +1,6 @@ -#!/usr/bin/bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash pdftk gnugrep gawk # From https://stackoverflow.com/a/14736593 for FILE in "$@" diff --git a/config/scripts/pdfrename b/hm/scripts/pdfrename similarity index 92% rename from config/scripts/pdfrename rename to hm/scripts/pdfrename index 7cfdd9c..c48c112 100755 --- a/config/scripts/pdfrename +++ b/hm/scripts/pdfrename @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash pdftk coreutils # Change the title of a PDF file diff --git a/config/scripts/picture_name_date b/hm/scripts/picture_name_date similarity index 96% rename from config/scripts/picture_name_date rename to hm/scripts/picture_name_date index a327499..6235729 100755 --- a/config/scripts/picture_name_date +++ b/hm/scripts/picture_name_date @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.exifread import argparse import datetime diff --git a/config/scripts/pushToTalk b/hm/scripts/pushToTalk similarity index 94% rename from config/scripts/pushToTalk rename to hm/scripts/pushToTalk index b7add24..f987a08 100755 --- a/config/scripts/pushToTalk +++ b/hm/scripts/pushToTalk @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.pulsectl python3Packages.xlib import sys diff --git a/config/scripts/raw_move_precomp b/hm/scripts/raw_move_precomp similarity index 95% rename from config/scripts/raw_move_precomp rename to hm/scripts/raw_move_precomp index 9b62408..e00535a 100755 --- a/config/scripts/raw_move_precomp +++ b/hm/scripts/raw_move_precomp @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs """ Same as picture_name_date diff --git a/config/scripts/rep b/hm/scripts/rep similarity index 82% rename from config/scripts/rep rename to hm/scripts/rep index 789f25f..086d7dc 100755 --- a/config/scripts/rep +++ b/hm/scripts/rep @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash coreutils # Moves a file to another place and put a symbolic link in place diff --git a/config/scripts/replayGain b/hm/scripts/replayGain similarity index 90% rename from config/scripts/replayGain rename to hm/scripts/replayGain index 9f48e35..3d3e574 100755 --- a/config/scripts/replayGain +++ b/hm/scripts/replayGain @@ -1,4 +1,8 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.r128gain + +# TODO r128gain is not maintainted anymore # Normalisation is done at the default of each program, # which is usually -89.0 dB diff --git a/config/scripts/rmf b/hm/scripts/rmf similarity index 99% rename from config/scripts/rmf rename to hm/scripts/rmf index 53e3fbe..1bbc2b7 100755 --- a/config/scripts/rmf +++ b/hm/scripts/rmf @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.progressbar2 # Handles sync-conflict files diff --git a/config/scripts/rssVideos b/hm/scripts/rssVideos similarity index 98% rename from config/scripts/rssVideos rename to hm/scripts/rssVideos index 22f6539..9b1401c 100755 --- a/config/scripts/rssVideos +++ b/hm/scripts/rssVideos @@ -1,4 +1,7 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.configargparse python3Packages.filelock python3Packages.filelock python3Packages.requests python3Packages.yt-dlp ffmpeg +# Also needs mpv but if I put it there it's not using the configured one """ diff --git a/config/scripts/smtpdummy b/hm/scripts/smtpdummy similarity index 98% rename from config/scripts/smtpdummy rename to hm/scripts/smtpdummy index 67be437..df3776a 100755 --- a/config/scripts/smtpdummy +++ b/hm/scripts/smtpdummy @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 +#! nix-shell -p python3 python3Packages.colorama python3Packages.configargparse import base64 import datetime diff --git a/config/scripts/spongebob b/hm/scripts/spongebob similarity index 78% rename from config/scripts/spongebob rename to hm/scripts/spongebob index 6bdfdf0..980616a 100755 --- a/config/scripts/spongebob +++ b/hm/scripts/spongebob @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import random import sys diff --git a/config/scripts/syncthingRestore b/hm/scripts/syncthingRestore similarity index 85% rename from config/scripts/syncthingRestore rename to hm/scripts/syncthingRestore index f6b41f7..0accfb6 100755 --- a/config/scripts/syncthingRestore +++ b/hm/scripts/syncthingRestore @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import os import shutil diff --git a/config/scripts/tagCreatorPhotos b/hm/scripts/tagCreatorPhotos similarity index 79% rename from config/scripts/tagCreatorPhotos rename to hm/scripts/tagCreatorPhotos index 7bec346..d5146c1 100755 --- a/config/scripts/tagCreatorPhotos +++ b/hm/scripts/tagCreatorPhotos @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.piexif import os import sys diff --git a/config/scripts/ter b/hm/scripts/ter similarity index 95% rename from config/scripts/ter rename to hm/scripts/ter index ec432a5..01fbc3b 100755 --- a/config/scripts/ter +++ b/hm/scripts/ter @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import sys from math import inf diff --git a/config/scripts/unziptree b/hm/scripts/unziptree similarity index 96% rename from config/scripts/unziptree rename to hm/scripts/unziptree index 83eb81b..0b6720c 100755 --- a/config/scripts/unziptree +++ b/hm/scripts/unziptree @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.magic unzip p7zip unrar gnutar gzip import logging import os diff --git a/config/scripts/updateCompressedMusic b/hm/scripts/updateCompressedMusic similarity index 97% rename from config/scripts/updateCompressedMusic rename to hm/scripts/updateCompressedMusic index 49c9a8a..11a48d3 100755 --- a/config/scripts/updateCompressedMusic +++ b/hm/scripts/updateCompressedMusic @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.progresbar2 ffmpeg # pylint: disable=C0103 import logging diff --git a/config/scripts/videoQuota b/hm/scripts/videoQuota similarity index 93% rename from config/scripts/videoQuota rename to hm/scripts/videoQuota index b139836..10cea98 100755 --- a/config/scripts/videoQuota +++ b/hm/scripts/videoQuota @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 ffmpeg # Compress a video to make it fit under a certain size. # Usage: videoQuota SIZE SRC DST diff --git a/config/scripts/wttr b/hm/scripts/wttr similarity index 68% rename from config/scripts/wttr rename to hm/scripts/wttr index f1b368c..9b327c9 100755 --- a/config/scripts/wttr +++ b/hm/scripts/wttr @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash curl ncurses # change Paris to your default location request="v2.wttr.in/${1-Amsterdam}" diff --git a/hm/ssh.nix b/hm/ssh.nix new file mode 100644 index 0000000..f085041 --- /dev/null +++ b/hm/ssh.nix @@ -0,0 +1,24 @@ +{ ... }: +{ + config = { + programs.ssh = { + enable = true; + controlMaster = "auto"; + controlPersist = "60s"; # TODO Default is 10minutes... makes more sense no? + # Ping the server frequently enough so it doesn't think we left (non-spoofable) + serverAliveInterval = 30; + matchBlocks."*" = { + # Do not forward the agent (-A) to a machine by default, + # as it is kinda a security concern + forwardAgent = false; + # Restrict terminal features (servers don't necessarily have the terminfo for my cutting edge terminal) + sendEnv = [ "!TERM" ]; + # TODO Why not TERM=xterm-256color? + extraOptions = { + # Check SSHFP records + VerifyHostKeyDNS = "yes"; + }; + }; + }; + }; +} diff --git a/hm/style.nix b/hm/style.nix new file mode 100644 index 0000000..a98707b --- /dev/null +++ b/hm/style.nix @@ -0,0 +1,68 @@ +{ pkgs, config, lib, ... }: +let + # Currently last commit in https://github.com/danth/stylix/pull/194 + stylix = builtins.fetchTarball "https://github.com/willemml/stylix/archive/2ed2b0086b41d582aca26e083c19c0e47c8991e3.tar.gz"; + polarityFile = "${config.xdg.stateHome}/theme_polarity"; + polarity = if builtins.pathExists polarityFile then lib.strings.fileContents polarityFile else "light"; + phases = [ + { command = "jour"; polarity = "light"; } + { command = "crepuscule"; polarity = "dark"; } + { command = "nuit"; polarity = "dark"; } + ]; + cfg = config.frogeye.desktop.phasesBrightness; +in +{ + imports = [ (import stylix).homeManagerModules.stylix ]; + + stylix = { + base16Scheme = "${pkgs.base16-schemes}/share/themes/solarized-${polarity}.yaml"; + image = builtins.fetchurl { + url = "https://get.wallhere.com/photo/sunlight-abstract-minimalism-green-simple-circle-light-leaf-wave-material-line-wing-computer-wallpaper-font-close-up-macro-photography-124350.png"; + sha256 = "sha256:1zfq3f3v34i45mi72pkfqphm8kbhczsg260xjfl6dbydy91d7y93"; + }; + # The background is set on some occasions, autorandr + feh do the rest + + fonts = { + monospace = { + package = pkgs.nerdfonts.override { + fonts = [ "DejaVuSansMono" ]; # Choose from https://github.com/NixOS/nixpkgs/blob/6ba3207643fd27ffa25a172911e3d6825814d155/pkgs/data/fonts/nerdfonts/shas.nix + }; + name = "DejaVuSansM Nerd Font"; + }; + }; + + targets = { + i3.enable = false; # I prefer my own styles + tmux.enable = false; # Using another theme + }; + }; + + # Setting a custom base16 theme via nixvim: + # - Is required so nixvim works + # - For the rest only works on dark polarity, use the colorscheme otherwise... shrug + programs.nixvim.colorschemes.base16.colorscheme = "solarized-${polarity}"; + + # Fix https://nix-community.github.io/home-manager/index.html#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal + # home.packages = [ pkgs.dconf ]; + dconf.enable = false; # Otherwise standalone home-manager complains it can't find /etc/dbus-1/session.conf on Arch. + # Symlinking it to /usr/share/dbus-1/session.conf goes further but not much. + + # TODO Use xbacklight instead (pindakaas doesn't seem to support it OOTB) + home.packages = map + (phase: (pkgs.writeShellApplication { + name = "${phase.command}"; + text = (lib.optionalString cfg.enable '' + echo ${builtins.toString (builtins.getAttr phase.command cfg)} | sudo tee /sys/class/backlight/${cfg.backlight}/brightness + '') + '' + echo ${phase.polarity} > ${polarityFile} + if command -v home-manager + then + home-manager switch + else + sudo nixos-rebuild switch + fi + ''; + }) + ) + phases; +} diff --git a/config/tmux/tmux.conf b/hm/tmux.conf similarity index 54% rename from config/tmux/tmux.conf rename to hm/tmux.conf index bca3ae4..4164508 100644 --- a/config/tmux/tmux.conf +++ b/hm/tmux.conf @@ -9,24 +9,9 @@ bind-key -n M-7 select-window -t 7 bind-key -n M-8 select-window -t 8 bind-key -n M-9 select-window -t 9 -set -g mouse off # https://superuser.com/a/1007721 bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'" # Inform tmux that alacritty supports RGB # (because for some reason terminfo doesn't?) set -ga terminal-overrides ',alacritty*:RGB' - -# List of plugins -set -g @plugin 'tmux-plugins/tpm' -set -g @plugin 'tmux-plugins/tmux-sensible' - -set -g @plugin 'jimeh/tmux-themepack' -set -g @themepack 'powerline/block/green' - -set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.cache/tmuxplugins/' - -# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) -if "test ! -d ~/.cache/tmuxplugins/tpm" \ - "run 'git clone https://github.com/tmux-plugins/tpm ~/.cache/tmuxplugins/tpm && ~/.cache/tmuxplugins/tpm/bin/install_plugins'" -run -b '~/.cache/tmuxplugins/tpm/tpm' diff --git a/hm/vim.nix b/hm/vim.nix new file mode 100644 index 0000000..a34cf0c --- /dev/null +++ b/hm/vim.nix @@ -0,0 +1,403 @@ +{ pkgs, lib, config, ... }: +let + nixvim = import (builtins.fetchGit { + url = "https://github.com/nix-community/nixvim"; + rev = "c96d7b46d05a78e695ed1c725d1596b65509b4f9"; # 24.05 Anythin after this commit works + }); + vim-shot-f = pkgs.vimUtils.buildVimPlugin { + pname = "vim-shot-f"; + version = "2016-02-05"; + src = pkgs.fetchFromGitHub { + owner = "deris"; + repo = "vim-shot-f"; + rev = "eea71d2a1038aa87fe175de9150b39dc155e5e7f"; + sha256 = "iAPvIs/lhW+w5kFTZKaY97D/kfCGtqKrJVFvZ8cHu+c="; + }; + meta.homepage = "https://github.com/deris/vim-shot-f"; + }; + quick-scope = pkgs.vimUtils.buildVimPlugin rec { + pname = "quick-scope"; + version = "2.6.1"; + src = pkgs.fetchFromGitHub { + owner = "unblevable"; + repo = "quick-scope"; + rev = "v${version}"; + sha256 = "TcA4jZIdnQd06V+JrXGiCMr0Yhm9gB6OMiTSdzMt/Qw="; + }; + meta.homepage = "https://github.com/unblevable/quick-scope"; + }; +in +{ + imports = [ + nixvim.homeManagerModules.nixvim + ]; + + programs.nixvim = { + enable = true; + options = { + # From https://www.hillelwayne.com/post/intermediate-vim/ + title = true; + number = true; + relativenumber = true; + scrolloff = 10; + lazyredraw = true; # Do not redraw screen in the middle of a macro. Makes them complete faster. + cursorcolumn = true; + + ignorecase = true; + smartcase = true; + gdefault = true; + + tabstop = 4; + shiftwidth = 4; + expandtab = true; + + splitbelow = true; + visualbell = true; + + updatetime = 250; + undofile = true; + + # From http://stackoverflow.com/a/5004785/2766106 + list = true; + listchars = "tab:╾╌,trail:·,extends:↦,precedes:↤,nbsp:_"; + showbreak = "↪"; + + wildmode = "longest:full,full"; + wildmenu = true; + }; + globals = { + netrw_fastbrowse = 0; # Close the file explorer once you select a file + }; + plugins = { + # Catches attention when cursor changed position + # TODO Unmapped, do I still want to use it? + specs = { + enable = true; + min_jump = 5; + fader = { builtin = "pulse_fader"; }; + resizer = { builtin = "shrink_resizer"; }; + }; + + # Tabline + barbar.enable = true; + + # Go to whatever + telescope = { + enable = true; + keymaps = { + gF = "find_files"; + gf = "git_files"; + gB = "buffers"; + gl = "current_buffer_fuzzy_find"; + gL = "live_grep"; + gT = "tags"; + gt = "treesitter"; + gm = "marks"; + gh = "oldfiles"; + gH = "command_history"; + gS = "search_history"; + gC = "commands"; + gr = "lsp_references"; + ge = "diagnostics"; + # ga = "lsp_code_actions"; + # gE = "lsp_workspace_diagnostics"; + # TODO Above makes nvim crash on startup, action is not provided + gd = "lsp_definitions"; + gs = "lsp_document_symbols"; + }; + defaults = { + vimgrep_arguments = [ + "${pkgs.ripgrep}/bin/rg" + "--color=never" + "--no-heading" + "--with-filename" + "--line-number" + "--column" + "--smart-case" + ]; + }; + extensions.fzf-native = { + enable = true; + caseMode = "smart_case"; + fuzzy = true; + overrideFileSorter = true; + overrideGenericSorter = true; + }; + }; + + # Surrounding pairs + surround.enable = true; # Change surrounding pairs (e.g. brackets, quotes) + + # Language Server + lsp = { + enable = true; + keymaps = { + silent = true; + diagnostic = { + "e" = "open_float"; + "[e" = "goto_prev"; + "]e" = "goto_next"; + }; + lspBuf = { + "gD" = "declaration"; + "K" = "hover"; + "gi" = "implementation"; + "" = "signature_help"; + "wa" = "add_workspace_folder"; + "wr" = "remove_workspace_folder"; + # "wl" = "list_workspace_folder"; + # TODO Full thing was function() print(vim.inspect(vim.lsp.buf.list_workspace_folder())) end but not sure I'm ever really using this + # Also makes nvim crash like this, so uncommented + "D" = "type_definition"; + "rn" = "rename"; + "f" = "format"; + # TODO Full thing was function() vim.lsp.buf.format { async = true } end, so async while this isn't + # Maybe replace this with lsp-format? + }; + }; + servers = { + ansiblels.enable = config.frogeye.dev.ansible; # Ansible + bashls.enable = true; # Bash + jsonls.enable = true; # JSON + lua-ls.enable = true; # Lua (for Neovim debugging) + perlpls.enable = config.frogeye.dev.perl; # Perl + pylsp = { + # Python + enable = config.frogeye.dev.python; + settings.plugins = { + black.enabled = true; + flake8 = { + enabled = true; + maxLineLength = 88; # Compatibility with Black + }; + isort.enabled = true; + mccabe.enabled = true; + pycodestyle = { + enabled = true; + maxLineLength = 88; # Compatibility with Black + }; + pyflakes.enabled = true; + pylint.enabled = true; + pylsp_mypy = { + enabled = true; + overrides = [ + "--cache-dir=${config.xdg.cacheHome}/mypy" + "--ignore-missing-imports" + "--disallow-untyped-defs" + "--disallow-untyped-calls" + "--disallow-incomplete-defs" + "--disallow-untyped-decorators" + true + ]; + }; + # TODO Could add some, could also remove some + }; + }; + phpactor.enable = config.frogeye.dev.php; # PHP + rnix-lsp.enable = true; # Nix + # TODO Something for SQL. sqls is deprecated, sqlls is not in Nixpkgs. Probably needs a DB connection configured anyways? + yamlls.enable = true; # YAML + # TODO Check out none-ls + }; + onAttach = '' + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + ''; # Seems needed for auto-completion with nvim-compe + }; + nvim-lightbulb = { + # Shows a lightbulb whenever a codeAction is available under the cursor + enable = true; + autocmd.enabled = true; + }; + lspkind.enable = true; # Add icons to LSP completions + + # Treesitter + treesitter = { + # Allows for better syntax highlighting + enable = true; + incrementalSelection = { + enable = true; + }; + # indent = true; # Not very working last time I tried apparently + }; + # TODO Investigate https://github.com/nvim-treesitter/nvim-treesitter-textobjects + indent-blankline.enable = true; # TODO integrate with rainbow-delimiters and use more of the options + + undotree.enable = true; # Navigate edition history + + # Git + fugitive.enable = true; # Git basics + gitsigns.enable = true; # Show changed lines in the gutter + + # Language-specific + # dap.enable = true; # Debug Adapter Protocol client # 23.11 + nvim-colorizer.enable = true; # Display colors of color-codes + }; + extraPlugins = with pkgs.vimPlugins; [ + nvim-scrollview # Scroll bar + + # Status line + feline-nvim # Customizable status line. + # TODO Abandonned. Maybe use lualine? + + # Search/replace + vim-abolish # Regex for words, with case in mind + vim-easy-align # Aligning lines around a certain character + + # Surrounding pairs + targets-vim # Better interaction with surrounding pairs + + # f/F mode + vim-shot-f # Highlight relevant characters for f/F/t/T modes + quick-scope # Highlight relevant characters for f/F modes one per word but always + + # Registers + registers-nvim # Show register content when pressing " + # TODO Doesn't work. Didn't work on Arch either + + # Tags + vim-gutentags # Generate tags + symbols-outline-nvim # Show a symbol panel on the right + # TODO Fails on startup. Same on Arch. Config issue? + + # Language server + lsp_signature-nvim # Show argument definition when typing a function + + # Treesitter + nvim-ts-rainbow # Randomly color parenthesis pairs + # TODO Replace with plugins.rainbow-delimiters + + # Snippets + vim-vsnip + vim-vsnip-integ + friendly-snippets + + # Auto-completion + nvim-compe + # TODO Archived. Maybe use nvim-cmp and plugins instead? + + # Git + fugitive-gitlab-vim # Open files in GitLab + # TODO Connect it! + + # Language-specific + tcomment_vim # Language-aware (un)commenting + ] ++ lib.optionals config.frogeye.extra [ + vim-LanguageTool # Check grammar for human languages + ] ++ lib.optionals config.programs.pandoc.enable [ + vim-pandoc # Pandoc-specific stuff because there's no LSP for it + vim-pandoc-syntax + ] ++ lib.optionals config.frogeye.dev.c [ + nvim-dap # Debug Adapter Protocol client + ] ++ lib.optionals config.frogeye.dev.ansible [ + ansible-vim # TODO Doesn't have snippets + ]; + extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [ + ./vim/feline.lua + ./vim/symbols-outline-nvim.lua + ./vim/lsp_signature-nvim.lua + ./vim/nvim-ts-rainbow.lua + ./vim/nvim-compe.lua + ]; + extraConfigVim = '' + " GENERAL + + " Avoid showing message extra message when using completion + set shortmess+=c + + command Reload source $MYVIMRC + + " PLUGINS + + " vim-gutentags + let g:gutentags_cache_dir = expand('~/.cache/nvim/tags') + + " nvim-compe + " Copy-pasted because I couldn't be bothered + set completeopt=menuone,noselect + + inoremap compe#complete() + inoremap compe#confirm('') + inoremap compe#close('') + inoremap compe#scroll({ 'delta': +4 }) + inoremap compe#scroll({ 'delta': -4 }) + + '' + lib.optionalString config.frogeye.extra '' + " languagetool + let g:languagetool_cmd = "${pkgs.languagetool}/bin/languagetool-commandline" + " TODO Doesn't work + + '' + lib.optionalString config.programs.pandoc.enable '' + " vim-pandox + let g:pandoc#modules#disabled = ["folding"] + let g:pandoc#spell#enabled = 0 + let g:pandoc#syntax#conceal#use = 0 + + ''; + autoCmd = [ + # Turn off relativenumber only for insert mode + { event = "InsertEnter"; pattern = "*"; command = "set norelativenumber"; } + { event = "InsertLeave"; pattern = "*"; command = "set relativenumber"; } + + # Additional extensions + { event = "BufRead"; pattern = "*.jinja"; command = "set filetype=jinja2"; } # TODO Probably GH-specific? + { event = "BufNewFile"; pattern = "*.jinja"; command = "set filetype=jinja2"; } + + # vim-easy-align: Align Markdown tables + { event = "FileType"; pattern = "markdown"; command = "vmap :EasyAlign*"; } + ]; + + userCommands = { + # Reload = { command = "source $MYVIRMC"; }; + # TODO Is not working, options is set to nil even though it shouldn't + }; + + keymaps = [ + # GENERAL + + # Allow saving of files as sudo when I forgot to start vim using sudo. + # From https://stackoverflow.com/a/7078429 + { mode = "c"; key = "w!!"; action = "w !sudo tee > /dev/null %"; } + + { mode = "i"; key = "jk"; action = ""; } + { mode = "v"; key = ""; action = ""; } + { key = ""; action = "o"; } + + # { key = ""; action = ":bp"; } + # { key = ""; action = ":bn"; } + { key = ""; action = "kkkkkkkkkkkkkkkkkkkkk"; } + { key = ""; action = "jjjjjjjjjjjjjjjjjjjjj"; } + + # \s to replace globally the word under the cursor + { key = "s"; action = ":%s/\\<\\>/"; } + + # PLUGINS + + # barbar + { key = ""; action = "BufferPrevious"; options = { silent = true; }; } + { key = ""; action = "BufferNext"; options = { silent = true; }; } + # TODO https://www.reddit.com/r/neovim/comments/mbj8m5/how_to_setup_ctrlshiftkey_mappings_in_neovim_and/ + { key = ""; action = "BufferMovePrevious"; options = { silent = true; }; } + { key = ""; action = "BufferMoveNext"; options = { silent = true; }; } + # TODO gotos don't work + { key = ""; action = "BufferGoto 1"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 2"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 3"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 4"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 5"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 6"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 7"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 8"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 9"; options = { silent = true; }; } + { key = ""; action = "BufferLast"; options = { silent = true; }; } + { key = "gb"; action = "BufferPick"; options = { silent = true; }; } + # TODO Other useful options? + + # symbols-outline-nvim + { key = "s"; action = "SymbolsOutline"; options = { silent = true; }; } + + # undotree + { key = "u"; action = "UndotreeToggle"; options = { silent = true; }; } + + ]; + }; +} diff --git a/config/automatrop/roles/vim/templates/plugins/feline.j2 b/hm/vim/feline.lua similarity index 98% rename from config/automatrop/roles/vim/templates/plugins/feline.j2 rename to hm/vim/feline.lua index aa49c02..41460d4 100644 --- a/config/automatrop/roles/vim/templates/plugins/feline.j2 +++ b/hm/vim/feline.lua @@ -1,8 +1,7 @@ -{# Customisable status line #} -{{ add_source('famiu/feline.nvim') -}} -set noshowmode -set laststatus=2 -lua << EOF +vim.cmd([[ + set noshowmode + set laststatus=2 +]]) local base16_colors = require('base16-colorscheme').colors local vi_mode_utils = require('feline.providers.vi_mode') local lsp = require('feline.providers.lsp') @@ -164,4 +163,3 @@ require('feline').setup({ }, } }) -EOF diff --git a/hm/vim/feline_test.vim b/hm/vim/feline_test.vim new file mode 100644 index 0000000..7ddb1cd --- /dev/null +++ b/hm/vim/feline_test.vim @@ -0,0 +1,9 @@ +source ~/.config/vim/plug.vim +call plug#begin('~/.cache/nvim/plugged') +Plug 'RRethy/nvim-base16' +call plug#end() + +colorscheme base16-solarized-dark +lua << EOF +a = require('base16-colorscheme').colors.base00 +EOF diff --git a/hm/vim/lsp_signature-nvim.lua b/hm/vim/lsp_signature-nvim.lua new file mode 100644 index 0000000..4f5fff7 --- /dev/null +++ b/hm/vim/lsp_signature-nvim.lua @@ -0,0 +1,3 @@ +require'lsp_signature'.on_attach({ + hint_enable = false, +}) diff --git a/config/automatrop/roles/vim/templates/plugins/nvim_compe.j2 b/hm/vim/nvim-compe.lua similarity index 78% rename from config/automatrop/roles/vim/templates/plugins/nvim_compe.j2 rename to hm/vim/nvim-compe.lua index 0c89f21..81d2274 100644 --- a/config/automatrop/roles/vim/templates/plugins/nvim_compe.j2 +++ b/hm/vim/nvim-compe.lua @@ -1,7 +1,4 @@ -{{ add_source('hrsh7th/nvim-compe') -}} -{# I'm a bit lost with all this, so this is the default recommended config, -using vim-vsnip because the proposed configuration for tab-completion uses it, so… #} -lua << EOF +-- Default recommended config require'compe'.setup { enabled = true; autocomplete = true; @@ -32,17 +29,9 @@ require'compe'.setup { vsnip = true; }; } -EOF -set completeopt=menuone,noselect +-- Vim instructions were here -inoremap compe#complete() -inoremap compe#confirm('') -inoremap compe#close('') -inoremap compe#scroll({ 'delta': +4 }) -inoremap compe#scroll({ 'delta': -4 }) - -lua << EOF local t = function(str) return vim.api.nvim_replace_termcodes(str, true, true, true) end @@ -81,4 +70,3 @@ vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", {expr = true}) vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/ts-rainbow.j2 b/hm/vim/nvim-ts-rainbow.lua similarity index 73% rename from config/automatrop/roles/vim/templates/plugins/ts-rainbow.j2 rename to hm/vim/nvim-ts-rainbow.lua index 4663f6e..2047385 100644 --- a/config/automatrop/roles/vim/templates/plugins/ts-rainbow.j2 +++ b/hm/vim/nvim-ts-rainbow.lua @@ -1,6 +1,3 @@ -{# Randomly color parentheses pairs #} -{{ add_source('p00f/nvim-ts-rainbow') -}} -lua << EOF require'nvim-treesitter.configs'.setup { rainbow = { enable = true, @@ -8,4 +5,3 @@ require'nvim-treesitter.configs'.setup { max_file_lines = 1000, -- Do not enable for files with more than 1000 lines, int } } -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/symbols-outline.j2 b/hm/vim/symbols-outline-nvim.lua similarity index 69% rename from config/automatrop/roles/vim/templates/plugins/symbols-outline.j2 rename to hm/vim/symbols-outline-nvim.lua index abbe040..4649eb7 100644 --- a/config/automatrop/roles/vim/templates/plugins/symbols-outline.j2 +++ b/hm/vim/symbols-outline-nvim.lua @@ -1,9 +1,3 @@ -{# Show a symbol panel on the right #} -{{ add_source('simrat39/symbols-outline.nvim') -}} - -nmap s :SymbolsOutline - -lua << EOF vim.g.symbols_outline = { highlight_hovered_item = true, show_guides = true, @@ -22,5 +16,4 @@ vim.g.symbols_outline = { }, lsp_blacklist = {}, } -EOF -{# TODO Should be hierarchical, doesn't seem to be :/ #} +-- TODO Should be hierarchical, doesn't seem to be :/ diff --git a/hm/zshrc.sh b/hm/zshrc.sh new file mode 100644 index 0000000..5130f51 --- /dev/null +++ b/hm/zshrc.sh @@ -0,0 +1,112 @@ +# +# ZSH aliases and customizations +# Am not sure what everything does in there... +# + +# TODO Learn `setopt extendedglob` + +# powerline-go duration support +zmodload zsh/datetime +function preexec() { + __TIMER=$EPOCHREALTIME +} + +# Cursor based on mode +if [ $TERM = "linux" ]; then + _LINE_CURSOR="\e[?0c" + _BLOCK_CURSOR="\e[?8c" +else + _LINE_CURSOR="\e[6 q" + _BLOCK_CURSOR="\e[2 q" +fi +function zle-keymap-select zle-line-init +{ + case $KEYMAP in + vicmd) print -n -- "$_BLOCK_CURSOR";; + viins|main) print -n -- "$_LINE_CURSOR";; + esac +} +function zle-line-finish +{ + print -n -- "$_BLOCK_CURSOR" +} +zle -N zle-line-init +zle -N zle-line-finish +zle -N zle-keymap-select + +# Also return to normal mode from jk shortcut +bindkey 'jk' vi-cmd-mode + +# Edit command line +autoload edit-command-line +zle -N edit-command-line +bindkey -M vicmd v edit-command-line + +# Additional history-substring-search bindings for vi cmd mode +# TODO Doesn't work, as home-manager loads history-substring at the very end of the file +# bindkey -M vicmd 'k' history-substring-search-up +# bindkey -M vicmd 'j' history-substring-search-down + +# Autocompletion +autoload -Uz promptinit +promptinit + +# Color common prefix +zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==35=00}:${(s.:.)LS_COLORS}")' + + +setopt GLOBDOTS # Complete hidden files + +setopt NO_BEEP # that annoying beep goes away +# setopt NO_LIST_BEEP # beeping is only turned off for ambiguous completions +# +setopt AUTO_LIST # when the completion is ambiguous you get a list without having to type ^D +# setopt BASH_AUTO_LIST # the list only happens the second time you hit tab on an ambiguous completion +# setopt LIST_AMBIGUOUS # this is modified so that nothing is listed if there is an unambiguous prefix or suffix to be inserted --- this can be combined with BASH_AUTO_LIST, so that where both are applicable you need to hit tab three times for a listing +unsetopt REC_EXACT # if the string on the command line exactly matches one of the possible completions, it is accepted, even if there is another completion (i.e. that string with something else added) that also matches +unsetopt MENU_COMPLETE # one completion is always inserted completely, then when you hit TAB it changes to the next, and so on until you get back to where you started +unsetopt AUTO_MENU # you only get the menu behaviour when you hit TAB again on the ambiguous completion. +unsetopt AUTO_REMOVE_SLASH + +# Help +# TODO ~~Doesn't work (how ironic)~~ Works but it's just man? +autoload -Uz run-help +unalias run-help +alias help=run-help +autoload -Uz run-help-git +autoload -Uz run-help-ip +autoload -Uz run-help-openssl +autoload -Uz run-help-p4 +autoload -Uz run-help-sudo +autoload -Uz run-help-svk +autoload -Uz run-help-svn + +# Dir stack +DIRSTACKFILE="$HOME/.cache/zsh_dirstack" +if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then + dirstack=( ${(f)"$(< $DIRSTACKFILE)"} ) + # [[ -d $dirstack[1] ]] && cd $dirstack[1] +fi +chpwd() { + print -l $PWD ${(u)dirstack} >$DIRSTACKFILE +} + +DIRSTACKSIZE=20 + +setopt AUTO_PUSHD PUSHD_SILENT PUSHD_TO_HOME +setopt PUSHD_IGNORE_DUPS # Remove duplicate entries +setopt PUSHD_MINUS # This reverts the +/- operators. + + +# History + +# From https://unix.stackexchange.com/a/273863 +setopt BANG_HIST # Treat the '!' character specially during expansion. +setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits. +setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate. +setopt HIST_FIND_NO_DUPS # Do not display a line previously found. +setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file. +setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry. +unsetopt HIST_VERIFY # Don't execute immediately upon history expansion. +unsetopt HIST_BEEP # Beep when accessing nonexistent history. + diff --git a/install_os.sh b/install_os.sh new file mode 100755 index 0000000..eb41b84 --- /dev/null +++ b/install_os.sh @@ -0,0 +1,107 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash +#! nix-shell -p bash nixos-install-tools + +set -euo pipefail +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +# Parse arguments +function help { + echo "Usage: $0 [-h|-e] profile" + echo "Install NixOS on a device." + echo + echo "Arguments:" + echo " profile: OS/disk profile to use" + echo + echo "Options:" + echo " -h: Display this help message." + echo " -e: Erase the disk. For cases where the partition scheme doesn't match the existing one." +} + +disko_mode=mount +while getopts "he" OPTION +do + case "$OPTION" in + h) + help + exit 0 + ;; + e) + disko_mode=disko + ;; + ?) + 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 + +disko_config="${profile_dir}/dk.nix" +if [ ! -f "$disko_config" ] +then + echo "Disk configuration not found." +fi + +nixos_config="${profile_dir}/os.nix" +if [ ! -f "$nixos_config" ] +then + echo "NixOS configuration not found." +fi + +mountpoint="/mnt/nixos" +nix_flakes_cmd="nix --extra-experimental-features nix-command --extra-experimental-features flakes" +luks_pass_path="luks/$(basename ${profile})" + +set -x + +sudo mkdir -p "$mountpoint" + +# Add channels to root user, as nixos-install uses those. +# Not great, but fixable with flakes I guess +sudo ./add_channels.sh + +# Load encryption password +luks_pass_file="$(mktemp --suffix="luks_password")" +pass $luks_pass_path | head -n1 | tr -d '\n' > $luks_pass_file + +# Format or mount disk +sudo $nix_flakes_cmd run github:nix-community/disko -- --root-mountpoint "$mountpoint" --mode "$disko_mode" --argstr passwordFile "$luks_pass_file" "$disko_config" + +# Unload encryption password +rm "$luks_pass_file" + +# Generate hardware-config.nix +sudo nixos-generate-config --no-filesystems --root "$mountpoint" +# --no-filesystems because they are imported via disko + +# Plug system configuration into this git repo +sudo mkdir -p "${mountpoint}/etc/nixos" +echo "{ ... }: { imports = [ ./hardware-configuration.nix ${nixos_config} ]; }" | sudo tee "${mountpoint}/etc/nixos/configuration.nix" > /dev/null +# Everything there should be covered by (and conflicts with) the repo anyways. + +# Install NixOS! Or create a new generation. +sudo nixos-install --no-root-password --root "$mountpoint" + +# Install dotfiles. Actually not needed by nixos-install since it doesn't rewrite global paths to the mountpoint. +# Without it no nixos-rebuild from the system itself once installed though. +# Should probably be replaced with something like git-sync +# sudo mkdir -p $mountpoint/home/geoffrey/.config/ +# sudo cp -a ../dotfiles $mountpoint/home/geoffrey/.config/ +# sudo chown geoffrey:geoffrey $mountpoint/home/geoffrey -R + +# Signal the installation is done! +echo  diff --git a/options.nix b/options.nix new file mode 100644 index 0000000..4b2a554 --- /dev/null +++ b/options.nix @@ -0,0 +1,61 @@ +{ lib, config, ... }: +{ + options.frogeye = { + extra = lib.mkEnableOption "Big software"; + gaming = lib.mkEnableOption "Games"; + desktop = { + xorg = lib.mkEnableOption "Enable X11 support"; + numlock = lib.mkEnableOption "Auto-enable numlock"; + x11_screens = lib.mkOption { + default = ["UNSET1"]; + description = "A list of xrandr screen names from left to right."; + type = lib.types.listOf lib.types.str; + }; + nixGLIntel = lib.mkEnableOption "Enable nixGLIntel/nixVulkanIntel for windows manager"; + maxVideoHeight = lib.mkOption { + type = lib.types.int; + description = "Maximum video height in pixel the machine can reasonably watch"; + default = 1080; + }; + phasesBrightness = { + enable = lib.mkEnableOption "Set a specific brightness for the screen when running phases commands"; + backlight = lib.mkOption { type = lib.types.str; description = "Name of the backlight device"; }; + jour = lib.mkOption { type = lib.types.int; description = "brightness value for phase: jour"; }; + crepuscule = lib.mkOption { type = lib.types.int; description = "brightness value for phase: crepuscule"; }; + nuit = lib.mkOption { type = lib.types.int; description = "brightness value for phase: nuit"; }; + }; + }; + dev = { + ansible = lib.mkEnableOption "Ansible dev stuff"; + c = lib.mkEnableOption "C/C++ dev stuff"; + docker = lib.mkEnableOption "Docker dev stuff"; + fpga = lib.mkEnableOption "FPGA dev stuff"; + perl = lib.mkEnableOption "Perl dev stuff"; + php = lib.mkEnableOption "PHP dev stuff"; + python = lib.mkEnableOption "Python dev stuff"; + }; + shellAliases = lib.mkOption { + default = { }; + example = lib.literalExpression '' + { + ll = "ls -l"; + ".." = "cd .."; + } + ''; + description = '' + An attribute set that maps aliases (the top level attribute names in + this option) to command strings or directly to build outputs. + ''; + type = lib.types.attrsOf lib.types.str; + }; + }; + + config = { + frogeye = { + dev = { + ansible = lib.mkDefault true; + python = lib.mkDefault true; + }; + }; + }; +} diff --git a/os/battery.nix b/os/battery.nix new file mode 100644 index 0000000..4052fe2 --- /dev/null +++ b/os/battery.nix @@ -0,0 +1,4 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ powertop ]; +} diff --git a/os/common.nix b/os/common.nix new file mode 100644 index 0000000..5719d75 --- /dev/null +++ b/os/common.nix @@ -0,0 +1,73 @@ +{ pkgs, lib, ... }: +{ + networking.domain = "geoffrey.frogeye.fr"; + + time.timeZone = "Europe/Amsterdam"; + + # Might fill emptiness? + boot.consoleLogLevel = 6; # KERN_INFO + + # TODO qwerty-fr for console + + # Enable CUPS to print documents + services.printing.enable = true; + + # Enable passwordless sudo + # TODO execWheelOnly? sudo-rs? + security.sudo.extraRules = [{ + groups = [ "wheel" ]; + commands = [{ + command = "ALL"; + options = [ "NOPASSWD" ]; + }]; + }]; + + environment.systemPackages = with pkgs; [ + wget + kexec-tools + openvpn + + # Needed for all the fetchFromGit in this repo on nixos-rebuild + git + ]; + + nixpkgs.config.allowUnfree = true; + + programs = { + adb.enable = true; + # Enable compilation cache + ccache.enable = true; + # TODO Not enough, see https://nixos.wiki/wiki/CCache. + # Might want to see if it's worth using on NixOS + gnupg.agent.enable = true; + + # Let users mount disks + udevil.enable = true; + }; + + services = { + # Enable the OpenSSH daemon + openssh.enable = true; + + # Time sychronisation + chrony = { + enable = true; + servers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3); + }; + + # Prevent power button from shutting down the computer. + # On Pinebook it's too easy to hit, + # on others I sometimes turn it off when unsuspending. + logind.extraConfig = "HandlePowerKey=ignore"; + + }; + + # TODO Hibernation? + + # TEST + system.copySystemConfiguration = true; + + # Use defaults from + system.stateVersion = "23.11"; + +} diff --git a/os/default.nix b/os/default.nix new file mode 100644 index 0000000..f693171 --- /dev/null +++ b/os/default.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + imports = [ + ../options.nix + ./battery.nix + ./common.nix + ./desktop.nix + ./gaming + ./geoffrey.nix + ./wireless.nix + "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22.tar.gz"}/module.nix" + ]; +} diff --git a/os/desktop.nix b/os/desktop.nix new file mode 100644 index 0000000..ab3b08c --- /dev/null +++ b/os/desktop.nix @@ -0,0 +1,51 @@ +{ pkgs, lib, config, ... }: +{ + config = lib.mkIf config.frogeye.desktop.xorg { + # Enable the X11 windowing system + + services.xserver = { + enable = true; + windowManager.i3.enable = true; + displayManager.defaultSession = "none+i3"; + + # Keyboard layout + extraLayouts.qwerty-fr = { + description = "QWERTY-fr"; + languages = [ "fr" ]; + symbolsFile = "${pkgs.stdenv.mkDerivation { + name = "qwerty-fr-keypad"; + src = builtins.fetchGit { + url = "https://github.com/qwerty-fr/qwerty-fr.git"; + rev = "3a4d13089e8ef016aa20baf6b2bf3ea53de674b8"; + }; + patches = [ ./qwerty-fr-keypad.diff ]; + # TODO This doesn't seem to be applied... it's the whole point of the derivation :( + installPhase = '' + runHook preInstall + mkdir -p $out/linux + cp $src/linux/us_qwerty-fr $out/linux + runHook postInstall + ''; + }}/linux/us_qwerty-fr"; + }; + layout = "qwerty-fr"; + }; + + # Enable sound + sound.enable = true; + hardware.pulseaudio.enable = true; + + # UPST + # TODO Find a way to override packages either at NixOS level or HM level depending on what is used + nixpkgs.overlays = [ + (final: prev: { + sct = prev.sct.overrideAttrs + (old: { + patches = (old.patches or [ ]) ++ [ + ./sct_aarch64.patch + ]; + }); + }) + ]; + }; +} diff --git a/os/gaming/default.nix b/os/gaming/default.nix new file mode 100644 index 0000000..d4284dd --- /dev/null +++ b/os/gaming/default.nix @@ -0,0 +1,7 @@ +{ pkgs, lib, config, ... }: +{ + config = lib.mkIf config.frogeye.gaming { + programs.steam.enable = true; + hardware.opengl.driSupport32Bit = true; # Enables support for 32bit libs that steam uses + }; +} diff --git a/os/geoffrey.nix b/os/geoffrey.nix new file mode 100644 index 0000000..cd27181 --- /dev/null +++ b/os/geoffrey.nix @@ -0,0 +1,37 @@ +{ pkgs, config, ... }: +{ + imports = [ + + ]; + + users.users.geoffrey = { + isNormalUser = true; + extraGroups = [ "adbusers" "wheel" ]; + shell = pkgs.zsh; + + initialHashedPassword = "$y$j9T$e64bjL7iyVlniEKwKbM9g0$cCn74za0r6L9QMO20Fdxz3/SX0yvhz3Xd6.2BhtbRL1"; # Not a real password + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPE41gxrO8oZ5n3saapSwZDViOQphm6RzqgsBUyA88pU geoffrey@frogeye.fr" + ]; + }; + + # Won't allow to set the shell otherwise, + # even though home-manager sets it + programs.zsh.enable = true; + + home-manager = { + users.geoffrey = { pkgs, ... }: { + imports = [ + ../hm + ]; + frogeye = config.frogeye; + }; + # Makes VMs able to re-run + useUserPackages = true; + # Adds consistency + useGlobalPkgs = true; + }; + + # Because everything is encrypted and I'm the only user, this is fine. + services.xserver.displayManager.autoLogin.user = "geoffrey"; +} diff --git a/os/qwerty-fr-keypad.diff b/os/qwerty-fr-keypad.diff new file mode 100644 index 0000000..d0a0246 --- /dev/null +++ b/os/qwerty-fr-keypad.diff @@ -0,0 +1,10 @@ +--- ./linux/us_qwerty-fr ++++ ./linux/us_qwerty-fr +@@ -4,6 +4,7 @@ + { + include "us(basic)" + include "level3(ralt_switch)" ++ include "keypad(oss)" + + name[Group1]= "US keyboard with french symbols - AltGr combination"; + diff --git a/os/sct_aarch64.patch b/os/sct_aarch64.patch new file mode 100644 index 0000000..8a04378 --- /dev/null +++ b/os/sct_aarch64.patch @@ -0,0 +1,10 @@ +--- a/Makefile ++++ b/Makefile +@@ -32,6 +32,7 @@ LIBDIR_i386=$(PREFIX)/lib + LIBDIR_i686=$(PREFIX)/lib + LIBDIR_amd64=$(PREFIX)/lib + LIBDIR_x86_64=$(PREFIX)/lib64 ++LIBDIR_aarch64=$(PREFIX)/lib + LIBDIR?=$(LIBDIR_$(MACHINE)) + MANDIR_Darwin=$(PREFIX)/share/man + MANDIR_Linux=$(PREFIX)/share/man diff --git a/os/wireless.nix b/os/wireless.nix new file mode 100644 index 0000000..a82666b --- /dev/null +++ b/os/wireless.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + # wireless support via wpa_supplicant + # TODO This doesn't change anything, at least in the VM + networking.wireless = { + enable = true; + networks = builtins.fromJSON (builtins.readFile ./wireless/networks.json); # If this file doesn't exist, run ./wireless/import.py + extraConfig = '' + country=NL + ''; + }; + environment.systemPackages = with pkgs; [ wirelesstools ]; + services.chrony.serverOption = "offline"; +} diff --git a/os/wireless/.gitignore b/os/wireless/.gitignore new file mode 100644 index 0000000..25887d8 --- /dev/null +++ b/os/wireless/.gitignore @@ -0,0 +1,2 @@ +networks.json +networks.env diff --git a/os/wireless/import.py b/os/wireless/import.py new file mode 100755 index 0000000..85ac1d5 --- /dev/null +++ b/os/wireless/import.py @@ -0,0 +1,164 @@ +#!/usr/bin/env python3 + +""" +Exports Wi-Fi networks configuration stored in pass into a format readable by Nix. +""" + +# TODO EAP ca_cert=/etc/ssl/... probably won't work. Example fix: +# builtins.fetchurl { +# url = "https://letsencrypt.org/certs/isrgrootx1.pem"; +# sha256 = "sha256:1la36n2f31j9s03v847ig6ny9lr875q3g7smnq33dcsmf2i5gd92"; +# } + +import hashlib +import json +import os +import subprocess + +import yaml + +# passpy doesn't handle encoding properly, so doing this with calls + +PASSWORD_STORE = os.path.expanduser("~/.password-store") +SUBFOLDER = "wifi" +SEPARATE_PASSWORDS = False +# TODO Find a way to make then env file available at whatever time it is needed + + +class Password: + all: list["Password"] = list() + + def __init__(self, path: str, content: str): + self.path = path + self.content = content + + Password.all.append(self) + + def var(self) -> str: + # return self.path.split("/")[-1].upper() + m = hashlib.sha256() + m.update(self.path.encode()) + return m.hexdigest().upper() + + def val(self) -> str: + return self.content + + def exists(self) -> bool: + return not not self.content + + def key(self) -> str: + if SEPARATE_PASSWORDS: + return f"@{self.var()}@" + else: + return self.val() + + @classmethod + def vars(cls) -> dict[str, str]: + vars = dict() + for password in cls.all: + if not password.content: + continue + var = password.var() + assert var not in vars, f"Duplicate key: {var}" + vars[var] = password.val() + return vars + + +def list_networks() -> list[str]: + paths = [] + pass_folder = os.path.join(PASSWORD_STORE, SUBFOLDER) + for filename in os.listdir(pass_folder): + if not filename.endswith(".gpg"): + continue + filepath = os.path.join(pass_folder, filename) + if not os.path.isfile(filepath): + continue + + file = filename[:-4] + path = os.path.join(SUBFOLDER, file) + paths.append(path) + return paths + + +def format_wpa_supplicant_conf(conf: dict, indent: str = "") -> str: + lines = [] + for k, v in conf.items(): + if isinstance(v, str): + val = '"' + v.replace('"', '\\"') + '"' + elif isinstance(v, Password): + val = v.key() + elif isinstance(v, list): + assert all( + map(lambda i: isinstance(i, str), v) + ), "Only list of strings supported" + val = " ".join(v) + else: + val = str(v) + lines.append(f"{indent}{k}={val}") + return "\n".join(lines) + + +networks = {} +for path in list_networks(): + proc = subprocess.run(["pass", path], stdout=subprocess.PIPE) + proc.check_returncode() + + raw = proc.stdout.decode() + split = raw.split("\n") + + password = Password(path, split[0]) + data = yaml.safe_load("\n".join(split[1:])) or dict() + # print(path, data) # DEBUG + + # Helpers to prevent repetition + suffixes = data.pop("suffixes", [""]) + data.setdefault("key_mgmt", ["WPA-PSK"] if password.exists() else ["NONE"]) + if password: + if any(map(lambda m: "PSK" in m.split("-"), data["key_mgmt"])): + data["psk"] = password + if "NONE" in data["key_mgmt"]: + data["wep_key0"] = password + if any(map(lambda m: "EAP" in m.split("-"), data["key_mgmt"])): + data["password"] = password + assert "ssid" in data, f"{path}: Missing SSID" + + # # Output wpa_supplicant conf, for debug + # for suffix in suffixes: + # wpas = data.copy() + # wpas["ssid"] += suffix + # print(f"# {path}") + # print("network={") + # print(format_wpa_supplicant_conf(wpas, indent=" ")) + # print("}") + # print() + + # Convert to nix configuration + ssid = data.pop("ssid") + network = {} + key_mgmt = data.pop("key_mgmt", None) + psk = data.pop("psk", None) + priority = data.pop("priority", None) + # No support for hidden + # No support for extraConfig (all is assumed to be auth) + if key_mgmt: + network["authProtocols"] = key_mgmt + if psk: + network["psk"] = psk.key() + if data: + raise NotImplementedError(f"{path}: Unhandled non-auth extra: {data}") + else: + if data: + network["auth"] = format_wpa_supplicant_conf(data) + if priority: + network["priority"] = int(priority) + + for suffix in suffixes: + networks[ssid + suffix] = network + +with open("networks.json", "w") as fd: + json.dump(networks, fd, indent=4) + +with open("networks.env", "w") as fd: + if SEPARATE_PASSWORDS: + for k, v in Password.vars().items(): + print(f"{k}={v}", file=fd) diff --git a/pindakaas/hardware.nix b/pindakaas/hardware.nix new file mode 100644 index 0000000..3fd9443 --- /dev/null +++ b/pindakaas/hardware.nix @@ -0,0 +1,30 @@ +{ pkgs, config, ... }: +{ + imports = [ + + ]; + + boot = { + # nixos-hardware use latest kernel by default. It has been set a while ago, we maybe don't need it anymore? + kernelPackages = pkgs.linuxPackages; + + # Otherwise it will not show stage1 echo and prompt + # UPST + kernelParams = ["console=tty0"]; + + # Pinebook supports UEFI, at least when tow-boot is installed on the SPI + loader = { + # EFI Variables don't work (no generation appears in systemd-boot) + efi.canTouchEfiVariables = false; + + # systemd-boot crashes after booting, so GRUB it is + grub = { + enable = true; + efiSupport = true; + efiInstallAsRemovable = true; + device = "nodev"; + }; + }; + }; + +} diff --git a/pindakaas/options.nix b/pindakaas/options.nix new file mode 100644 index 0000000..2f7df32 --- /dev/null +++ b/pindakaas/options.nix @@ -0,0 +1,16 @@ +{ ... }: +{ + frogeye.extra = true; + frogeye.desktop = { + xorg = true; + x11_screens = [ "DP-1" "eDP-1" ]; + maxVideoHeight = 720; + phasesBrightness = { + enable = true; + backlight = "edp-backlight"; + jour = 3500; + crepuscule = 3000; + nuit = 700; + }; + }; +} diff --git a/pindakaas/os.nix b/pindakaas/os.nix new file mode 100644 index 0000000..9a992d4 --- /dev/null +++ b/pindakaas/os.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + imports = [ + ../os + ./hardware.nix + ./dk.nix + ./options.nix + ]; + + networking.hostName = "pindakaas"; +} diff --git a/pindakaas_sd/dk.nix b/pindakaas_sd/dk.nix new file mode 100644 index 0000000..70de3ae --- /dev/null +++ b/pindakaas_sd/dk.nix @@ -0,0 +1,2 @@ +{ ... } @ args: +import ../dk/single_uefi_btrfs.nix (args // { id = "mmc-SN32G_0xfb19ae99"; name = "pindakaas_sd"; }) diff --git a/pindakaas_sd/os.nix b/pindakaas_sd/os.nix new file mode 100644 index 0000000..75219ff --- /dev/null +++ b/pindakaas_sd/os.nix @@ -0,0 +1,11 @@ +{ pkgs, config, ... }: +{ + imports = [ + ../os + ../pindakaas/options.nix + ../pindakaas/hardware.nix + ./dk.nix + ]; + + networking.hostName = "pindakaas_sd"; +} diff --git a/profile b/profile deleted file mode 100644 index 664271f..0000000 --- a/profile +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh - -. ~/.config/shell/shenv -. ~/.config/shell/shrc diff --git a/Zeal/Zeal.conf b/unprocessed/Zeal/Zeal.conf similarity index 100% rename from Zeal/Zeal.conf rename to unprocessed/Zeal/Zeal.conf diff --git a/config/automatrop/.gitignore b/unprocessed/config/automatrop/.gitignore similarity index 100% rename from config/automatrop/.gitignore rename to unprocessed/config/automatrop/.gitignore diff --git a/config/automatrop/README.md b/unprocessed/config/automatrop/README.md similarity index 100% rename from config/automatrop/README.md rename to unprocessed/config/automatrop/README.md diff --git a/config/automatrop/ansible.cfg b/unprocessed/config/automatrop/ansible.cfg similarity index 100% rename from config/automatrop/ansible.cfg rename to unprocessed/config/automatrop/ansible.cfg diff --git a/config/automatrop/group_vars/all b/unprocessed/config/automatrop/group_vars/all similarity index 100% rename from config/automatrop/group_vars/all rename to unprocessed/config/automatrop/group_vars/all diff --git a/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr b/unprocessed/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr similarity index 100% rename from config/automatrop/host_vars/curacao.geoffrey.frogeye.fr rename to unprocessed/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr diff --git a/config/automatrop/host_vars/gho.geoffrey.frogeye.fr b/unprocessed/config/automatrop/host_vars/gho.geoffrey.frogeye.fr similarity index 100% rename from config/automatrop/host_vars/gho.geoffrey.frogeye.fr rename to unprocessed/config/automatrop/host_vars/gho.geoffrey.frogeye.fr diff --git a/config/automatrop/hosts b/unprocessed/config/automatrop/hosts similarity index 100% rename from config/automatrop/hosts rename to unprocessed/config/automatrop/hosts diff --git a/unprocessed/config/automatrop/playbooks/default.yml b/unprocessed/config/automatrop/playbooks/default.yml new file mode 100644 index 0000000..b02d58a --- /dev/null +++ b/unprocessed/config/automatrop/playbooks/default.yml @@ -0,0 +1,15 @@ +--- +- name: Default + hosts: all + roles: + - role: system + tags: system + when: root_access + - role: dotfiles + tags: dotfiles + - role: termux + tags: termux + when: termux + - role: extensions + tags: extensions +# TODO Dependencies diff --git a/config/automatrop/roles/dotfiles/handlers/main.yml b/unprocessed/config/automatrop/roles/dotfiles/handlers/main.yml similarity index 100% rename from config/automatrop/roles/dotfiles/handlers/main.yml rename to unprocessed/config/automatrop/roles/dotfiles/handlers/main.yml diff --git a/unprocessed/config/automatrop/roles/dotfiles/tasks/main.yml b/unprocessed/config/automatrop/roles/dotfiles/tasks/main.yml new file mode 100644 index 0000000..ced1daf --- /dev/null +++ b/unprocessed/config/automatrop/roles/dotfiles/tasks/main.yml @@ -0,0 +1,9 @@ +--- +- 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 diff --git a/config/automatrop/roles/extensions/tasks/main.yml b/unprocessed/config/automatrop/roles/extensions/tasks/main.yml similarity index 100% rename from config/automatrop/roles/extensions/tasks/main.yml rename to unprocessed/config/automatrop/roles/extensions/tasks/main.yml diff --git a/config/automatrop/roles/extensions/templates/extrc.sh.j2 b/unprocessed/config/automatrop/roles/extensions/templates/extrc.sh.j2 similarity index 100% rename from config/automatrop/roles/extensions/templates/extrc.sh.j2 rename to unprocessed/config/automatrop/roles/extensions/templates/extrc.sh.j2 diff --git a/config/automatrop/roles/system/files/getty.service b/unprocessed/config/automatrop/roles/system/files/getty.service similarity index 100% rename from config/automatrop/roles/system/files/getty.service rename to unprocessed/config/automatrop/roles/system/files/getty.service diff --git a/config/automatrop/roles/system/files/xorg/intel_backlight.conf b/unprocessed/config/automatrop/roles/system/files/xorg/intel_backlight.conf similarity index 100% rename from config/automatrop/roles/system/files/xorg/intel_backlight.conf rename to unprocessed/config/automatrop/roles/system/files/xorg/intel_backlight.conf diff --git a/config/automatrop/roles/system/files/xorg/joystick.conf b/unprocessed/config/automatrop/roles/system/files/xorg/joystick.conf similarity index 100% rename from config/automatrop/roles/system/files/xorg/joystick.conf rename to unprocessed/config/automatrop/roles/system/files/xorg/joystick.conf diff --git a/unprocessed/config/automatrop/roles/system/handlers/main.yaml b/unprocessed/config/automatrop/roles/system/handlers/main.yaml new file mode 100644 index 0000000..a0bc42e --- /dev/null +++ b/unprocessed/config/automatrop/roles/system/handlers/main.yaml @@ -0,0 +1,10 @@ +- name: Reload systemd daemon + ansible.builtin.systemd: + daemon_reload: true + listen: systemd changed + become: true + +- 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 diff --git a/unprocessed/config/automatrop/roles/system/tasks/main.yml b/unprocessed/config/automatrop/roles/system/tasks/main.yml new file mode 100644 index 0000000..002d579 --- /dev/null +++ b/unprocessed/config/automatrop/roles/system/tasks/main.yml @@ -0,0 +1,70 @@ +# Xorg configuration + +- 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 + 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' + 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: + - 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: + - systemd changed + when: not auto_numlock diff --git a/config/automatrop/roles/termux/tasks/main.yml b/unprocessed/config/automatrop/roles/termux/tasks/main.yml similarity index 75% rename from config/automatrop/roles/termux/tasks/main.yml rename to unprocessed/config/automatrop/roles/termux/tasks/main.yml index 8656d6d..35504f6 100644 --- a/config/automatrop/roles/termux/tasks/main.yml +++ b/unprocessed/config/automatrop/roles/termux/tasks/main.yml @@ -13,15 +13,7 @@ path: "{{ ansible_user_dir }}/.hushlogin" mode: u=rw,g=r,o=r -# 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 - - termux - register: base16_schemes - tags: - - color - +# https://github.com/kdrag0n/base16-termux/blob/master/templates/default.mustache - name: Download base16 theme for Termux ansible.builtin.copy: content: "{{ base16_schemes['schemes'][base16_scheme]['termux']['colors']['base16-' + base16_scheme + '.properties'] }}" diff --git a/config/automatrop/roles/vdirsyncer/templates/config.j2 b/unprocessed/config/automatrop/roles/vdirsyncer/templates/config.j2 similarity index 100% rename from config/automatrop/roles/vdirsyncer/templates/config.j2 rename to unprocessed/config/automatrop/roles/vdirsyncer/templates/config.j2 diff --git a/config/.dfrecur b/unprocessed/config/autorandr/.dfrecur similarity index 100% rename from config/.dfrecur rename to unprocessed/config/autorandr/.dfrecur diff --git a/config/autorandr/bg b/unprocessed/config/autorandr/bg similarity index 100% rename from config/autorandr/bg rename to unprocessed/config/autorandr/bg diff --git a/config/autorandr/postswitch b/unprocessed/config/autorandr/postswitch similarity index 100% rename from config/autorandr/postswitch rename to unprocessed/config/autorandr/postswitch diff --git a/config/j4status/config b/unprocessed/config/j4status/config similarity index 100% rename from config/j4status/config rename to unprocessed/config/j4status/config diff --git a/config/khal/config b/unprocessed/config/khal/config similarity index 100% rename from config/khal/config rename to unprocessed/config/khal/config diff --git a/config/khard/khard.conf b/unprocessed/config/khard/khard.conf similarity index 100% rename from config/khard/khard.conf rename to unprocessed/config/khard/khard.conf diff --git a/config/linuxColors.sh b/unprocessed/config/linuxColors.sh similarity index 100% rename from config/linuxColors.sh rename to unprocessed/config/linuxColors.sh diff --git a/config/offlineimap.py b/unprocessed/config/offlineimap.py similarity index 100% rename from config/offlineimap.py rename to unprocessed/config/offlineimap.py diff --git a/config/optiSvgo.yml b/unprocessed/config/optiSvgo.yml similarity index 100% rename from config/optiSvgo.yml rename to unprocessed/config/optiSvgo.yml diff --git a/config/polybar/bars.ini b/unprocessed/config/polybar/bars.ini similarity index 100% rename from config/polybar/bars.ini rename to unprocessed/config/polybar/bars.ini diff --git a/config/polybar/bbswitch b/unprocessed/config/polybar/bbswitch similarity index 100% rename from config/polybar/bbswitch rename to unprocessed/config/polybar/bbswitch diff --git a/config/polybar/config b/unprocessed/config/polybar/config similarity index 98% rename from config/polybar/config rename to unprocessed/config/polybar/config index 8927355..b3f1b77 100644 --- a/config/polybar/config +++ b/unprocessed/config/polybar/config @@ -51,9 +51,8 @@ padding-right = 2 module-margin-left = 1 module-margin-right = 1 -font-0 = "Font Awesome:size=10;0" -font-1 = "DejaVu Sans:size=10;0" -font-2 = "DejaVuSansMono Nerd Font Mono:pixelsize=10;0" +font-0 = "DejaVu Sans:size=10;0" +font-1 = "DejaVuSansMono Nerd Font Mono:pixelsize=10;0" modules-left = i3 diff --git a/config/polybar/config.ini b/unprocessed/config/polybar/config.ini similarity index 100% rename from config/polybar/config.ini rename to unprocessed/config/polybar/config.ini diff --git a/config/polybar/keystore b/unprocessed/config/polybar/keystore similarity index 100% rename from config/polybar/keystore rename to unprocessed/config/polybar/keystore diff --git a/config/polybar/launch.sh b/unprocessed/config/polybar/launch.sh similarity index 100% rename from config/polybar/launch.sh rename to unprocessed/config/polybar/launch.sh diff --git a/config/polybar/linuxmismatch b/unprocessed/config/polybar/linuxmismatch similarity index 100% rename from config/polybar/linuxmismatch rename to unprocessed/config/polybar/linuxmismatch diff --git a/config/polybar/modules.ini b/unprocessed/config/polybar/modules.ini similarity index 100% rename from config/polybar/modules.ini rename to unprocessed/config/polybar/modules.ini diff --git a/config/polybar/todo b/unprocessed/config/polybar/todo similarity index 100% rename from config/polybar/todo rename to unprocessed/config/polybar/todo diff --git a/config/scripts/adb_backup_extract b/unprocessed/config/scripts/adb_backup_extract similarity index 100% rename from config/scripts/adb_backup_extract rename to unprocessed/config/scripts/adb_backup_extract diff --git a/config/scripts/arch-kexec b/unprocessed/config/scripts/arch-kexec similarity index 100% rename from config/scripts/arch-kexec rename to unprocessed/config/scripts/arch-kexec diff --git a/config/scripts/cudarun b/unprocessed/config/scripts/cudarun similarity index 100% rename from config/scripts/cudarun rename to unprocessed/config/scripts/cudarun diff --git a/config/scripts/dafont b/unprocessed/config/scripts/dafont similarity index 100% rename from config/scripts/dafont rename to unprocessed/config/scripts/dafont diff --git a/config/scripts/debloc b/unprocessed/config/scripts/debloc similarity index 100% rename from config/scripts/debloc rename to unprocessed/config/scripts/debloc diff --git a/config/scripts/diapo b/unprocessed/config/scripts/diapo similarity index 100% rename from config/scripts/diapo rename to unprocessed/config/scripts/diapo diff --git a/config/scripts/hc b/unprocessed/config/scripts/hc similarity index 100% rename from config/scripts/hc rename to unprocessed/config/scripts/hc diff --git a/config/scripts/hl b/unprocessed/config/scripts/hl similarity index 100% rename from config/scripts/hl rename to unprocessed/config/scripts/hl diff --git a/config/scripts/html2pdf b/unprocessed/config/scripts/html2pdf similarity index 100% rename from config/scripts/html2pdf rename to unprocessed/config/scripts/html2pdf diff --git a/config/scripts/install-wsl b/unprocessed/config/scripts/install-wsl similarity index 100% rename from config/scripts/install-wsl rename to unprocessed/config/scripts/install-wsl diff --git a/config/scripts/logstasync b/unprocessed/config/scripts/logstasync similarity index 100% rename from config/scripts/logstasync rename to unprocessed/config/scripts/logstasync diff --git a/config/scripts/machines b/unprocessed/config/scripts/machines similarity index 100% rename from config/scripts/machines rename to unprocessed/config/scripts/machines diff --git a/config/scripts/md2html b/unprocessed/config/scripts/md2html similarity index 100% rename from config/scripts/md2html rename to unprocessed/config/scripts/md2html diff --git a/config/scripts/mel b/unprocessed/config/scripts/mel similarity index 100% rename from config/scripts/mel rename to unprocessed/config/scripts/mel diff --git a/config/scripts/melConf b/unprocessed/config/scripts/melConf similarity index 100% rename from config/scripts/melConf rename to unprocessed/config/scripts/melConf diff --git a/config/scripts/musiqueBof b/unprocessed/config/scripts/musiqueBof similarity index 100% rename from config/scripts/musiqueBof rename to unprocessed/config/scripts/musiqueBof diff --git a/config/scripts/nv b/unprocessed/config/scripts/nv similarity index 100% rename from config/scripts/nv rename to unprocessed/config/scripts/nv diff --git a/config/scripts/package-lock.json b/unprocessed/config/scripts/package-lock.json similarity index 100% rename from config/scripts/package-lock.json rename to unprocessed/config/scripts/package-lock.json diff --git a/config/scripts/package.json b/unprocessed/config/scripts/package.json similarity index 100% rename from config/scripts/package.json rename to unprocessed/config/scripts/package.json diff --git a/config/scripts/proxy b/unprocessed/config/scripts/proxy similarity index 100% rename from config/scripts/proxy rename to unprocessed/config/scripts/proxy diff --git a/config/scripts/remcrlf b/unprocessed/config/scripts/remcrlf similarity index 77% rename from config/scripts/remcrlf rename to unprocessed/config/scripts/remcrlf index 09e5882..8364e2a 100755 --- a/config/scripts/remcrlf +++ b/unprocessed/config/scripts/remcrlf @@ -1,4 +1,6 @@ #!/usr/bin/env bash +#! nix-shell -i bash --pure +#! nix-shell -p bash # Removes CRLF (^M or \r) from a file diff --git a/config/scripts/tunnel b/unprocessed/config/scripts/tunnel similarity index 100% rename from config/scripts/tunnel rename to unprocessed/config/scripts/tunnel diff --git a/config/scripts/tvshow b/unprocessed/config/scripts/tvshow similarity index 100% rename from config/scripts/tvshow rename to unprocessed/config/scripts/tvshow diff --git a/config/scripts/updatedate b/unprocessed/config/scripts/updatedate similarity index 100% rename from config/scripts/updatedate rename to unprocessed/config/scripts/updatedate diff --git a/config/systemd/user/.gitignore b/unprocessed/config/systemd/user/.gitignore similarity index 100% rename from config/systemd/user/.gitignore rename to unprocessed/config/systemd/user/.gitignore diff --git a/config/systemd/user/ipfs.service b/unprocessed/config/systemd/user/ipfs.service similarity index 100% rename from config/systemd/user/ipfs.service rename to unprocessed/config/systemd/user/ipfs.service diff --git a/config/systemd/user/melfetch.service b/unprocessed/config/systemd/user/melfetch.service similarity index 100% rename from config/systemd/user/melfetch.service rename to unprocessed/config/systemd/user/melfetch.service diff --git a/config/systemd/user/melfetch.timer b/unprocessed/config/systemd/user/melfetch.timer similarity index 100% rename from config/systemd/user/melfetch.timer rename to unprocessed/config/systemd/user/melfetch.timer diff --git a/config/systemd/user/urxvtd.service b/unprocessed/config/systemd/user/urxvtd.service similarity index 100% rename from config/systemd/user/urxvtd.service rename to unprocessed/config/systemd/user/urxvtd.service diff --git a/config/systemd/user/urxvtd.socket b/unprocessed/config/systemd/user/urxvtd.socket similarity index 100% rename from config/systemd/user/urxvtd.socket rename to unprocessed/config/systemd/user/urxvtd.socket diff --git a/config/systemd/user/x0vncserver.service b/unprocessed/config/systemd/user/x0vncserver.service similarity index 100% rename from config/systemd/user/x0vncserver.service rename to unprocessed/config/systemd/user/x0vncserver.service diff --git a/config/todoman/todoman.conf b/unprocessed/config/todoman/todoman.conf similarity index 100% rename from config/todoman/todoman.conf rename to unprocessed/config/todoman/todoman.conf diff --git a/config/tridactyl/themes/.gitignore b/unprocessed/config/tridactyl/themes/.gitignore similarity index 100% rename from config/tridactyl/themes/.gitignore rename to unprocessed/config/tridactyl/themes/.gitignore diff --git a/config/tridactyl/tridactylrc b/unprocessed/config/tridactyl/tridactylrc similarity index 100% rename from config/tridactyl/tridactylrc rename to unprocessed/config/tridactyl/tridactylrc diff --git a/config/autorandr/.dfrecur b/unprocessed/config/vdirsyncer/.dfrecur similarity index 100% rename from config/autorandr/.dfrecur rename to unprocessed/config/vdirsyncer/.dfrecur diff --git a/config/vdirsyncer/config b/unprocessed/config/vdirsyncer/config similarity index 100% rename from config/vdirsyncer/config rename to unprocessed/config/vdirsyncer/config diff --git a/config/xinitrc b/unprocessed/config/xinitrc similarity index 100% rename from config/xinitrc rename to unprocessed/config/xinitrc diff --git a/termux/.gitignore b/unprocessed/termux/.gitignore similarity index 100% rename from termux/.gitignore rename to unprocessed/termux/.gitignore diff --git a/termux/bin/.gitignore b/unprocessed/termux/bin/.gitignore similarity index 100% rename from termux/bin/.gitignore rename to unprocessed/termux/bin/.gitignore diff --git a/termux/boot/autosvc b/unprocessed/termux/boot/autosvc similarity index 100% rename from termux/boot/autosvc rename to unprocessed/termux/boot/autosvc diff --git a/termux/boot/symlink b/unprocessed/termux/boot/symlink similarity index 100% rename from termux/boot/symlink rename to unprocessed/termux/boot/symlink diff --git a/termux/font.ttf b/unprocessed/termux/font.ttf similarity index 100% rename from termux/font.ttf rename to unprocessed/termux/font.ttf diff --git a/termux/scripts/autosvc b/unprocessed/termux/scripts/autosvc similarity index 100% rename from termux/scripts/autosvc rename to unprocessed/termux/scripts/autosvc diff --git a/termux/scripts/service b/unprocessed/termux/scripts/service similarity index 100% rename from termux/scripts/service rename to unprocessed/termux/scripts/service diff --git a/termux/scripts/sudo b/unprocessed/termux/scripts/sudo similarity index 100% rename from termux/scripts/sudo rename to unprocessed/termux/scripts/sudo diff --git a/termux/scripts/tsu.old b/unprocessed/termux/scripts/tsu.old similarity index 100% rename from termux/scripts/tsu.old rename to unprocessed/termux/scripts/tsu.old diff --git a/termux/scripts/yt b/unprocessed/termux/scripts/yt similarity index 100% rename from termux/scripts/yt rename to unprocessed/termux/scripts/yt diff --git a/termux/services/autosvc b/unprocessed/termux/services/autosvc similarity index 100% rename from termux/services/autosvc rename to unprocessed/termux/services/autosvc diff --git a/termux/services/crond b/unprocessed/termux/services/crond similarity index 100% rename from termux/services/crond rename to unprocessed/termux/services/crond diff --git a/termux/services/sshd b/unprocessed/termux/services/sshd similarity index 100% rename from termux/services/sshd rename to unprocessed/termux/services/sshd diff --git a/termux/services/syncthing b/unprocessed/termux/services/syncthing similarity index 100% rename from termux/services/syncthing rename to unprocessed/termux/services/syncthing diff --git a/termux/services/syncthing.user b/unprocessed/termux/services/syncthing.user similarity index 100% rename from termux/services/syncthing.user rename to unprocessed/termux/services/syncthing.user diff --git a/termux/shell b/unprocessed/termux/shell similarity index 100% rename from termux/shell rename to unprocessed/termux/shell diff --git a/xsession b/unprocessed/xsession similarity index 100% rename from xsession rename to unprocessed/xsession diff --git a/vimpcrc b/vimpcrc deleted file mode 100644 index d3f547c..0000000 --- a/vimpcrc +++ /dev/null @@ -1,8 +0,0 @@ -map FF :browsegg/ -map à :set add nexta:set add end -map @ :set add nexta:set add end:next -map ° D:browseA:shuffle:play:playlist -set songformat {%a - %b: %t}|{%f}$E$R $H[$H%l$H]$H -set libraryformat %n \| {%t}|{%f}$E$R $H[$H%l$H]$H -set ignorecase -set sort library diff --git a/zshenv b/zshenv deleted file mode 100644 index f78ec50..0000000 --- a/zshenv +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env zsh - -ZDOTDIR=~/.config/shell