diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-09-24 11:01:47 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-09-24 11:01:47 +0200 |
commit | a313260ac9184327afafb8524a1778900000ace9 (patch) | |
tree | 59a7dfe5fa34414c97f0849d274f37576475815b /modules/by-name | |
parent | modules/ssh: Adapt to home-manager module changes (diff) | |
download | nixos-config-a313260ac9184327afafb8524a1778900000ace9.zip |
modules/legacy/{rofi,alacritty}: Migrate to by-name
Diffstat (limited to '')
-rw-r--r-- | modules/by-name/al/alacritty/module.nix | 468 | ||||
-rw-r--r-- | modules/by-name/al/alacritty/theme.toml (renamed from modules/home.legacy/conf/alacritty/toml/colorscheme.toml) | 28 | ||||
-rw-r--r-- | modules/by-name/ro/rofi/module.nix | 31 | ||||
-rw-r--r-- | modules/by-name/ro/rofi/nord-twoLines.rasi (renamed from modules/home.legacy/conf/rofi/nord-twoLines.rasi) | 0 | ||||
-rw-r--r-- | modules/by-name/ro/rofi/nord-twoLines.rasi.license (renamed from modules/home.legacy/conf/rofi/nord-twoLines.rasi.license) | 0 |
5 files changed, 513 insertions, 14 deletions
diff --git a/modules/by-name/al/alacritty/module.nix b/modules/by-name/al/alacritty/module.nix new file mode 100644 index 00000000..33db0d3e --- /dev/null +++ b/modules/by-name/al/alacritty/module.nix @@ -0,0 +1,468 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + pkgs, + libraries, + ... +}: let + cfg = config.soispha.programs.alacritty; +in { + options.soispha.programs.alacritty = { + enable = libraries.base.options.mkEnable "alacritty"; + + package = lib.mkPackageOption pkgs "alacritty" {}; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + home.sessionVariables = { + # This is **not** the TERM variable but a special one to signify my favorite terminal. + TERMINAL = "alacritty"; + }; + + programs.alacritty = { + enable = true; + inherit (cfg) package; + + settings = { + bell = { + duration = 0; + }; + + colors = builtins.fromTOML (builtins.readFile ./theme.toml); + + cursor = { + blink_interval = 750; + blink_timeout = 5; + style = { + blinking = "On"; + shape = "Beam"; + }; + thickness = 0.15; + unfocused_hollow = true; + vi_mode_style = "None"; + }; + + env = { + COLORTERM = "truecolor"; + TERM = "alacritty"; + }; + + font = { + builtin_box_drawing = true; + glyph_offset = { + x = -1; + y = -1; + }; + normal = { + family = "SauceCodePro Nerd Font Mono"; + style = "Regular"; + }; + offset = { + x = -1; + y = -1; + }; + size = 12; + }; + + general = { + ipc_socket = true; + live_config_reload = true; + }; + + hints = { + alphabet = "jfkdls;ahgurieowpq"; + enabled = [ + { + binding = { + key = "U"; + mods = "Control|Shift"; + }; + command = "xdg-open"; + hyperlinks = true; + mouse = { + enabled = true; + }; + persist = false; + post_processing = true; + regex = "(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file:|git://|ssh:|ftp://)[^"; + } + { + action = "Paste"; + binding = { + key = "T"; + mods = "Control|Shift"; + }; + post_processing = false; + regex = "([^ '\"`=:\\[\\(]*/)([^/: '\"`\\)\\]]*)"; + } + { + action = "Paste"; + binding = { + key = "H"; + mods = "Control|Shift"; + }; + post_processing = false; + regex = "([a-z0-9]{7,40})\\s"; + } + ]; + }; + + keyboard = { + bindings = [ + { + action = "Paste"; + key = "P"; + mods = "Control"; + } + { + action = "Paste"; + key = "Insert"; + mods = "Shift"; + } + { + chars = "gc"; + key = "Slash"; + mods = "Control"; + } + { + action = "Copy"; + key = "Y"; + mods = "Control"; + } + { + action = "ResetFontSize"; + key = "Key0"; + mods = "Control"; + } + { + action = "IncreaseFontSize"; + key = "Equals"; + mods = "Control"; + } + { + action = "IncreaseFontSize"; + key = "Plus"; + mods = "Control"; + } + { + action = "DecreaseFontSize"; + key = "Minus"; + mods = "Control"; + } + { + action = "ToggleViMode"; + key = "Space"; + mods = "Control"; + } + { + action = "ScrollToBottom"; + key = "Space"; + mode = "Vi"; + mods = "Control"; + } + { + action = "ScrollToBottom"; + key = "I"; + mode = "Vi"; + } + { + action = "ToggleViMode"; + key = "I"; + mode = "Vi"; + } + { + action = "ScrollToBottom"; + key = "C"; + mode = "Vi"; + mods = "Control"; + } + { + action = "ToggleViMode"; + key = "C"; + mode = "Vi"; + mods = "Control"; + } + { + action = "ClearSelection"; + key = "Escape"; + mode = "Vi"; + } + { + action = "ScrollLineUp"; + key = "Y"; + mode = "Vi"; + mods = "Control"; + } + { + action = "ScrollLineDown"; + key = "E"; + mode = "Vi"; + mods = "Control"; + } + { + action = "ScrollToTop"; + key = "G"; + mode = "Vi"; + } + { + action = "ScrollToBottom"; + key = "G"; + mode = "Vi"; + mods = "Shift"; + } + { + action = "ScrollPageUp"; + key = "B"; + mode = "Vi"; + mods = "Control"; + } + { + action = "ScrollPageDown"; + key = "F"; + mode = "Vi"; + mods = "Control"; + } + { + action = "ScrollHalfPageUp"; + key = "U"; + mode = "Vi"; + mods = "Control"; + } + { + action = "ScrollHalfPageDown"; + key = "D"; + mode = "Vi"; + mods = "Control"; + } + { + action = "Copy"; + key = "Y"; + mode = "Vi"; + } + { + action = "ClearSelection"; + key = "Y"; + mode = "Vi"; + } + { + action = "ToggleNormalSelection"; + key = "V"; + mode = "Vi"; + } + { + action = "ToggleLineSelection"; + key = "V"; + mode = "Vi"; + mods = "Shift"; + } + { + action = "ToggleBlockSelection"; + key = "V"; + mode = "Vi"; + mods = "Control"; + } + { + action = "ToggleSemanticSelection"; + key = "V"; + mode = "Vi"; + mods = "Alt"; + } + { + action = "Open"; + key = "Return"; + mode = "Vi"; + } + { + action = "Up"; + key = "K"; + mode = "Vi"; + } + { + action = "Down"; + key = "J"; + mode = "Vi"; + } + { + action = "Left"; + key = "H"; + mode = "Vi"; + } + { + action = "Right"; + key = "L"; + mode = "Vi"; + } + { + action = "Up"; + key = "Up"; + mode = "Vi"; + } + { + action = "Down"; + key = "Down"; + mode = "Vi"; + } + { + action = "Left"; + key = "Left"; + mode = "Vi"; + } + { + action = "Right"; + key = "Right"; + mode = "Vi"; + } + { + action = "First"; + key = "Key0"; + mode = "Vi"; + } + { + action = "Last"; + key = "Key4"; + mode = "Vi"; + } + { + action = "FirstOccupied"; + key = "Key6"; + mode = "Vi"; + mods = "Shift"; + } + { + action = "High"; + key = "H"; + mode = "Vi"; + mods = "Shift"; + } + { + action = "Middle"; + key = "M"; + mode = "Vi"; + mods = "Shift"; + } + { + action = "Low"; + key = "L"; + mode = "Vi"; + mods = "Shift"; + } + { + action = "SemanticLeft"; + key = "B"; + mode = "Vi"; + } + { + action = "SemanticRight"; + key = "W"; + mode = "Vi"; + } + { + action = "SemanticRightEnd"; + key = "E"; + mode = "Vi"; + } + { + action = "WordLeft"; + key = "B"; + mode = "Vi"; + mods = "Shift"; + } + { + action = "WordRight"; + key = "W"; + mode = "Vi"; + mods = "Shift"; + } + { + action = "WordRightEnd"; + key = "E"; + mode = "Vi"; + mods = "Shift"; + } + { + action = "Bracket"; + key = "Key5"; + mode = "Vi"; + mods = "Shift"; + } + { + action = "SearchForward"; + key = "Slash"; + mode = "Vi"; + } + { + action = "SearchBackward"; + key = "Slash"; + mode = "Vi"; + mods = "Shift"; + } + { + action = "SearchNext"; + key = "N"; + mode = "Vi"; + } + { + action = "SearchPrevious"; + key = "N"; + mode = "Vi"; + mods = "Shift"; + } + ]; + }; + + mouse = { + bindings = [ + { + action = "Copy"; + mouse = "Middle"; + } + ]; + hide_when_typing = + false; + }; + + scrolling = { + history = 10000; + multiplier = 3; + }; + + selection = { + save_to_clipboard = false; + semantic_escape_chars = ",│`|:\"' ()[]{}<>\t"; + }; + + window = { + class = { + general = "Alacritty"; + instance = "Alacritty"; + }; + decorations = "none"; + decorations_theme_variant = "None"; + dimensions = { + columns = 0; + lines = 0; + }; + dynamic_title = true; + opacity = 0.9; + padding = { + x = 5; + y = 5; + }; + startup_mode = "Windowed"; + title = "Alacritty"; + }; + }; + }; + }; + }; +} diff --git a/modules/home.legacy/conf/alacritty/toml/colorscheme.toml b/modules/by-name/al/alacritty/theme.toml index 13c796c9..2b326e43 100644 --- a/modules/home.legacy/conf/alacritty/toml/colorscheme.toml +++ b/modules/by-name/al/alacritty/theme.toml @@ -12,45 +12,45 @@ ## name: carbonfox ## upstream: https://github.com/edeneast/nightfox.nvim/raw/main/extra/carbonfox/alacritty.toml -[colors.primary] +[primary] background = "#161616" foreground = "#f2f4f8" dim_foreground = "#b6b8bb" bright_foreground = "#f9fbff" -[colors.cursor] +[cursor] text = "#f2f4f8" cursor = "#b6b8bb" -[colors.vi_mode_cursor] +[vi_mode_cursor] text = "#f2f4f8" cursor = "#33b1ff" -[colors.search.matches] +[search.matches] foreground = "#f2f4f8" background = "#525253" -[colors.search.focused_match] +[search.focused_match] foreground = "#f2f4f8" background = "#3ddbd9" -[colors.footer_bar] +[footer_bar] foreground = "#f2f4f8" background = "#353535" -[colors.hints.start] +[hints.start] foreground = "#f2f4f8" background = "#3ddbd9" -[colors.hints.end] +[hints.end] foreground = "#f2f4f8" background = "#353535" -[colors.selection] +[selection] text = "#f2f4f8" background = "#2a2a2a" -[colors.normal] +[normal] black = "#282828" red = "#ee5396" green = "#25be6a" @@ -60,7 +60,7 @@ magenta = "#be95ff" cyan = "#33b1ff" white = "#dfdfe0" -[colors.bright] +[bright] black = "#484848" red = "#f16da6" green = "#46c880" @@ -70,7 +70,7 @@ magenta = "#c8a5ff" cyan = "#52bdff" white = "#e4e4e5" -[colors.dim] +[dim] black = "#222222" red = "#ca4780" green = "#1fa25a" @@ -80,10 +80,10 @@ magenta = "#a27fd9" cyan = "#2b96d9" white = "#bebebe" -[[colors.indexed_colors]] +[[indexed_colors]] index = 16 color = "#3ddbd9" -[[colors.indexed_colors]] +[[indexed_colors]] index = 17 color = "#ff7eb6" diff --git a/modules/by-name/ro/rofi/module.nix b/modules/by-name/ro/rofi/module.nix new file mode 100644 index 00000000..f2b404d6 --- /dev/null +++ b/modules/by-name/ro/rofi/module.nix @@ -0,0 +1,31 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + libraries, + ... +}: let + cfg = config.soispha.programs.rofi; +in { + options.soispha.programs.rofi = { + enable = libraries.base.options.mkEnable "rofi"; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + programs.rofi = { + enable = true; + terminal = lib.getExe config.soispha.programs.alacritty.package; + theme = ./nord-twoLines.rasi; + }; + }; + }; +} diff --git a/modules/home.legacy/conf/rofi/nord-twoLines.rasi b/modules/by-name/ro/rofi/nord-twoLines.rasi index 612b907f..612b907f 100644 --- a/modules/home.legacy/conf/rofi/nord-twoLines.rasi +++ b/modules/by-name/ro/rofi/nord-twoLines.rasi diff --git a/modules/home.legacy/conf/rofi/nord-twoLines.rasi.license b/modules/by-name/ro/rofi/nord-twoLines.rasi.license index eae6a84c..eae6a84c 100644 --- a/modules/home.legacy/conf/rofi/nord-twoLines.rasi.license +++ b/modules/by-name/ro/rofi/nord-twoLines.rasi.license |