Adding nixvim

This commit is contained in:
2025-09-17 11:31:58 -04:00
parent e75178c276
commit 8c1552cdde
8 changed files with 484 additions and 227 deletions

View File

@@ -39,63 +39,6 @@
enableDefaultPackages = true;
fontDir.enable = true;
packages = with pkgs; [
(pkgs.emacsWithPackagesFromUsePackage {
# Your Emacs config file. Org mode babel files are also
# supported.
# NB: Config files cannot contain unicode characters, since
# they're being parsed in nix, which lacks unicode
# support.
# config = ./emacs.org;
config = ../../home/emacs.org;
# config = ./emacs.el;
# Whether to include your config as a default init file.
# If being bool, the value of config is used.
# Its value can also be a derivation like this if you want to do some
# substitution:
# defaultInitFile = pkgs.substituteAll {
# name = "default.el";
# src = ./emacs.el;
# inherit (config.xdg) configHome dataHome;
# };
defaultInitFile = true;
# Package is optional, defaults to pkgs.emacs
# package = pkgs.emacs-git;
package = pkgs.emacs-unstable-pgtk;
# By default emacsWithPackagesFromUsePackage will only pull in
# packages with `:ensure`, `:ensure t` or `:ensure <package name>`.
# Setting `alwaysEnsure` to `true` emulates `use-package-always-ensure`
# and pulls in all use-package references not explicitly disabled via
# `:ensure nil` or `:disabled`.
# Note that this is NOT recommended unless you've actually set
# `use-package-always-ensure` to `t` in your config.
alwaysEnsure = true;
# For Org mode babel files, by default only code blocks with
# `:tangle yes` are considered. Setting `alwaysTangle` to `true`
# will include all code blocks missing the `:tangle` argument,
# defaulting it to `yes`.
# Note that this is NOT recommended unless you have something like
# `#+PROPERTY: header-args:emacs-lisp :tangle yes` in your config,
# which defaults `:tangle` to `yes`.
alwaysTangle = true;
# Optionally provide extra packages not in the configuration file.
# This can also include extra executables to be run by Emacs (linters,
# language servers, formatters, etc)
extraEmacsPackages = epkgs: [
epkgs.cask
pkgs.shellcheck
];
# Optionally override derivations.
override = final: prev: {
weechat = prev.melpaPackages.weechat.overrideAttrs(old: {
patches = [ ./weechat-el.patch ];
});
};
})
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
@@ -127,6 +70,71 @@
vim
curl
age
(pkgs.emacsWithPackagesFromUsePackage {
# Your Emacs config file. Org mode babel files are also
# supported.
# NB: Config files cannot contain unicode characters, since
# they're being parsed in nix, which lacks unicode
# support.
# config = ./emacs.org;
config = ../../home/emacs.org;
# config = ./emacs.el;
# Whether to include your config as a default init file.
# If being bool, the value of config is used.
# Its value can also be a derivation like this if you want to do some
# substitution:
# defaultInitFile = pkgs.substituteAll {
# name = "default.el";
# src = ./emacs.el;
# inherit (config.xdg) configHome dataHome;
# };
defaultInitFile = true;
# Package is optional, defaults to pkgs.emacs
# package = pkgs.emacs-git;
package = pkgs.emacs-unstable-pgtk;
# By default emacsWithPackagesFromUsePackage will only pull in
# packages with `:ensure`, `:ensure t` or `:ensure <package name>`.
# Setting `alwaysEnsure` to `true` emulates `use-package-always-ensure`
# and pulls in all use-package references not explicitly disabled via
# `:ensure nil` or `:disabled`.
# Note that this is NOT recommended unless you've actually set
# `use-package-always-ensure` to `t` in your config.
alwaysEnsure = true;
# For Org mode babel files, by default only code blocks with
# `:tangle yes` are considered. Setting `alwaysTangle` to `true`
# will include all code blocks missing the `:tangle` argument,
# defaulting it to `yes`.
# Note that this is NOT recommended unless you have something like
# `#+PROPERTY: header-args:emacs-lisp :tangle yes` in your config,
# which defaults `:tangle` to `yes`.
alwaysTangle = true;
# Optionally provide extra packages not in the configuration file.
# This can also include extra executables to be run by Emacs (linters,
# language servers, formatters, etc)
extraEmacsPackages = epkgs: [
epkgs.cask
pkgs.shellcheck
# Additional packages needed by emacs.org config
epkgs.s # string manipulation library used by vulpea functions
# Language servers for lsp-mode
# pkgs.basedpyright # Python LSP
pkgs.typescript-language-server # TypeScript/JavaScript LSP
pkgs.rust-analyzer # Rust LSP
pkgs.zls # Zig LSP
pkgs.nimlsp # Nim LSP
];
# Optionally override derivations.
override = final: prev: {
weechat = prev.melpaPackages.weechat.overrideAttrs(old: {
patches = [ ./weechat-el.patch ];
});
};
})
];
#media-session.enable = true;

46
modules/nixvim/nixvim.nix Normal file
View File

@@ -0,0 +1,46 @@
{ config, pkgs, lib, inputs, ... }:
{
imports = [
../which-key.nix
];
programs.nixvim = {
enable = true;
colorschemes = {
cyberdream = {
enable = true;
settings = {
borderless_telescope = true;
hide_fillchars = true;
italic_comments = true;
transparent = true;
};
};
};
plugins = {
alpha = {
enable = true;
theme = "dashboard";
};
fzf-lua = {
lazyLoad.enable = true;
settings = {
files = {
color_icons = true;
file_icons = true;
find_opts = {
__raw = "[[-type f -not -path '*.git/objects*' -not -path '*.env*']]";
};
multiprocess = true;
prompt = "󰆤 ";"
};
winopts = {
col = 0.3;
height = 0.4;
row = 0.99;
width = 0.93;
};
};
};
};
};
}

View File

@@ -0,0 +1,45 @@
{ config, pkgs, lib, inputs, ... }:
{
programs.nixvim.plugins.which-key = {
lazyLoad.enable = true;
settings = {
delay = 200;
expand = 1;
notify = false;
replace = {
desc = [
["<space>" "SPACE"]
["<leader>" "LEADER"]
["<[cC][rR]>" "ENTER"]
["<[tT][aA][bB]>" "TAB"]
["<s-tab>" "S-TAB"]
["<[bB][sS]>" "BACKSPACE"]
];
};
spec = [
{ __unkeyed-1 = "<leader>b"; group = "Buffers"; icon = "󰓩 "; }
{ __unkeyed = "<leader>c"; group = "Codesnap"; icon = "󰄄 "; mode = "v"; }
{ __unkeyed-1 = "<leader>bs"; group = "Sort"; icon = "󰒺 "; }
{ __unkeyed-1 =
[
{ __unkeyed-1 = "<leader>f"; group = "Normal Visual Group"; }
{ __unkeyed-1 = "<leader>f<tab>"; group = "Normal Visual Group in Group"; }
];
mode = ["n" "v"];
}
{ __unkeyed-1 = "<leader>w"; group = "windows"; proxy = "<C-w>"; }
{ __unkeyed-1 = "<leader>cS"; __unkeyed-2 = "<cmd>CodeSnapSave<CR>"; desc = "Save"; mode = "v"; }
{ __unkeyed-1 = "<leader>db"; __unkeyed-2 = {
__raw = ''function() require("dap").toggle_breakpoint() end'';
};
desc = "Breakpoint toggle";
mode = "n";
silent = true;
}
];
win = {
border = "rounded";
};
};
};
}