From a313260ac9184327afafb8524a1778900000ace9 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 24 Sep 2025 11:01:47 +0200 Subject: modules/legacy/{rofi,alacritty}: Migrate to by-name --- modules/by-name/al/alacritty/module.nix | 468 +++++++++++++++++++++ modules/by-name/al/alacritty/theme.toml | 89 ++++ modules/by-name/ro/rofi/module.nix | 31 ++ modules/by-name/ro/rofi/nord-twoLines.rasi | 101 +++++ modules/by-name/ro/rofi/nord-twoLines.rasi.license | 9 + 5 files changed, 698 insertions(+) create mode 100644 modules/by-name/al/alacritty/module.nix create mode 100644 modules/by-name/al/alacritty/theme.toml create mode 100644 modules/by-name/ro/rofi/module.nix create mode 100644 modules/by-name/ro/rofi/nord-twoLines.rasi create mode 100644 modules/by-name/ro/rofi/nord-twoLines.rasi.license (limited to 'modules/by-name') 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 +# 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 . +{ + 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/by-name/al/alacritty/theme.toml b/modules/by-name/al/alacritty/theme.toml new file mode 100644 index 00000000..2b326e43 --- /dev/null +++ b/modules/by-name/al/alacritty/theme.toml @@ -0,0 +1,89 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz +# 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 . + +# Nightfox Alacritty Colors +## name: carbonfox +## upstream: https://github.com/edeneast/nightfox.nvim/raw/main/extra/carbonfox/alacritty.toml + +[primary] +background = "#161616" +foreground = "#f2f4f8" +dim_foreground = "#b6b8bb" +bright_foreground = "#f9fbff" + +[cursor] +text = "#f2f4f8" +cursor = "#b6b8bb" + +[vi_mode_cursor] +text = "#f2f4f8" +cursor = "#33b1ff" + +[search.matches] +foreground = "#f2f4f8" +background = "#525253" + +[search.focused_match] +foreground = "#f2f4f8" +background = "#3ddbd9" + +[footer_bar] +foreground = "#f2f4f8" +background = "#353535" + +[hints.start] +foreground = "#f2f4f8" +background = "#3ddbd9" + +[hints.end] +foreground = "#f2f4f8" +background = "#353535" + +[selection] +text = "#f2f4f8" +background = "#2a2a2a" + +[normal] +black = "#282828" +red = "#ee5396" +green = "#25be6a" +yellow = "#08bdba" +blue = "#78a9ff" +magenta = "#be95ff" +cyan = "#33b1ff" +white = "#dfdfe0" + +[bright] +black = "#484848" +red = "#f16da6" +green = "#46c880" +yellow = "#2dc7c4" +blue = "#8cb6ff" +magenta = "#c8a5ff" +cyan = "#52bdff" +white = "#e4e4e5" + +[dim] +black = "#222222" +red = "#ca4780" +green = "#1fa25a" +yellow = "#07a19e" +blue = "#6690d9" +magenta = "#a27fd9" +cyan = "#2b96d9" +white = "#bebebe" + +[[indexed_colors]] +index = 16 +color = "#3ddbd9" + +[[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 +# 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 . +{ + 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/by-name/ro/rofi/nord-twoLines.rasi b/modules/by-name/ro/rofi/nord-twoLines.rasi new file mode 100644 index 00000000..612b907f --- /dev/null +++ b/modules/by-name/ro/rofi/nord-twoLines.rasi @@ -0,0 +1,101 @@ +/******************************************************************************* + * ROFI TWO LINES THEME USING THE NORD COLOR PALETTE + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + * Nord Project Repo : https://github.com/arcticicestudio/nord + *******************************************************************************/ + +* { + font: "Fira Code 10"; + + nord0: #2e3440; + nord1: #3b4252; + nord2: #434c5e; + nord3: #4c566a; + + nord4: #d8dee9; + nord5: #e5e9f0; + nord6: #eceff4; + + nord7: #8fbcbb; + nord8: #88c0d0; + nord9: #81a1c1; + nord10: #5e81ac; + nord11: #bf616a; + + nord12: #d08770; + nord13: #ebcb8b; + nord14: #a3be8c; + nord15: #b48ead; + + background-color: transparent; + text-color: @nord4; + accent-color: @nord8; + + margin: 0px; + padding: 0px; + spacing: 0px; +} + +window { + background-color: @nord0; + + location: north; + width: 100%; +} + +inputbar { + padding: 2px 8px; + spacing: 8px; + children: [ prompt, entry ]; +} + +prompt, entry, element-text, element-icon { + vertical-align: 0.5; +} + +prompt { + text-color: @accent-color; +} + +listview { + lines: 1; + columns: 4; +} + +element { + padding: 1px 8px; + spacing: 4px; +} + +element normal urgent { + text-color: @nord13; +} + +element normal active { + text-color: @accent-color; +} + +element selected { + text-color: @nord0; +} + +element selected normal { + background-color: @accent-color; +} + +element selected urgent { + background-color: @nord13; +} + +element selected active { + background-color: @nord8; +} + +element-icon { + size: 0.75em; +} + +element-text { + text-color: inherit; +} diff --git a/modules/by-name/ro/rofi/nord-twoLines.rasi.license b/modules/by-name/ro/rofi/nord-twoLines.rasi.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/ro/rofi/nord-twoLines.rasi.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz +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 . -- cgit 1.4.1