diff options
Diffstat (limited to '')
77 files changed, 654 insertions, 966 deletions
diff --git a/modules/by-name/ag/age/module.nix b/modules/by-name/ag/age/module.nix index 6eb0f9c4..6906ca70 100644 --- a/modules/by-name/ag/age/module.nix +++ b/modules/by-name/ag/age/module.nix @@ -5,9 +5,9 @@ pkgs, ... }: let - cfg = config.soispha.age; + cfg = config.vhack.age; in { - options.soispha.age = { + options.vhack.age = { enable = lib.mkEnableOption "secret management with age"; }; diff --git a/modules/by-name/at/atuin/module.nix b/modules/by-name/at/atuin/module.nix index b9e9645a..92c371c0 100644 --- a/modules/by-name/at/atuin/module.nix +++ b/modules/by-name/at/atuin/module.nix @@ -11,6 +11,8 @@ config, lib, extra_modules, + sources, + system, ... }: let cfg = config.soispha.programs.atuin; @@ -56,6 +58,8 @@ in { programs.turtle = { enable = true; + package = sources.turtle.packages."${system}".default; + settings = { sync = lib.mkIf cfg.enableAge { encryption_key_path = "${config.age.secrets.atuin_encryption_key.path}"; diff --git a/modules/by-name/ch/chipass/module.nix b/modules/by-name/ch/chipass/module.nix new file mode 100644 index 00000000..d71d341d --- /dev/null +++ b/modules/by-name/ch/chipass/module.nix @@ -0,0 +1,129 @@ +# 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, + ... +}: let + cfg = config.soispha.programs.chipass; + + iniFormat = pkgs.formats.ini {}; + settingsFile = iniFormat.generate "chipass-settings" cfg.settings; +in { + options.soispha.programs.chipass = { + enable = lib.mkEnableOption "chipass"; + + settings = lib.mkOption { + inherit (iniFormat) type; + default = {}; + example = { + Browser.Enabled = true; + + GUI = { + AdvancedSettings = true; + ApplicationTheme = "dark"; + CompactMode = true; + HidePasswords = true; + }; + + SSHAgent.Enabled = true; + }; + description = '' + Configuration written to + {file}`$XDG_CONFIG_HOME/keepassxc/keepassxc.ini`. + + See <https://github.com/keepassxreboot/keepassxc/blob/develop/src/core/Config.cpp> + for the full list of options. + + ::: {.note} + When the settings are non-empty, the configuration file will be linked + into the Nix store and KeePassXC will report an access error for its + configuration file. This is expected and can not be fixed in a way that + aligns with Home Manager's principles. See [#8257](https://github.com/nix-community/home-manager/issues/8257) for more details. + ::: + ''; + }; + }; + + config = lib.mkIf cfg.enable { + soispha.programs.chipass.settings = lib.mkDefault { + General = { + BackupBeforeSave = true; + AutoSaveAfterEveryChange = true; + BackupFilePathPattern = "${config.home-manager.users.soispha.xdg.dataHome}/chipass/{DB_FILENAME}.old.kdbx"; + ConfigVersion = 2; + }; + + Browser = { + Enabled = false; + CustomProxyLocation = ""; + }; + + FdoSecrets = { + Enabled = true; + }; + + GUI = { + ColorPasswords = false; + CompactMode = false; + TrayIconAppearance = "monochrome-light"; + AdvancedSettings = true; + HidePasswords = true; + }; + + KeeShare = { + Active = ""; + Own = ""; + QuietSuccess = true; + }; + + PasswordGenerator = { + AdditionalChars = ""; + ExcludedChars = ""; + WordList = ":/wordlists/eff_large.wordlist"; + AdvancedMode = true; + Braces = true; + Dashes = true; + EASCII = true; + Length = 128; + Logograms = true; + LowerCase = true; + Math = true; + Numbers = true; + Punctuation = true; + Quotes = true; + SpecialChars = true; + Type = 0; + UpperCase = true; + WordCount = 4; + WordSeparator = ","; + }; + + SSHAgent = { + Enabled = false; + }; + + Security = { + HidePasswordPreviewPanel = true; + IconDownloadFallback = true; + LockDatabaseIdle = false; + LockDatabaseIdleSeconds = 960; + PasswordEmptyPlaceholder = true; + PasswordsHidden = true; + PasswordsRepeatVisible = true; + }; + }; + + home-manager.users.soispha = { + xdg.configFile."keepassxc/keepassxc.ini".source = settingsFile; + }; + }; +} diff --git a/modules/by-name/co/constants/module.nix b/modules/by-name/co/constants/module.nix index 51bf68b7..4ddb6890 100644 --- a/modules/by-name/co/constants/module.nix +++ b/modules/by-name/co/constants/module.nix @@ -72,6 +72,7 @@ lpadmin = 358; msr = 359; polkituser = 360; + unbound = 361; # As per the NixOS file, the uids should not be greater or equal to 400; }; @@ -127,6 +128,7 @@ systemd-coredump # matches systemd-coredump user systemd-oom wpa_supplicant + unbound ; # The gid should match the uid. Thus should not be >= 400; diff --git a/modules/by-name/fi/fish/keymappings/default.nix b/modules/by-name/fi/fish/keymappings/default.nix index 6aed6ce4..9ca0144d 100644 --- a/modules/by-name/fi/fish/keymappings/default.nix +++ b/modules/by-name/fi/fish/keymappings/default.nix @@ -2,6 +2,17 @@ lib.fix (self: let escPlus = key: ''\e\[${key}''; in { + # Missing keymappings: + # bind --preset y,i backward-jump-till and repeat-jump-reverse and begin-selection repeat-jump fish_vi_yank_selection end-selection + # bind --preset y,a backward-jump and repeat-jump-reverse and begin-selection repeat-jump fish_vi_yank_selection end-selection + # bind --preset d,i backward-jump-till and repeat-jump-reverse and begin-selection repeat-jump kill-selection end-selection + # bind --preset d,a backward-jump and repeat-jump-reverse and begin-selection repeat-jump kill-selection end-selection + # bind --preset d 'fish_vi_start_operator delete' + # bind --preset c 'fish_vi_start_operator change' + # bind --preset y 'fish_vi_start_operator yank' + # bind --preset -m insert c,i backward-jump-till and repeat-jump-reverse and begin-selection repeat-jump kill-selection end-selection repaint-mode + # bind --preset -m insert c,a backward-jump and repeat-jump-reverse and begin-selection repeat-jump kill-selection end-selection repaint-mode + "operator" = import ./operator.nix {inherit self;}; "insert" = import ./insert.nix {inherit self escPlus;}; "default" = import ./default_mode.nix {inherit self escPlus;}; diff --git a/modules/by-name/lf/lf/colors b/modules/by-name/lf/lf/colors index ed211581..c7549032 100644 --- a/modules/by-name/lf/lf/colors +++ b/modules/by-name/lf/lf/colors @@ -110,6 +110,7 @@ fi 00 # FILE *.esd 01;31 # image formats (dircolors defaults) +*.webp 01;35 *.jpg 01;35 *.jpeg 01;35 *.mjpg 01;35 diff --git a/modules/by-name/lo/locale/module.nix b/modules/by-name/lo/locale/module.nix index 0aa812ec..fd4e51ec 100644 --- a/modules/by-name/lo/locale/module.nix +++ b/modules/by-name/lo/locale/module.nix @@ -44,7 +44,7 @@ in { LC_COLLATE = "C.UTF-8"; }; extraLocales = [ - "fr_FR.UTF-8/UTF-8" + "fr_FR.UTF-8/UTF-8" ]; }; diff --git a/modules/by-name/ly/ly/setup.sh b/modules/by-name/ly/ly/setup.sh index 6e8bed2b..ee861d6c 100644 --- a/modules/by-name/ly/ly/setup.sh +++ b/modules/by-name/ly/ly/setup.sh @@ -11,11 +11,10 @@ cd "$HOME" || { } if [ -z "$_DID_SYSTEMD_CAT" ]; then - export _DID_SYSTEMD_CAT=1 - exec systemd-cat -t xsession "$0" "$@" + export _DID_SYSTEMD_CAT=1 + exec systemd-cat -t xsession "$0" "$@" fi - # Import environment variables into the systemd user environment. /run/current-system/systemd/bin/systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY XDG_SESSION_ID @@ -36,7 +35,6 @@ mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}" unset _DID_SYSTEMD_CAT - if test "$1"; then # Run the supplied session command. exec "$@" diff --git a/modules/by-name/mp/mpv/module.nix b/modules/by-name/mp/mpv/module.nix index 6843b4fd..bebcfc71 100644 --- a/modules/by-name/mp/mpv/module.nix +++ b/modules/by-name/mp/mpv/module.nix @@ -35,6 +35,7 @@ in { mpv-unwrapped = pkgs.mpv-unwrapped.override { ffmpeg = pkgs.ffmpeg-headless; }; + youtubeSupport = false; }; bindings = { diff --git a/modules/by-name/nv/nvim/autocmds/default.nix b/modules/by-name/nv/nvim/autocmds/default.nix index 706f1bbd..4d7b4894 100644 --- a/modules/by-name/nv/nvim/autocmds/default.nix +++ b/modules/by-name/nv/nvim/autocmds/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - config.home-manager.users.soispha = lib.mkIf cfg.enable { +{config}: { + home-manager.users.soispha = { programs.nixvim = { autoGroups = { cursor_off = {clear = true;}; diff --git a/modules/by-name/nv/nvim/clipboard/default.nix b/modules/by-name/nv/nvim/clipboard/default.nix index f6348e44..26b9ce1a 100644 --- a/modules/by-name/nv/nvim/clipboard/default.nix +++ b/modules/by-name/nv/nvim/clipboard/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim = { clipboard.providers = { wl-copy.enable = true; }; diff --git a/modules/by-name/nv/nvim/mappings/default.nix b/modules/by-name/nv/nvim/mappings/default.nix index 683b0465..6a9175f6 100644 --- a/modules/by-name/nv/nvim/mappings/default.nix +++ b/modules/by-name/nv/nvim/mappings/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - config.home-manager.users.soispha = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha = { programs.nixvim = { globals = { mapleader = " "; @@ -244,7 +238,7 @@ in { { mode = ["n"]; - key = "<leader>s"; + key = "<leader>x"; action = ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>"; options.desc = "replace for the word under the cursor"; } @@ -259,7 +253,27 @@ in { { mode = ["n"]; key = "<leader>X"; - action = "!!$SHELL <CR>"; + action.__raw = '' + function() + local cur_line = tostring(vim.api.nvim_get_current_line()); + vim.api.nvim_del_current_line(); + + local output = vim.system( + { vim.env.SHELL; "-c"; cur_line; }, + { + text = true; + cwd = vim.fs.dirname(vim.api.nvim_buf_get_name(0)); + } + ):wait() + + if output.stdout ~= "" then + vim.api.nvim_put(vim.split(output.stdout, "\n"), "", false, false) + end + if output.stderr ~= "" then + vim.api.nvim_put(vim.split(output.stderr, "\n"), "", false, false) + end + end + ''; options.desc = "Read the current line and execute that line in your $SHELL. The resulting output will replace the curent line that was being executed."; } { diff --git a/modules/by-name/nv/nvim/module.nix b/modules/by-name/nv/nvim/module.nix index 17cc8dcc..66ba7ad6 100644 --- a/modules/by-name/nv/nvim/module.nix +++ b/modules/by-name/nv/nvim/module.nix @@ -21,18 +21,15 @@ useShards = false; baseDirectory = ./plgs; fileName = "default.nix"; + finalizeFunction = name: path: import path {inherit config lib pkgs extra_lib;}; }); -in { - imports = - [ - ./autocmds - ./clipboard - ./mappings - ./options - ./performance - ] - ++ plgs; + autocmds = import ./autocmds {inherit config;}; + clipboard = import ./clipboard {}; + mappings = import ./mappings {}; + options = import ./options {inherit config lib;}; + performance = import ./performance {}; +in { options.soispha.programs.nvim = { enable = lib.mkEnableOption "custom nvim config"; shell = lib.mkOption { @@ -41,62 +38,72 @@ in { }; }; - config = lib.mkIf cfg.enable { - soispha.services.unison.pathsToSync = [ - "~/.local/state/nvim" - ]; - vhack.persist.userDirectories.soispha = [ - ".local/state/nvim" - ]; + config = lib.mkIf cfg.enable ( + lib.mkMerge (plgs + ++ [ + autocmds + clipboard + mappings + options + performance + { + soispha.services.unison.pathsToSync = [ + "~/.local/state/nvim" + ]; + vhack.persist.userDirectories.soispha = [ + ".local/state/nvim" + ]; - home-manager.users.soispha = { - imports = [ - extra_modules.home.nixvim - ]; + home-manager.users.soispha = { + imports = [ + extra_modules.home.nixvim + ]; - home.sessionVariables = { - EDITOR = "nvim"; - VISUAL = "nvim"; - CODEEDITOR = "nvim"; - }; + home.sessionVariables = { + EDITOR = "nvim"; + VISUAL = "nvim"; + CODEEDITOR = "nvim"; + }; - programs.nixvim = { - enable = true; + programs.nixvim = { + enable = true; - # Use my global nixpkgs set, instead of constructing a separate one. - nixpkgs.useGlobalPackages = true; + # Use my global nixpkgs set, instead of constructing a separate one. + nixpkgs.useGlobalPackages = true; - # source: https://www.patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=Neovim - extraConfigLuaPre = lib.mkBefore '' - --------------------------------------------------------------------------- - -- - -- ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ - -- ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ - -- ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ - -- ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ - -- ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ - -- ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ - -- - --------------------------------------------------------------------------- - ''; + # source: https://www.patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=Neovim + extraConfigLuaPre = lib.mkBefore '' + --------------------------------------------------------------------------- + -- + -- ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ + -- ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ + -- ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ + -- ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ + -- ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ + -- ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ + -- + --------------------------------------------------------------------------- + ''; - extraPackages = [ - /* - These are mostly linters and formatters used for different file types. - Including them here is fine, as they are not necessarily-sync able to different people. - */ - # nix - pkgs.alejandra - pkgs.statix + extraPackages = [ + /* + These are mostly linters and formatters used for different file types. + Including them here is fine, as they are not necessarily-sync able to different people. + */ + # nix + pkgs.alejandra + pkgs.statix - # yaml - pkgs.yamllint + # yaml + pkgs.yamllint - # shell - pkgs.shellcheck - pkgs.shfmt - ]; - }; - }; - }; + # shell + pkgs.shellcheck + pkgs.shfmt + ]; + }; + }; + } + ]) + ); } diff --git a/modules/by-name/nv/nvim/options/default.nix b/modules/by-name/nv/nvim/options/default.nix index 301f0ac0..b83c10cf 100644 --- a/modules/by-name/nv/nvim/options/default.nix +++ b/modules/by-name/nv/nvim/options/default.nix @@ -10,11 +10,10 @@ { config, lib, - ... }: let cfg = config.soispha.programs.nvim; in { - home-manager.users.soispha.programs.nixvim.opts = lib.mkIf cfg.enable { + home-manager.users.soispha.programs.nixvim.opts = { autoindent = true; # copy indent from previous line cindent = true; # use c like indenting rules breakindent = true; # continue indent visually @@ -80,7 +79,7 @@ in { shell = lib.getExe cfg.shell; spell = true; # activate spell checking - spelllang = "en_us,de_de"; # set spell languages + spelllang = "en_us,de_de,sv"; # set spell languages spelloptions = "camel"; # CamelCase check if both camel and case are correct words syntax = "ON"; # use syntax highlighting and let nvim figure out which diff --git a/modules/by-name/nv/nvim/performance/default.nix b/modules/by-name/nv/nvim/performance/default.nix index a392a672..d3e1f9ca 100644 --- a/modules/by-name/nv/nvim/performance/default.nix +++ b/modules/by-name/nv/nvim/performance/default.nix @@ -1,11 +1,5 @@ -{ - config, - lib, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim = { performance = { combinePlugins = { enable = true; diff --git a/modules/by-name/nv/nvim/plgs/colorscheme/default.nix b/modules/by-name/nv/nvim/plgs/colorscheme/default.nix index f8cd5892..a8245ea9 100644 --- a/modules/by-name/nv/nvim/plgs/colorscheme/default.nix +++ b/modules/by-name/nv/nvim/plgs/colorscheme/default.nix @@ -9,13 +9,10 @@ # If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, - config, lib, ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +}: { + home-manager.users.soispha.programs.nixvim = { # TODO: package nightfox though a module extraConfigLuaPost = '' ${lib.strings.fileContents ./lua/nightfox.lua} diff --git a/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix b/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix index 68a88d32..c23cd84d 100644 --- a/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix +++ b/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim = { plugins.comment = { enable = true; settings = { diff --git a/modules/by-name/nv/nvim/plgs/femaco/default.nix b/modules/by-name/nv/nvim/plgs/femaco/default.nix index eac6b393..2667d7a8 100644 --- a/modules/by-name/nv/nvim/plgs/femaco/default.nix +++ b/modules/by-name/nv/nvim/plgs/femaco/default.nix @@ -7,13 +7,7 @@ # # 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>. -{ - lib, - config, - ... -}: let - cfg = config.soispha.programs.nvim; -in { +{lib, ...}: { # TODO: Re-active this plugin, when it does no longer depend on `treesitter-legacy` <2026-01-18> home-manager.users.soispha.programs.nixvim = lib.mkIf false { plugins.femaco = { diff --git a/modules/by-name/nv/nvim/plgs/goto-preview/default.nix b/modules/by-name/nv/nvim/plgs/goto-preview/default.nix index 93761dfd..a3adb465 100644 --- a/modules/by-name/nv/nvim/plgs/goto-preview/default.nix +++ b/modules/by-name/nv/nvim/plgs/goto-preview/default.nix @@ -10,12 +10,9 @@ { pkgs, lib, - config, ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +}: { + home-manager.users.soispha.programs.nixvim = { # TODO: package goto-preview though a module extraConfigLuaPost = '' ${lib.strings.fileContents ./lua/goto-preview.lua} diff --git a/modules/by-name/nv/nvim/plgs/harpoon/default.nix b/modules/by-name/nv/nvim/plgs/harpoon/default.nix index c85c7c80..a12ddfc2 100644 --- a/modules/by-name/nv/nvim/plgs/harpoon/default.nix +++ b/modules/by-name/nv/nvim/plgs/harpoon/default.nix @@ -7,14 +7,8 @@ # # 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>. -{ - lib, - config, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{lib, ...}: { + home-manager.users.soispha.programs.nixvim = { plugins.harpoon.enable = true; keymaps = diff --git a/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix b/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix index e652a60d..3ad264dc 100644 --- a/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix +++ b/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix @@ -7,15 +7,9 @@ # # 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>. -{ - lib, - config, - ... -}: let - cfg = config.soispha.programs.nvim; -in { +{...}: { # TODO: change the nvim path, when I change the path with lf - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + home-manager.users.soispha.programs.nixvim = { plugins.lf = { enable = true; diff --git a/modules/by-name/nv/nvim/plgs/lsp/default.nix b/modules/by-name/nv/nvim/plgs/lsp/default.nix index 27a6f909..895cf482 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/default.nix @@ -8,37 +8,41 @@ # 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, + extra_lib, + config, + pkgs, ... }: let - cfg = config.soispha.programs.nvim; -in { - imports = [ - ./keymaps - ./servers - ]; - home-manager.users.soispha.programs.nixvim.plugins.lsp = lib.mkIf cfg.enable { - enable = true; - onAttach = - "" - # + '' - # function(client, bufnr) - # -- Enable completion triggered by <c-x><c-o> - # -- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - # end - # '' - ; - preConfig = '' - vim.diagnostic.config({ - underline = true, - -- virtual_text = true, - virtual_text = { - source = "always", -- Or "if_many" - }, - update_in_insert = true, - severity_sort = true, - }, nil); - ''; - }; -} + keymaps = import ./keymaps {}; + servers = import ./servers {inherit extra_lib config lib pkgs;}; +in + lib.mkMerge [ + keymaps + servers + { + home-manager.users.soispha.programs.nixvim.plugins.lsp = { + enable = true; + onAttach = + "" + # + '' + # function(client, bufnr) + # -- Enable completion triggered by <c-x><c-o> + # -- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + # end + # '' + ; + preConfig = '' + vim.diagnostic.config({ + underline = true, + -- virtual_text = true, + virtual_text = { + source = "always", -- Or "if_many" + }, + update_in_insert = true, + severity_sort = true, + }, nil); + ''; + }; + } + ] diff --git a/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix b/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix index 7cc9f6d5..13f31ee7 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim = { plugins.lsp.keymaps = { diagnostic = { "N" = { diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix index 0e7be6e8..52e478a5 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix @@ -7,18 +7,18 @@ # # 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>. -{...}: { - imports = [ - ./servers/bashls.nix - ./servers/ccls.nix - ./servers/ltex.nix - ./servers/lua-ls.nix - ./servers/nil-ls.nix - ./servers/openscad.nix - ./servers/quick-lint-js.nix - ./servers/ruff-lsp.nix - ./servers/rust-analyzer.nix - ./servers/texlab.nix - ./servers/zls.nix - ]; -} +{ + extra_lib, + config, + lib, + pkgs, + ... +}: let + servers = builtins.attrValues (extra_lib.mkByName { + useShards = false; + baseDirectory = ./servers; + fileName = "default.nix"; + finalizeFunction = name: path: import path {inherit config lib pkgs;}; + }); +in + lib.mkMerge servers diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls/default.nix index 8d2b0d03..1ed049c4 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls/default.nix @@ -7,14 +7,8 @@ # # 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>. -{ - lib, - config, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim = { plugins.lsp.servers = { bashls.enable = true; }; diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix deleted file mode 100644 index eed7f349..00000000 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix +++ /dev/null @@ -1,22 +0,0 @@ -# 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { - plugins.lsp.servers = { - ccls.enable = true; - }; - }; -} diff --git a/modules/home.legacy/conf/keepassxc/default.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls/default.nix index 40f61ba0..59e79cd4 100644 --- a/modules/home.legacy/conf/keepassxc/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls/default.nix @@ -8,5 +8,9 @@ # 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>. {...}: { - xdg.configFile."keepassxc/keepassxc.ini".source = ./keepassxc.ini; + home-manager.users.soispha.programs.nixvim = { + plugins.lsp.servers = { + ccls.enable = true; + }; + }; } diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex-plus/default.nix index 5c0024f0..1b1906f8 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex-plus/default.nix @@ -7,21 +7,21 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{pkgs, ...}: { + home-manager.users.soispha.programs.nixvim = { plugins.lsp.servers = { - ltex = let + ltex_plus = let + # - ⚠️ WARNING Unknown filetype 'shell' (Hint: filename extension != filetype). + # - ⚠️ WARNING Unknown filetype 'bibtex' (Hint: filename extension != filetype). + # - ⚠️ WARNING Unknown filetype 'context.tex' (Hint: filename extension != filetype). + # - ⚠️ WARNING Unknown filetype 'latex' (Hint: filename extension != filetype). + # - ⚠️ WARNING Unknown filetype 'restructuredtext' (Hint: filename extension != filetype). + # - ⚠️ WARNING Unknown filetype 'rsweave' (Hint: filename extension != filetype). + # - ⚠️ WARNING Unknown filetype 'git-commit' (Hint: filename extension != filetype). filetypes = [ "java" "cpp" - "shell" + "sh" "bash" "bibtex" @@ -29,6 +29,7 @@ in { "context.tex" "latex" "tex" + "typst" "markdown" "org" diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls/default.nix index 9350cd37..ddd7609a 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim = { plugins.lsp.servers = { lua_ls = { enable = true; diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls/default.nix index 3b7e2523..6c4eef96 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim = { plugins.lsp.servers = { nil_ls = { enable = true; diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad/default.nix index 1d516c9d..4e4353bc 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad/default.nix @@ -7,15 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{pkgs, ...}: { + home-manager.users.soispha.programs.nixvim = { extraConfigLuaPost = /* lua diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js/default.nix index 097abfbe..edc0b10a 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js/default.nix @@ -7,15 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{pkgs, ...}: { + home-manager.users.soispha.programs.nixvim = { extraConfigLuaPost = /* lua diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp/default.nix index 3ad3ad8f..da30be2f 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp/default.nix @@ -7,15 +7,8 @@ # # 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>. -{ - pkgs, - config, - lib, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{pkgs, ...}: { + home-manager.users.soispha.programs.nixvim = { plugins.lsp.servers = { ruff = { enable = true; diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer/default.nix index fd344c50..cf58653b 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim = { plugins.lsp.servers = { rust_analyzer = { enable = true; diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab/default.nix index 5f001177..3181c77d 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim = { plugins.lsp.servers = { texlab = { enable = true; diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/zls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/zls/default.nix index aab7a135..cb2353b1 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/zls.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/zls/default.nix @@ -7,15 +7,8 @@ # # 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>. -{ - lib, - config, - pkgs, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{pkgs, ...}: { + home-manager.users.soispha.programs.nixvim = { extraConfigLuaPost = /* lua diff --git a/modules/by-name/nv/nvim/plgs/lspkind/default.nix b/modules/by-name/nv/nvim/plgs/lspkind/default.nix index 3846fa32..1b78d4ff 100644 --- a/modules/by-name/nv/nvim/plgs/lspkind/default.nix +++ b/modules/by-name/nv/nvim/plgs/lspkind/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim.plugins.lspkind = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim.plugins.lspkind = { enable = true; settings.preset = "default"; # "codicons" is only for a font patched with vscode-codeicons. }; diff --git a/modules/by-name/nv/nvim/plgs/ltex_extra/0001-ltex_extra-commands-lsp.lua-Also-support-ltex-plus-a.patch b/modules/by-name/nv/nvim/plgs/ltex_extra/0001-ltex_extra-commands-lsp.lua-Also-support-ltex-plus-a.patch new file mode 100644 index 00000000..d739ff0f --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/ltex_extra/0001-ltex_extra-commands-lsp.lua-Also-support-ltex-plus-a.patch @@ -0,0 +1,31 @@ +From ecd59b8bbc6060ec000516b60dbc1de480d6059d Mon Sep 17 00:00:00 2001 +From: Soispha Peetz <soispha@b-peetz.de> +Date: Sun, 29 Nov 2026 01:59:04 +0100 +Subject: [PATCH] ltex_extra/commands-lsp.lua: Also support `ltex-plus` as name + for `ltex_plus` + +--- + lua/ltex_extra/commands-lsp.lua | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/lua/ltex_extra/commands-lsp.lua b/lua/ltex_extra/commands-lsp.lua +index 797f43a..a032a0e 100644 +--- a/lua/ltex_extra/commands-lsp.lua ++++ b/lua/ltex_extra/commands-lsp.lua +@@ -63,6 +63,13 @@ function M.catch_ltex() + }) + end + ++ if vim.tbl_isempty(buf_clients) then ++ buf_clients = client_getter({ ++ bufnr = vim.api.nvim_get_current_buf(), ++ name = "ltex-plus", ++ }) ++ end ++ + return buf_clients[1] + end + +-- +2.56.1 + diff --git a/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix b/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix index a01d5653..965f6652 100644 --- a/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix +++ b/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix @@ -7,19 +7,18 @@ # # 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>. -{ - pkgs, - config, - lib, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{pkgs, ...}: { + home-manager.users.soispha.programs.nixvim = { # TODO: package ltex_extra though a module extraPlugins = [ - pkgs.vimPlugins.ltex_extra-nvim + (pkgs.vimPlugins.ltex_extra-nvim.overrideAttrs (final: prev: { + patches = + (prev.patches or []) + ++ [ + ./0001-ltex_extra-commands-lsp.lua-Also-support-ltex-plus-a.patch + ]; + })) ]; - plugins.lsp.servers.ltex.onAttach.function = builtins.readFile ./lua/ltex_extra.lua; + plugins.lsp.servers.ltex_plus.onAttach.function = builtins.readFile ./lua/ltex_extra.lua; }; } diff --git a/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua b/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua index 883b22c4..eb7c3291 100644 --- a/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua +++ b/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua @@ -11,7 +11,7 @@ require("ltex_extra").setup({ -- table <string> : languages for witch dictionaries will be loaded, e.g. { "es-AR", "en-US" } -- https://valentjn.github.io/ltex/supported-languages.html#natural-languages - load_langs = { "en-CA", "de-DE", "sv-SE" }, -- en-US as default + load_langs = { "en-CA", "de-DE", "sv-SE" }, -- boolean : whether to load dictionaries on startup init_check = true, -- string : relative or absolute path to store dictionaries diff --git a/modules/by-name/nv/nvim/plgs/lualine/default.nix b/modules/by-name/nv/nvim/plgs/lualine/default.nix index 7a69519b..c42181de 100644 --- a/modules/by-name/nv/nvim/plgs/lualine/default.nix +++ b/modules/by-name/nv/nvim/plgs/lualine/default.nix @@ -7,131 +7,124 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim.plugins.lualine = let - get_location_of_file = { - __raw = '' - function() - local file_lines = vim.fn.line('$'); - local file_current_cursor_positon = vim.fn.getcurpos(); - return file_current_cursor_positon[3] .. ":" .. file_current_cursor_positon[2] .. "/" .. file_lines - end - ''; - }; +{...}: let + get_location_of_file = { + __raw = '' + function() + local file_lines = vim.fn.line('$'); + local file_current_cursor_positon = vim.fn.getcurpos(); + return file_current_cursor_positon[3] .. ":" .. file_current_cursor_positon[2] .. "/" .. file_lines + end + ''; + }; - get_trailing_whitespace = { - __raw = '' + get_trailing_whitespace = { + __raw = '' + function() + local space = vim.fn.search([[\s\+$]], 'nwc') + return space ~= 0 and "TW:" .. space or "" + end + ''; + }; + get_mixed_indent = { + __raw = + /* + lua + */ + '' function() - local space = vim.fn.search([[\s\+$]], 'nwc') - return space ~= 0 and "TW:" .. space or "" + local space_pat = [[\v^ +]] + local tab_pat = [[\v^\t+]] + local space_indent = vim.fn.search(space_pat, 'nwc') + local tab_indent = vim.fn.search(tab_pat, 'nwc') + local mixed = (space_indent > 0 and tab_indent > 0) + local mixed_same_line + if not mixed then + mixed_same_line = vim.fn.search([[\v^(\t+ | +\t)]], 'nwc') + mixed = mixed_same_line > 0 + end + if not mixed then return "" end + if mixed_same_line ~= nil and mixed_same_line > 0 then + return 'MI:' .. mixed_same_line + end + local space_indent_cnt = vim.fn.searchcount({ pattern = space_pat, max_count = 1e3 }).total + local tab_indent_cnt = vim.fn.searchcount({ pattern = tab_pat, max_count = 1e3 }).total + if space_indent_cnt > tab_indent_cnt then + return 'MI:' .. tab_indent + else + return 'MI:' .. space_indent + end end ''; - }; - get_mixed_indent = { - __raw = - /* - lua - */ - '' - function() - local space_pat = [[\v^ +]] - local tab_pat = [[\v^\t+]] - local space_indent = vim.fn.search(space_pat, 'nwc') - local tab_indent = vim.fn.search(tab_pat, 'nwc') - local mixed = (space_indent > 0 and tab_indent > 0) - local mixed_same_line - if not mixed then - mixed_same_line = vim.fn.search([[\v^(\t+ | +\t)]], 'nwc') - mixed = mixed_same_line > 0 - end - if not mixed then return "" end - if mixed_same_line ~= nil and mixed_same_line > 0 then - return 'MI:' .. mixed_same_line - end - local space_indent_cnt = vim.fn.searchcount({ pattern = space_pat, max_count = 1e3 }).total - local tab_indent_cnt = vim.fn.searchcount({ pattern = tab_pat, max_count = 1e3 }).total - if space_indent_cnt > tab_indent_cnt then - return 'MI:' .. tab_indent - else - return 'MI:' .. space_indent - end - end - ''; - }; - in - lib.mkIf cfg.enable { - enable = true; + }; +in { + home-manager.users.soispha.programs.nixvim.plugins.lualine = { + enable = true; - settings = { - options = { - iconsEnabled = true; - theme = "nightfox"; - }; + settings = { + options = { + iconsEnabled = true; + theme = "nightfox"; + }; - # TODO: add all installed and supported extensions here - extensions = [ - "toggleterm" - #"fugitive" # TODO: maybe add this? - ]; + # TODO: add all installed and supported extensions here + extensions = [ + "toggleterm" + #"fugitive" # TODO: maybe add this? + ]; - componentSeparators = { - left = ""; - right = ""; - }; - sectionSeparators = { - left = ""; - right = ""; - }; - disabledFiletypes = { - statusline = []; - winbar = []; - }; - ignoreFocus = []; - alwaysDivideMiddle = true; - globalstatus = false; - refresh = { - statusline = 1000; - tabline = 1000; - winbar = 1000; - }; - sections = { - lualine_a = ["mode"]; - lualine_b = [ - { - __raw = '' - {'FugitiveHead', icon = ""} - ''; - } - "diff" - "diagnostics" - ]; - lualine_c = ["filename"]; - lualine_x = ["searchcount" "filetype"]; - lualine_y = [ - "encoding" - "fileformat" - get_mixed_indent - get_trailing_whitespace - ]; - lualine_z = [get_location_of_file]; - }; - inactiveSections = { - lualine_a = []; - lualine_b = []; - lualine_c = ["filename"]; - lualine_x = [get_location_of_file]; - lualine_y = []; - lualine_z = []; - }; - tabline = {}; - winbar = {}; - inactiveWinbar = {}; + componentSeparators = { + left = ""; + right = ""; + }; + sectionSeparators = { + left = ""; + right = ""; + }; + disabledFiletypes = { + statusline = []; + winbar = []; + }; + ignoreFocus = []; + alwaysDivideMiddle = true; + globalstatus = false; + refresh = { + statusline = 1000; + tabline = 1000; + winbar = 1000; + }; + sections = { + lualine_a = ["mode"]; + lualine_b = [ + { + __raw = '' + {'FugitiveHead', icon = ""} + ''; + } + "diff" + "diagnostics" + ]; + lualine_c = ["filename"]; + lualine_x = ["searchcount" "filetype"]; + lualine_y = [ + "encoding" + "fileformat" + get_mixed_indent + get_trailing_whitespace + ]; + lualine_z = [get_location_of_file]; + }; + inactiveSections = { + lualine_a = []; + lualine_b = []; + lualine_c = ["filename"]; + lualine_x = [get_location_of_file]; + lualine_y = []; + lualine_z = []; }; + tabline = {}; + winbar = {}; + inactiveWinbar = {}; }; + }; } diff --git a/modules/by-name/nv/nvim/plgs/luasnip/default.nix b/modules/by-name/nv/nvim/plgs/luasnip/default.nix index 222b5070..b40743d6 100644 --- a/modules/by-name/nv/nvim/plgs/luasnip/default.nix +++ b/modules/by-name/nv/nvim/plgs/luasnip/default.nix @@ -7,15 +7,8 @@ # # 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>. -{ - lib, - config, - pkgs, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{pkgs, ...}: { + home-manager.users.soispha.programs.nixvim = { keymaps = [ { key = "<C-K>"; diff --git a/modules/by-name/nv/nvim/plgs/neorg/default.nix b/modules/by-name/nv/nvim/plgs/neorg/default.nix index b69f5a58..ac5e5a6a 100644 --- a/modules/by-name/nv/nvim/plgs/neorg/default.nix +++ b/modules/by-name/nv/nvim/plgs/neorg/default.nix @@ -7,13 +7,7 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { +{lib, ...}: { # TODO: Re-active, whence neorg actually builds with all the treesitter grammars # activated <2026-01-18> home-manager.users.soispha.programs.nixvim = lib.mkIf false { diff --git a/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix b/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix index 48883bd3..9d6a4f6b 100644 --- a/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix +++ b/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix @@ -7,20 +7,14 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { +{...}: { soispha.nixpkgs.unfreePackageNames = [ # the plugin is lacking an license and is thus unfree, effectively # its okay though (TODO: investigate <2026-05-11>)? "cmp-calc" ]; - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + home-manager.users.soispha.programs.nixvim = { opts.completeopt = [ "menu" # Show completions in a menu "menuone" # Also open menu, when only one completion exists diff --git a/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix b/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix index 90e81832..9536f1a2 100644 --- a/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix +++ b/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix @@ -9,13 +9,10 @@ # If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, - config, lib, ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +}: { + home-manager.users.soispha.programs.nixvim = { # TODO: package nvim-lint though a module extraConfigLuaPost = '' ${lib.strings.fileContents ./lua/nvim-lint.lua} diff --git a/modules/by-name/nv/nvim/plgs/telescope/default.nix b/modules/by-name/nv/nvim/plgs/telescope/default.nix index b2c66edc..b33dbe14 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/default.nix @@ -8,25 +8,29 @@ # 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, + extra_lib, + pkgs, ... }: let - cfg = config.soispha.programs.nvim; -in { - imports = [ - ./defaults - ./keymaps - ./extensions - ]; - home-manager.users.soispha.programs.nixvim.plugins = lib.mkIf cfg.enable { - telescope = { - enable = true; - }; + defaults = import ./defaults {}; + keymaps = import ./keymaps {}; + extensions = import ./extensions {inherit extra_lib pkgs lib;}; +in + lib.mkMerge [ + defaults + keymaps + extensions + { + home-manager.users.soispha.programs.nixvim.plugins = { + telescope = { + enable = true; + }; - # This is a dependency of telescope - web-devicons = { - enable = true; - }; - }; -} + # This is a dependency of telescope + web-devicons = { + enable = true; + }; + }; + } + ] diff --git a/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix b/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix index 7cfe9698..8fb4a99d 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim.plugins.telescope.settings.defaults = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim.plugins.telescope.settings.defaults = { mappings = let insert_and_normal_mappings = { # map actions.which_key to <c-h> (default: <c-/>) diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix index 0b0ed0f6..3fc3aefc 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix @@ -7,12 +7,17 @@ # # 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>. -{...}: { - imports = [ - ./bibtex - ./frecency - ./fzy-native - ./rooter - ./symbols - ]; -} +{ + extra_lib, + lib, + pkgs, + ... +}: let + extensions = builtins.attrValues (extra_lib.mkByName { + useShards = false; + baseDirectory = ./ext; + fileName = "default.nix"; + finalizeFunction = name: path: import path {inherit pkgs lib;}; + }); +in + lib.mkMerge extensions diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/bibtex/default.nix index 693db974..c2fea575 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/bibtex/default.nix @@ -7,9 +7,7 @@ # # 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, ...}: let - cfg = config.soispha.programs.nvim; -in { +{...}: { # TODO: Re-enable this, once the plugin is merged into nixpkgs <2025-03-29> # home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { # extraPlugins = [ diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/tex.lua b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/bibtex/tex.lua index fbe7c993..fbe7c993 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/tex.lua +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/bibtex/tex.lua diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/frecency/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/frecency/default.nix index 3d5eae99..83a4ed3d 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/frecency/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/frecency/default.nix @@ -7,14 +7,8 @@ # # 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>. -{ - lib, - config, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim = { keymaps = [ { key = "gff"; diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/fzy-native/default.nix index 7a2fc164..1b173516 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/fzy-native/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim.plugins.telescope.extensions.fzy-native = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim.plugins.telescope.extensions.fzy-native = { enable = true; }; } diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/rooter/default.nix index 4d91e988..de1aa929 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/rooter/default.nix @@ -7,14 +7,8 @@ # # 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>. -{ - lib, - config, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +{lib, ...}: { + home-manager.users.soispha.programs.nixvim = { extraConfigLuaPost = '' ${lib.strings.fileContents ./lua/rooter.lua} ''; diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/rooter/lua/rooter.lua index b6542429..b6542429 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/rooter/lua/rooter.lua diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/symbols/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/symbols/default.nix index 1f82523d..acf71022 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/symbols/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/ext/symbols/default.nix @@ -7,19 +7,25 @@ # # 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>. -{ - pkgs, - config, - lib, - ... -}: let - cfg = config.soispha.programs.nvim; +{pkgs, ...}: let + tsn = pkgs.vimPlugins.telescope-symbols-nvim; in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + home-manager.users.soispha.programs.nixvim = { extraPlugins = [ - # Source of symbols for telescope symbols - pkgs.vimPlugins.telescope-symbols-nvim + tsn ]; + + # Source of symbols for telescope symbols + extraFiles = { + "data/telescope-sources/emoji.json".source = "${tsn}/data/telescope-sources/emoji.json"; + "data/telescope-sources/gitmoji.json".source = "${tsn}/data/telescope-sources/gitmoji.json"; + "data/telescope-sources/julia.json".source = "${tsn}/data/telescope-sources/julia.json"; + "data/telescope-sources/kaomoji.json".source = "${tsn}/data/telescope-sources/kaomoji.json"; + "data/telescope-sources/latex.json".source = "${tsn}/data/telescope-sources/latex.json"; + "data/telescope-sources/math.json".source = "${tsn}/data/telescope-sources/math.json"; + "data/telescope-sources/nerd.json".source = "${tsn}/data/telescope-sources/nerd.json"; + }; + keymaps = [ { key = "<space>il"; @@ -46,6 +52,18 @@ in { options.desc = "[i]nsert a [e]moji"; } { + key = "<space>ik"; + mode = "n"; + action.__raw = '' + function() + require('telescope.builtin').symbols{ sources = { + 'kaomoji', + }} + end + ''; + options.desc = "[i]nsert a [k]aomoji"; + } + { key = "<space>is"; mode = "n"; action.__raw = '' @@ -61,7 +79,7 @@ in { }} end ''; - options.desc = "[i]nsert a [s]ymbol (like emojis)"; + options.desc = "[i]nsert a [s]ymbol (so aynthing that is supported)"; } ]; }; diff --git a/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix b/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix index d5cc55f5..12c56887 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim.plugins.telescope.keymaps = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim.plugins.telescope.keymaps = { "<space>rg" = { action = "live_grep"; options = { diff --git a/modules/by-name/nv/nvim/plgs/todo-comments/default.nix b/modules/by-name/nv/nvim/plgs/todo-comments/default.nix index cd1a7dbf..a535469c 100644 --- a/modules/by-name/nv/nvim/plgs/todo-comments/default.nix +++ b/modules/by-name/nv/nvim/plgs/todo-comments/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim.plugins.todo-comments = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim.plugins.todo-comments = { enable = true; settings = { guiStyle = { diff --git a/modules/by-name/nv/nvim/plgs/treesitter/default.nix b/modules/by-name/nv/nvim/plgs/treesitter/default.nix index 1377cb8a..acce3e6e 100644 --- a/modules/by-name/nv/nvim/plgs/treesitter/default.nix +++ b/modules/by-name/nv/nvim/plgs/treesitter/default.nix @@ -8,14 +8,11 @@ # 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, pkgs, lib, ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { +}: { + home-manager.users.soispha.programs.nixvim = { # NOTE: These are required to build grammars, but I already use the nix grammars <2024-07-13> dependencies = { tree-sitter.enable = false; diff --git a/modules/by-name/nv/nvim/plgs/vim-tex/default.nix b/modules/by-name/nv/nvim/plgs/vim-tex/default.nix index 71422f94..7538540c 100644 --- a/modules/by-name/nv/nvim/plgs/vim-tex/default.nix +++ b/modules/by-name/nv/nvim/plgs/vim-tex/default.nix @@ -7,13 +7,7 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { +{lib, ...}: { # TODO: Do I still need this module at all? <2026-01-18> home-manager.users.soispha.programs.nixvim = lib.mkIf false { opts.conceallevel = 0; diff --git a/modules/by-name/nv/nvim/plgs/which-key/default.nix b/modules/by-name/nv/nvim/plgs/which-key/default.nix index e5bca546..b247b533 100644 --- a/modules/by-name/nv/nvim/plgs/which-key/default.nix +++ b/modules/by-name/nv/nvim/plgs/which-key/default.nix @@ -7,14 +7,8 @@ # # 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, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim.plugins.which-key = lib.mkIf cfg.enable { +{...}: { + home-manager.users.soispha.programs.nixvim.plugins.which-key = { enable = true; }; } diff --git a/modules/by-name/po/postgresql/module.nix b/modules/by-name/po/postgresql/module.nix index ccc08b37..b3b336a1 100644 --- a/modules/by-name/po/postgresql/module.nix +++ b/modules/by-name/po/postgresql/module.nix @@ -26,7 +26,7 @@ in { --clean \ --if-exists \ --quote-all-identifiers | - ${lib.getExe pkgs.xz} \ + ${lib.getExe' pkgs.xz "xz"} \ --compress \ -9 \ --extreme \ diff --git a/modules/by-name/py/python/module.nix b/modules/by-name/py/python/module.nix new file mode 100644 index 00000000..2519b9fa --- /dev/null +++ b/modules/by-name/py/python/module.nix @@ -0,0 +1,29 @@ +# 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, + ... +}: let + cfg = config.soispha.programs.python; +in { + options.soispha.programs.python = { + enable = lib.mkEnableOption "python"; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + xdg.configFile."python/pythonrc".source = ./pythonrc.py; + home.sessionVariables = { + "PYTHONSTARTUP" = "${config.home-manager.users.soispha.xdg.configHome}/python/pythonrc"; + }; + }; + }; +} diff --git a/modules/home.legacy/conf/python/pythonrc.py b/modules/by-name/py/python/pythonrc.py index b733dc48..cdcf3a4e 100644..100755 --- a/modules/home.legacy/conf/python/pythonrc.py +++ b/modules/by-name/py/python/pythonrc.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # nixos-config - My current NixOS configuration # @@ -18,8 +18,8 @@ def is_vanilla() -> bool: def setup_history(): - import os import atexit + import os import readline from pathlib import Path @@ -31,7 +31,8 @@ def setup_history(): history: Path = state_home / "python" / "history" if not os.path.exists(history): - open(history, "w") + with open(history, "w"): + pass readline.read_history_file(str(history)) atexit.register(readline.write_history_file, str(history)) diff --git a/modules/by-name/qu/qutebrowser/include/redirects.py b/modules/by-name/qu/qutebrowser/include/redirects.py index 2588b9e0..39fbe11d 100644 --- a/modules/by-name/qu/qutebrowser/include/redirects.py +++ b/modules/by-name/qu/qutebrowser/include/redirects.py @@ -2,12 +2,10 @@ # - https://github.com/Phantop/dotfiles/blob/9f6256820dbb99cdf5afd373b74d93fe8b8972d7/qutebrowser/include/redirects.py # - https://gitlab.com/jgkamat/dotfiles/-/blob/0e5f05d347079a9839cb2c7878fd81d9850928ce/qutebrowser/.config/qutebrowser/pyconfig/redirectors.py -from qutebrowser.api import interceptor, message - -import operator import typing from PyQt6.QtCore import QUrl +from qutebrowser.api import interceptor, message def get_host(url: QUrl, base: bool = False) -> str: @@ -33,7 +31,7 @@ def farside_redir(target: str, url: QUrl) -> bool: # Any return value other than a literal 'False' means we redirect -REDIRECT_MAP: typing.Dict[str, typing.Callable[..., typing.Optional[bool]]] = { +REDIRECT_MAP: dict[str, typing.Callable[..., bool | None]] = { "reddit.com": partial(farside_redir, "redlib"), # Source: https://libredirect.github.io/ "medium.com": partial(farside_redir, "scribe"), diff --git a/modules/by-name/qu/qutebrowser/settings/default.nix b/modules/by-name/qu/qutebrowser/settings/default.nix index b0259c22..022f97bd 100644 --- a/modules/by-name/qu/qutebrowser/settings/default.nix +++ b/modules/by-name/qu/qutebrowser/settings/default.nix @@ -284,10 +284,10 @@ in { editor = { command = [ - "${lib.getExe pkgs.alacritty}" + "${lib.getExe' pkgs.foot "footclient"}" "--title" "floating please" - "--command" + "--" "nvim" "-c" "normal {line}G{column0}|" diff --git a/modules/by-name/ri/river/keymap.nix b/modules/by-name/ri/river/keymap.nix index af16da26..a141d06d 100644 --- a/modules/by-name/ri/river/keymap.nix +++ b/modules/by-name/ri/river/keymap.nix @@ -46,8 +46,8 @@ in { "r" = { "a" = mkSpawn' pkgs.foot "footclient" "" {}; "b" = mkSpawn pkgs.tskm "open select" {once = true;}; - "k" = mkSpawn pkgs.keepassxc "" {once = true;}; - # "s" = mkSpawn pkgs.signal-desktop "" {once = true;}; + "k" = mkSpawn pkgs.chipass "" {once = true;}; + "s" = mkSpawn pkgs.signal-desktop "" {once = true;}; "p" = mkSpawn pkgs.screenshot_persistent "" {once = true;}; "i" = mkSpawn pkgs.anki "" {once = true;}; }; @@ -70,6 +70,7 @@ in { "q" = ["exit"]; "l" = mkSpawn pkgs.lock "" {once = true;}; "h" = mkSpawn pkgs.systemd-toggle "--user i3bar-river.service" {once = true;}; + "i" = mkSpawn pkgs.systemd-toggle "--user swayidle.service" {once = true;}; }; # Media control @@ -133,7 +134,9 @@ in { "N" = ["focus-output" "previous"]; "0" = ["set-focused-tags" (builtins.toString ((extra_lib.math.pow 2 32) - 1))]; - "p" = ["focus-previous-tags"]; + "p" = { + command = ["focus-previous-tags"]; + }; "1" = mkTagCommand "set-focused-tags" 1; "2" = mkTagCommand "set-focused-tags" 2; @@ -148,7 +151,10 @@ in { }; # Screen locking - "<Super-l>" = self."<LEFT_SUPER>".x.l; + "<Super-n>" = self."<LEFT_SUPER>".x.l; + + # There is a special key on my keyboard (f11+fn), that sends Super-l + "<Super-l>" = self."<LEFT_SUPER>".f.p // {once = true;}; # Audio "<MEDIA_RAISEVOLUME>" = diff --git a/modules/by-name/ri/river/module.nix b/modules/by-name/ri/river/module.nix index a381e897..bd3e4a03 100644 --- a/modules/by-name/ri/river/module.nix +++ b/modules/by-name/ri/river/module.nix @@ -229,6 +229,10 @@ in { home.packages = [ river-start + + # For riverctl + pkgs.river-classic + pkgs.sw ]; diff --git a/modules/by-name/ta/taskwarrior/module.nix b/modules/by-name/ta/taskwarrior/module.nix index d40456e2..bf030d50 100644 --- a/modules/by-name/ta/taskwarrior/module.nix +++ b/modules/by-name/ta/taskwarrior/module.nix @@ -143,7 +143,7 @@ in { tags = true; }; - news.version = "3.5.0"; + news.version = "3.6.0"; regex = true; weekstart = "Monday"; diff --git a/modules/by-name/ti/timewarrior/module.nix b/modules/by-name/ti/timewarrior/module.nix deleted file mode 100644 index 90a541d8..00000000 --- a/modules/by-name/ti/timewarrior/module.nix +++ /dev/null @@ -1,97 +0,0 @@ -# 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, - ... -}: let - cfg = config.soispha.programs.timewarrior; - - track_timewarrior = pkgs.stdenv.mkDerivation { - name = "track-timewarrior"; - nativeBuildInputs = [ - pkgs.makeWrapper - ]; - buildInputs = [ - pkgs.timewarrior - pkgs.taskwarrior3 - pkgs.python3 - ]; - dontUnpack = true; - installPhase = '' - install -Dm755 ${./taskwarrior_hooks/on-modify.track-timewarrior.py} $out/bin/track-timewarrior - wrapProgram $out/bin/track-timewarrior \ - --set PATH ${lib.makeBinPath [pkgs.taskwarrior3 pkgs.timewarrior]} - ''; - - meta.mainProgram = "track-timewarrior"; - }; - track_total_active_time = pkgs.stdenv.mkDerivation { - name = "track-total-active-time"; - nativeBuildInputs = [ - pkgs.makeWrapper - ]; - buildInputs = [ - pkgs.taskwarrior3 - pkgs.python3 - ]; - dontUnpack = true; - installPhase = '' - install -Dm755 ${./taskwarrior_hooks/on-modify.track-total-active-time.py} $out/bin/track-total-active-time - wrapProgram $out/bin/track-total-active-time \ - --set PATH ${lib.makeBinPath [pkgs.taskwarrior3]} - ''; - - meta.mainProgram = "track-total-active-time"; - }; -in { - options.soispha.programs.timewarrior = { - enable = lib.mkEnableOption "timewarrior"; - }; - config = lib.mkIf cfg.enable { - soispha.programs.taskwarrior = { - hooks = { - track-timewarrior = { - mode = "on-modify"; - executable = track_timewarrior; - }; - track-total-active-time = { - mode = "on-modify"; - executable = track_total_active_time; - }; - }; - }; - - home-manager.users.soispha = { - home.packages = [ - pkgs.timewarrior - ]; - - xdg.configFile."timewarrior/timewarrior.cfg".text = '' - # source: https://github.com/arcticicestudio/igloo - #+----+ - #+ UI + - #+----+ - import ${./nord.theme} - color = true - - #+---------+ - #+ Reports + - #+---------+ - define reports: - day: - lines = 10 - month = true - week = true - ''; - }; - }; -} diff --git a/modules/by-name/ti/timewarrior/nord.theme b/modules/by-name/ti/timewarrior/nord.theme deleted file mode 100644 index da3c387a..00000000 --- a/modules/by-name/ti/timewarrior/nord.theme +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2016-present Arctic Ice Studio <development@arcticicestudio.com> -# Copyright (C) 2016-present Sven Greb <development@svengreb.de> - -# Project: igloo -# Repository: https://github.com/arcticicestudio/igloo -# License: MIT -# References: -# https://taskwarrior.org/docs/timewarrior/themes.html -# timew(1) - -define theme: - description = "An arctic, north-bluish clean and elegant Timewarrior theme." - colors: - exclusion = "bold black" - today = "cyan" - holiday = "bold blue on white" - label = "bold white on black" - ids = "bold black on cyan" - debug = "magenta" - - # Rotating color palette for tags. - palette: - color01 = "bold black on cyan" - color02 = "bold black on bright cyan" - color03 = "bold black on blue" diff --git a/modules/by-name/ti/timewarrior/nord.theme.license b/modules/by-name/ti/timewarrior/nord.theme.license deleted file mode 100644 index eae6a84c..00000000 --- a/modules/by-name/ti/timewarrior/nord.theme.license +++ /dev/null @@ -1,9 +0,0 @@ -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>. diff --git a/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-timewarrior.py b/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-timewarrior.py deleted file mode 100755 index 3b42b3f2..00000000 --- a/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-timewarrior.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python3 - -# nixos-config - My current NixOS configuration -# -# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> -# Copyright 2016 - 2021, 2023, Gothenburg Bit Factory -# 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>. - -import json -import subprocess -import sys - -# Hook should extract all the following for use as Timewarrior tags: -# UUID -# Project -# Tags -# Description -# UDAs - -try: - input_stream = sys.stdin.buffer -except AttributeError: - input_stream = sys.stdin - - -MAX_ACTIVE = 1 - - -def extract_tags_from(json_obj) -> [str]: - # Extract attributes for use as tags. - tags = [json_obj["description"]] - - if "project" in json_obj: - tags.append(json_obj["project"]) - - if "tags" in json_obj: - if type(json_obj["tags"]) is str: - # Usage of tasklib (e.g. in taskpirate) converts the tag list into a string - # If this is the case, convert it back into a list first - # See https://github.com/tbabej/taskpirate/issues/11 - tags.extend(json_obj["tags"].split(",")) - else: - tags.extend(json_obj["tags"]) - - return tags - - -def extract_annotation_from(json_obj): - if "annotations" not in json_obj: - return "''" - - return json_obj["annotations"][0]["description"] - - -def main(old, new): - start_or_stop = "" - - # Started task. - if "start" in new and "start" not in old: - # Prevent this task from starting if "task +ACTIVE count" is greater than "MAX_ACTIVE". - p = subprocess.Popen( - ["task", "+ACTIVE", "status:pending", "count", "rc.verbose:off"], - stdout=subprocess.PIPE, - ) - out, err = p.communicate() - count = int(out.rstrip()) - if count >= MAX_ACTIVE: - print( - f"Only {MAX_ACTIVE} task(s) can be active at a time.", - ) - sys.exit(1) - else: - start_or_stop = "start" - - # Stopped task. - elif ("start" not in new or "end" in new) and "start" in old: - start_or_stop = "stop" - - if start_or_stop: - tags = extract_tags_from(new) - - subprocess.call(["timew", start_or_stop] + tags + [":yes"]) - - # Modifications to task other than start/stop - elif "start" in new and "start" in old: - old_tags = extract_tags_from(old) - new_tags = extract_tags_from(new) - - if old_tags != new_tags: - subprocess.call(["timew", "untag", "@1"] + old_tags + [":yes"]) - subprocess.call(["timew", "tag", "@1"] + new_tags + [":yes"]) - - old_annotation = extract_annotation_from(old) - new_annotation = extract_annotation_from(new) - - if old_annotation != new_annotation: - subprocess.call(["timew", "annotate", "@1", new_annotation]) - - -if __name__ == "__main__": - old = json.loads(input_stream.readline().decode("utf-8", errors="replace")) - new = json.loads(input_stream.readline().decode("utf-8", errors="replace")) - print(json.dumps(new)) - main(old, new) diff --git a/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-total-active-time.py b/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-total-active-time.py deleted file mode 100755 index 303a5c57..00000000 --- a/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-total-active-time.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# nixos-config - My current NixOS configuration -# -# Copyright (C) 2016-present Arctic Ice Studio <development@arcticicestudio.com> -# Copyright (C) 2016-present Sven Greb <development@svengreb.de> -# 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>. - -# Project: igloo -# Repository: https://github.com/arcticicestudio/igloo -# License: MIT -# References: -# https://taskwarrior.org/docs -# task(1) - -"""A Taskwarrior hook to track the total active time of a task. - -The tracked time is stored in a UDA task duration attribute named ``totalactivetime`` of type ``duration`` holding the total number of seconds the task was -active. The tracked time can then be included in any report by adding the ``totalactivetime`` column. - -By default, this plugin allows to have one task active at a time. This can be changed by setting ``max_active_tasks`` in ``.taskrc`` to a value greater than -``1``. - -Note: - Note that this hook is only compatible with Taskwarrior version greater or equal to 2.4! - -This hook is a fork from `kostajh/taskwarrior-time-tracking-hook`_ - -.. _kostajh/taskwarrior-time-tracking-hook: - https://github.com/kostajh/taskwarrior-time-tracking-hook -""" - -import datetime -import json -import sys -import subprocess -from typing import TypeVar - -TIME_FORMAT = "%Y%m%dT%H%M%SZ" -UDA_KEY = "total_active_time" - -MAX_ACTIVE = 1 - -"""The duration type either as integer (in seconds), as ISO-8601 formatted string ("PT1H10M31S") or the seconds suffixed with "seconds".""" -DurationType = TypeVar("DurationType", str, int) - - -def duration_str_to_time_delta(duration_str: DurationType) -> datetime.timedelta: - """Converts duration string into a timedelta object. - - :param duration_str: The duration - :return: The duration as timedelta object - """ - if duration_str.startswith("P"): - value = datetime.fromisoformat(duration_str) - elif duration_str.endswith("seconds"): - value = int(duration_str.rstrip("seconds")) - else: - value = int(duration_str) - return datetime.timedelta(seconds=value) - - -def main(): - original = json.loads(sys.stdin.readline()) - modified = json.loads(sys.stdin.readline()) - - # An active task has just been started. - if "start" in modified and "start" not in original: - # Prevent this task from starting if "task +ACTIVE count" is greater than "MAX_ACTIVE". - p = subprocess.Popen( - ["task", "+ACTIVE", "status:pending", "count", "rc.verbose:off"], - stdout=subprocess.PIPE, - ) - out, err = p.communicate() - count = int(out.rstrip()) - if count >= MAX_ACTIVE: - print( - "Only %d task(s) can be active at a time. " - "See 'max_active_tasks' in .taskrc." % MAX_ACTIVE - ) - sys.exit(1) - - # An active task has just been stopped. - if "start" in original and "start" not in modified: - # Calculate the elapsed time. - start = datetime.datetime.strptime(original["start"], TIME_FORMAT) - end = datetime.datetime.utcnow() - - if UDA_KEY not in modified: - modified[UDA_KEY] = 0 - - this_duration = end - start - total_duration = this_duration + duration_str_to_time_delta( - str(modified[UDA_KEY]) - ) - print( - "Total Time Tracked: %s (%s in this instance)" - % (total_duration, this_duration) - ) - modified[UDA_KEY] = ( - str(int(total_duration.days * (60 * 60 * 24) + total_duration.seconds)) - + "seconds" - ) - - return json.dumps(modified, separators=(",", ":")) - - -def cmdline(): - sys.stdout.write(main()) - - -if __name__ == "__main__": - cmdline() diff --git a/modules/by-name/xd/xdg/module.nix b/modules/by-name/xd/xdg/module.nix index 92bb3059..7cd31680 100644 --- a/modules/by-name/xd/xdg/module.nix +++ b/modules/by-name/xd/xdg/module.nix @@ -16,7 +16,7 @@ lf-wrapper = pkgs.writeShellApplication { name = "lf-wrapper"; - runtimeInputs = [pkgs.lf pkgs.alacritty]; + runtimeInputs = [pkgs.lf pkgs.foot]; inheritPath = true; text = builtins.readFile ./scripts/lf-wrapper.sh; diff --git a/modules/by-name/xd/xdg/scripts/lf-wrapper.sh b/modules/by-name/xd/xdg/scripts/lf-wrapper.sh index 6a5c5295..d0216fb5 100755 --- a/modules/by-name/xd/xdg/scripts/lf-wrapper.sh +++ b/modules/by-name/xd/xdg/scripts/lf-wrapper.sh @@ -42,7 +42,7 @@ else set -- -selection-path="$out" -command='set promptfmt "Select file (open file to select it) %S \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m"' "$path" fi -alacritty --title 'floating please' -e lf "$@" +footclient --title 'floating please' -- lf "$@" # Delete the left recommended file, if we did not actually save anything. if [ "$save" = "1" ] && ! [ -s "$out" ]; then diff --git a/modules/by-name/yt/yt/external_commands_script.sh b/modules/by-name/yt/yt/external_commands_script.sh index 2e59e94a..f16a1977 100755 --- a/modules/by-name/yt/yt/external_commands_script.sh +++ b/modules/by-name/yt/yt/external_commands_script.sh @@ -2,7 +2,7 @@ riverctl focus-output next -alacritty --title "floating please" --command "$@" +footclient --title "floating please" -- "$@" riverctl focus-output next diff --git a/modules/by-name/yt/yt/module.nix b/modules/by-name/yt/yt/module.nix index 40890d09..90efe72e 100644 --- a/modules/by-name/yt/yt/module.nix +++ b/modules/by-name/yt/yt/module.nix @@ -69,11 +69,11 @@ text = builtins.readFile ./external_commands_script.sh; runtimeInputs = [ pkgs.river-classic - pkgs.alacritty + pkgs.foot pkgs.less ]; - inheritPath = false; + inheritPath = true; })) ]; @@ -114,7 +114,7 @@ in { config = lib.mkIf cfg.enable { home-manager.users.soispha = { home.packages = [ - pkgs.yt + # pkgs.yt ]; xdg.configFile = { |
