# 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 . { pkgs, lib, config, extra_modules, extra_lib, ... }: let cfg = config.soispha.programs.nvim; plgs = builtins.attrValues (extra_lib.mkByName { useShards = false; baseDirectory = ./plgs; fileName = "default.nix"; finalizeFunction = name: path: import path {inherit config lib pkgs extra_lib;}; }); 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 { type = lib.types.package; description = "The package to use for the shell in :!"; }; }; 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.sessionVariables = { EDITOR = "nvim"; VISUAL = "nvim"; CODEEDITOR = "nvim"; }; programs.nixvim = { enable = 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 '' --------------------------------------------------------------------------- -- -- ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ -- ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ -- ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ -- ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ -- ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ -- ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ -- --------------------------------------------------------------------------- ''; 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 # shell pkgs.shellcheck pkgs.shfmt ]; }; }; } ]) ); }