modules: move tui, gui, cli to programs

This commit is contained in:
Charlie Root 2024-08-16 13:44:44 +02:00
commit 47a79eea64
106 changed files with 3 additions and 47 deletions

View file

@ -0,0 +1,74 @@
{
config,
lib,
...
}: let
cfg = config.modules.usrEnv.programs.media.beets;
inherit (config.modules.other.system) username;
inherit (config.modules.usrEnv.services.media.mpd) musicDirectory;
inherit (lib) mkIf;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.beets = {
enable = true;
settings = {
ui.color = true;
directory = musicDirectory;
library = "${musicDirectory}/musiclibrary.db";
clutter = [
"Thumbs.DB"
".DS_Store"
".directory"
];
plugins = [
"mpdupdate"
"lyrics"
"thumbnails"
"fetchart"
"embedart"
"chroma"
"fromfilename"
"lastgenre"
"duplicates"
"edit"
"replaygain"
"scrub"
];
import = {
move = true;
timid = true;
detail = true;
bell = true;
write = true;
};
mpd = {
host = "localhost";
port = 6600;
};
lyrics = {
auto = true;
};
thumbnails.auto = true;
fetchart.auto = true;
embedart = {
auto = true;
remove_art_file = true;
};
acousticbrainz.auto = true;
chroma.auto = true;
replaygain.backend = "gstreamer";
};
};
};
};
}

View file

@ -0,0 +1,9 @@
_: {
imports = [
./fish.nix
./nh.nix
./starship.nix
./beets.nix
./zellij
];
}

View file

@ -0,0 +1,70 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.programs.fish;
inherit (config.modules.other.system) username;
in {
options.modules.programs.fish = {
enable = mkEnableOption "fish";
extraAliases = mkOption {
type = types.attrs;
description = "extra shell aliases";
default = {};
};
};
config = mkIf cfg.enable {
programs.fish.enable = true;
users.users.${username}.shell = pkgs.fish;
environment = {
shells = [pkgs.fish];
pathsToLink = ["/share/fish"];
};
home-manager.users.${username} = {
programs = {
zoxide.enable = true;
zoxide.enableFishIntegration = true;
fish = {
enable = true;
interactiveShellInit = "set fish_greeting";
plugins = [
{
name = "sponge";
inherit (pkgs.fishPlugins.sponge) src;
}
{
name = "done";
inherit (pkgs.fishPlugins.done) src;
}
{
name = "puffer";
inherit (pkgs.fishPlugins.puffer) src;
}
];
shellAbbrs = {
c = "clear";
cc = "cd ~ && clear";
mv = "mv -iv";
rm = "trash -v";
ls = "eza ";
l = "eza -a ";
la = "eza -lha --git";
lg = "lazygit";
cd = "z";
v = "nvim";
h = "hx";
k = "kak";
e = "emacs";
};
};
};
};
};
}

View file

@ -0,0 +1,20 @@
{
lib,
config,
...
}:
with lib; let
cfg = config.modules.programs.nh;
inherit (config.modules.other.system) username;
in {
options.modules.programs.nh.enable = mkEnableOption "nh";
config = mkIf cfg.enable {
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/${username}/projects/nichts";
};
};
}

View file

@ -0,0 +1,107 @@
# Credits to raf, his flake is in the README.md
{
config,
lib,
...
}: let
inherit (builtins) map;
inherit (config.modules.other.system) username;
hmCfg = config.home-manager.users.${username};
inherit (lib.strings) concatStrings;
in {
home-manager.users.${username} = let
elemsConcatted = concatStrings (
map (s: "\$${s}") [
"hostname"
"username"
"directory"
"shell"
"nix_shell"
"git_branch"
"git_commit"
"git_state"
"git_status"
"jobs"
"cmd_duration"
]
);
in {
home.sessionVariables = {
STARSHIP_CACHE = "${hmCfg.home.homeDirectory}/.cache/starship";
};
programs.starship = {
enable = true;
enableFishIntegration = true;
enableTransience = true;
settings = {
scan_timeout = 2;
command_timeout = 2000; # nixpkgs makes starship implode with lower values
add_newline = false;
line_break.disabled = false;
format = "${elemsConcatted}\n$character";
hostname = {
ssh_only = true;
disabled = false;
format = "@[$hostname](bold blue) "; # the whitespace at the end is actually important
};
# configure specific elements
character = {
error_symbol = "[](bold red)";
success_symbol = "[](bold green)";
vicmd_symbol = "[](bold yellow)";
format = "$symbol [|](bold bright-black) ";
};
username = {
format = "[$user]($style) in ";
};
directory = {
truncation_length = 2;
# removes the read_only symbol from the format, it doesn't play nicely with my folder icon
format = "[ ](bold green) [$path]($style) ";
# the following removes tildes from the path, and substitutes some folders with shorter names
substitutions = {
"~/Dev" = "Dev";
"~/Documents" = "Docs";
};
};
# git
git_commit.commit_hash_length = 7;
git_branch.style = "bold purple";
git_status = {
style = "red";
ahead = " ";
behind = " ";
conflicted = " ";
renamed = "»";
deleted = " ";
diverged = " ";
modified = "!";
stashed = "";
staged = "+";
untracked = "?";
};
# language configurations
# the whitespaces at the end *are* necessary for proper formatting
lua.symbol = "[ ](blue) ";
python.symbol = "[ ](blue) ";
rust.symbol = "[ ](red) ";
nix_shell.symbol = "[󱄅 ](blue) ";
golang.symbol = "[󰟓 ](blue)";
c.symbol = "[ ](black)";
nodejs.symbol = "[󰎙 ](yellow)";
package.symbol = "📦 ";
};
};
};
}

View file

@ -0,0 +1,46 @@
{
config,
lib,
...
}: let
inherit (config.modules.other.system) username;
cfg = config.modules.system.programs.zellij;
inherit (lib) mkIf;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.zellij = {
enable = true;
enableFishIntegration = true;
settings = {
on_force_close = "quit";
pane_frames = false;
default_layout = "compact";
ui = {
pane_frames = {
hide_session_name = true;
rounded_corners = true;
};
};
plugins = {
tab-bar.path = "tab-bar";
status-bar.path = "status-bar";
strider.path = "strider";
compact-bar.path = "compact-bar";
};
keybinds = {
unbind = "Ctrl n";
# resize = {
# bind = "Ctrl n";
# };
};
};
};
};
};
}

View file

@ -0,0 +1,16 @@
_: {
imports = [
./cli
./gui
./tui
./other
./services
./editors
./wms
./runners
./style
./options
./system/nix/module.nix
./system
];
}

View file

@ -0,0 +1 @@
_: {imports = [./emacs.nix ./helix.nix ./kakoune ./nvf];}

View file

@ -0,0 +1,169 @@
{
config,
lib,
pkgs,
inputs,
...
}: let
cfg = config.modules.system.programs.editors.emacs;
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
newpkgs =
pkgs.appendOverlays
(with inputs.emacs-overlay.overlays; [
emacs
package
(final: prev: {
tree-sitter = prev.tree-sitter.override {
extraGrammars = {
tree-sitter-qmljs = {
version = "master";
src = pkgs.fetchFromGitHub {
owner = "yuja";
repo = "tree-sitter-qmljs";
rev = "35ead5b9955cdb29bcf709d622fa960ff33992b6";
sha256 = "jT47lEGuk6YUjcHB0ZMyL3i5PqyUaCQmt0j78cUpy8Q=";
};
};
};
};
})
]);
tree-sitter-parsers = grammars:
with grammars; [
tree-sitter-bash
tree-sitter-c
tree-sitter-c-sharp
tree-sitter-cmake
tree-sitter-cpp
tree-sitter-css
tree-sitter-dot
tree-sitter-elisp
tree-sitter-glsl
tree-sitter-html
tree-sitter-java
tree-sitter-javascript
tree-sitter-json
tree-sitter-json5
tree-sitter-kotlin
tree-sitter-latex
tree-sitter-llvm
tree-sitter-lua
tree-sitter-make
tree-sitter-markdown
tree-sitter-markdown-inline
tree-sitter-nickel
tree-sitter-nix
tree-sitter-prisma
tree-sitter-python
tree-sitter-qmljs
tree-sitter-regex
tree-sitter-rust
tree-sitter-scss
tree-sitter-sql
tree-sitter-toml
tree-sitter-tsx
tree-sitter-typescript
tree-sitter-typst
tree-sitter-vim
tree-sitter-yaml
];
custom-emacs = with newpkgs; ((emacsPackagesFor (emacs29-pgtk.override {withNativeCompilation = true;})).emacsWithPackages (epkgs:
with epkgs; let
qml-ts-mode = trivialBuild {
pname = "qml-ts-mode";
version = "master";
src = fetchFromGitHub {
owner = "outfoxxed";
repo = "qml-ts-mode";
rev = "b24b9e78305ed045baa136782623ad16de01b7b8";
sha256 = "PgXm/a92cX5zjA9blTrIRH7DfOUczRwb9oBcMMEzF2I=";
};
};
in [
alert
all-the-icons
all-the-icons-dired
avy
beacon
catppuccin-theme
company
crux
dimmer
dired-du
dired-open
direnv
doom-modeline
editorconfig
emacs-all-the-icons-fonts
evil
evil-collection
evil-goggles
erc
erc-hl-nicks
flycheck
form-feed
general
hl-todo
kotlin-mode
ligature
lsp-mode
lsp-treemacs
lsp-ui
lsp-java
magit
markdown-mode
nasm-mode
nix-mode
no-littering
reformatter # required by nix mode
pdf-tools
peep-dired
projectile
qml-ts-mode
rainbow-delimiters
rainbow-mode
smartparens
string-inflection
tldr
toc-org
(treesit-grammars.with-grammars (grammars: tree-sitter-parsers grammars))
treemacs
treemacs-evil
treemacs-projectile
treemacs-magit
undo-tree
use-package
vertico
vterm
vterm-toggle
which-key
wakatime-mode
ws-butler
]));
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
home.packages = with pkgs; [
custom-emacs
clang-tools
ripgrep
fd
ispell
findutils
graphviz
djvulibre
hunspell
sqlite
];
services.emacs = {
enable = true;
package = custom-emacs;
};
};
};
}

View file

@ -0,0 +1,66 @@
{
config,
lib,
pkgs,
inputs',
...
}: let
cfg = config.modules.system.programs.editors.helix;
inherit (config.modules.other.system) username;
inherit (lib) mkIf getExe makeBinPath;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.helix = {
enable = true;
# thanks fuf, this is great!
package = inputs'.helix.packages.default.overrideAttrs (previousAttrs: {
makeWrapperArgs = with pkgs;
previousAttrs.makeWrapperArgs
or []
++ [
"--suffix"
"PATH"
":"
(makeBinPath [
clang-tools
marksman
nil
bash-language-server
shellcheck
typst-lsp
])
];
});
settings = {
editor = {
indent-guides.render = true;
lsp.display-inlay-hints = true;
line-number = "relative";
mouse = true;
bufferline = "multiple";
soft-wrap.enable = true;
lsp.display-messages = true;
cursor-shape = {insert = "bar";};
statusline.left = ["mode" "spinner" "version-control" "file-name"];
};
keys.normal = {
C-g = [":new" ":insert-output lazygit" ":buffer-close!" ":redraw"];
esc = ["collapse_selection" "keep_primary_selection"];
A-H = "goto_previous_buffer";
A-L = "goto_next_buffer";
A-w = ":buffer-close";
};
};
languages = {
language-server = {
nil = {
command = getExe pkgs.nil;
config.nil.formatting.command = ["${getExe pkgs.alejandra}" "-q"];
};
};
};
};
};
};
}

View file

@ -0,0 +1,113 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.modules.system.programs.editors;
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.kakoune = {
enable = true;
plugins = with pkgs.kakounePlugins; [
auto-pairs-kak
fzf-kak
powerline-kak
byline-kak
kakoune-lsp
];
config = {
ui = {
statusLine = "top";
enableMouse = true;
assistant = "none";
};
scrollOff.lines = 1;
scrollOff.columns = 3;
keyMappings = [
{
mode = "normal";
key = "<esc>";
effect = ";,";
docstring = "Press escape to clear highlighted text and collapse cursors";
}
{
mode = "normal";
key = "<c-v>";
effect = ":comment-line<ret>";
docstring = "Comment a line with <c-v>!";
}
{
mode = "normal";
key = "b";
effect = ":db<ret>";
docstring = "close current buffer";
}
{
mode = "normal";
key = "n";
effect = ":bp<ret>";
docstring = "go to next buffer";
}
{
mode = "normal";
key = "m";
effect = ":bn<ret>";
docstring = "go to next buffer";
}
{
mode = "normal";
key = " f";
effect = ":fzf-mode<ret>";
docstring = "open fzf";
}
];
};
extraConfig = ''
# display line numbers
add-highlighter global/ number-lines -hlcursor -relative -separator " " -cursor-separator " |"
# show matching symbols
add-highlighter global/ show-matching
# Intenting
set-option global tabstop 4
set-option global indentwidth 4
# Scrolloff
set-option global scrolloff 8,3
# spellcheck (requires aspell)
map -docstring "check document for spelling" global user w ": spell<ret>"
map -docstring "clear document spelling" global user q ": spell-clear<ret>"
plug "alexherbo2/auto-pairs.kak" config %{
enable-auto-pairs
}
plug "andreyorst/fzf.kak" config %{
require-module fzf
require-module fzf-grep
require-module fzf-file
} defer fzf %{
set-option global fzf_highlight_command "lat -r {}"
} defer fzf-file %{
set-option global fzf_file_command "fd . --no-ignore-vcs"
} defer fzf-grep %{
set-option global fzf_grep_command "fd"
}
plug "andreyorst/powerline.kak" defer kakoune-themes %{
powerline-theme pastel
} defer powerline %{
powerline-format global "git lsp bufname filetype mode_info lsp line_column position"
set-option global powerline_separator_thin ""
set-option global powerline_separator ""
} config %{
powerline-start
}
plug "evanrelf/byline.kak" config %{
require-module "byline"
}
'';
};
};
};
}

View file

@ -0,0 +1,66 @@
{
config,
lib,
pkgs,
...
}: let
inherit (config.modules.other.system) username;
cfg = config.modules.system.programs.editors.kakoune;
inherit (lib) mkIf mkEnableOption;
in {
imports = [./mappings.nix];
options.modules.editors.kakoune.enable = mkEnableOption "kakoune";
config.home-manager.users.${username}.programs.kakoune = mkIf cfg.enable {
enable = true;
package = pkgs.kakoune-unwrapped;
config = {
autoComplete = ["insert"];
autoReload = "yes";
indentWidth = 4;
tabStop = 4;
incrementalSearch = false;
numberLines = {
enable = true;
relative = true;
highlightCursor = true;
separator = "|";
};
scrollOff = {
lines = 4;
columns = 4;
};
wrapLines = {
enable = true;
indent = true;
word = true;
};
ui = {
enableMouse = true;
assistant = "none";
statusLine = "bottom";
};
};
plugins = with pkgs.kakounePlugins; [
active-window-kak
auto-pairs-kak
byline-kak # ope
prelude-kak # dependency of byline
fzf-kak
kakboard
kakoune-buffer-switcher
kakoune-buffers
kakoune-lsp
kakoune-rainbow
kakoune-registers
kakoune-vertical-selection
powerline-kak
quickscope-kak
smarttab-kak
zig-kak
];
# extraConfig = ./kakrc;
};
}

View file

@ -0,0 +1,18 @@
[language.haskell]
filetypes = ["haskell"]
roots = ["Setup.hs", "stack.yaml", "*.cabal"]
command = "haskell-language-server-wrapper"
args = ["--lsp"]
[language.rust]
filetypes = ["rust"]
roots = ["Cargo.toml"]
command = "rust-analyzer"
settings_section = "rust-analyzer"
[language.rust.settings.rust-analyzer]
"proMacro.enable" = true
[language.nix]
filetypes = ["nix"]
roots = ["shell.nix", "default.nix", "home.nix", "flake.nix"]
command = "rnix-lsp"

View file

@ -0,0 +1,135 @@
{
config,
lib,
pkgs,
buildGoModule,
...
}:
with lib; let
cfg = config.modules.programs.kakoune;
username = config.modules.other.system.username;
kakship = pkgs.rustPlatform.buildRustPackage rec {
pname = "kakship";
version = "0.2.8";
src = pkgs.fetchFromGitHub {
owner = "mesabloo";
repo = "kakship";
rev = "937d904a893daf59f70dc955e60209cd8866a7c3";
sha256 = "1pk0v0b31bppjzl08qgrjld40pc7rqc257zzgdl4r8zaamqsmkz9";
};
cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes = {
"kak-0.1.2" = "sha256-RhtHQkC9yCSJtr/kbC5c9MavbL79acrsiEGXyoAST8U=";
"yew-ansi-0.1.0" = "sha256-dSaEzqiOon+OqCZKQudzLRNP+Iv97kC+XZcTElKNrzs=";
};
};
# patchPhase = ''
# substituteInPlace src/main.rs \
# --replace '"starship"' "\"${pkgs.starship}/bin/starship\""
# '';
postInstall = ''
# Copy rc files to /share/kak/autoload
mkdir -p $out/share/kak/autoload/plugins/${pname}
cp $src/rc/*.kak $out/share/kak/autoload/plugins/${pname}
'';
};
kak-rainbow = pkgs.kakouneUtils.buildKakounePluginFrom2Nix rec {
pname = "kak-rainbow";
version = "1.0.0";
src = pkgs.fetchFromGitHub {
owner = "Bodhizafa";
repo = "kak-rainbow";
rev = "9c3d0aa62514134ee5cb86e80855d9712c4e8c4b";
sha256 = "sha256-ryYq4A89wVUsxgvt4YqBPXsTFMDrMJM6BDBEHrWHD1c=";
};
postInstall = ''
mkdir -p $out/lib
mv $out/share/kak/autoload/plugins/${pname}/rainbow.kak $out/lib
cat >$out/share/kak/autoload/plugins/${pname}/rainbow.kak <<EOF
provide-module rainbow %{
source $out/lib/rainbow.kak
}
EOF
'';
};
kks = pkgs.buildGoModule rec {
pname = "kks";
version = "8113ea3";
src = pkgs.fetchFromGitHub {
owner = "kkga";
repo = pname;
rev = "8113ea3bd718dec88b812faa1a41bacba0110fd7";
sha256 = "sha256-/0ocgWArELGQkOZqbYRljPnzM/zQ9HCZq7gqhMD0Mq4=";
};
vendorHash = "sha256-E4D9FGTpS9NkZy6tmnuI/F4dnO9bv8MVaRstxVPvEfo=";
doCheck = false;
meta = with lib; {
description = "Handy Kakoune companion.";
homepage = "https://github.com/kkga/kks";
license = licenses.unfree;
maintainers = with maintainers; [kalbasit];
};
};
kak-alacritty = pkgs.kakouneUtils.buildKakounePluginFrom2Nix rec {
pname = "alacritty.kak";
version = "10025b8";
src = pkgs.fetchFromGitHub {
owner = "Lokasku";
repo = pname;
rev = "66b0d2e2451c01719262effd008c40614427bb35";
sha256 = "sha256-Ibjs6dCU8/XEjUoWNB5a8R4QW7z8w6cFBSxd7UvZrxE=";
};
};
kakoune-snow = pkgs.kakouneUtils.buildKakounePluginFrom2Nix rec {
pname = "kakoune-snow";
version = "35f8187";
src = pkgs.fetchFromGitHub {
owner = "caksoylar";
repo = pname;
rev = "35f81876bcaea061982396f8071b89528940ae61";
sha256 = "";
};
};
# with lib;
in {
options.modules.programs.kakoune.enable = mkEnableOption "kakoune";
config = mkIf cfg.enable {
home-manager.users.${username} = {programs.kakoune.enable = true;};
environment.systemPackages = with pkgs; [
rust-analyzer
rustfmt # Rust LSP
kakship
kks
];
programs.kakoune = {
plugins = with pkgs.kakounePlugins; [
kakoune-lsp
fzf-kak
kak-rainbow
kak-alacritty
];
config = {
numberLines = {
enable = true;
# separator = "|";
};
scrollOff = {
columns = 15;
lines = 15;
};
};
extraConfig = builtins.readFile ./kakrc;
};
xdg.configFile."kak/starship.toml".source = ./starship.toml;
xdg.configFile."kak-lsp/kak-lsp.toml".source = ./kak-lsp.toml;
};
}

View file

@ -0,0 +1,88 @@
# --- kks
eval %sh{ kks init }
# --- kak-lsp
eval %sh{kak-lsp --kakoune -s $kak_session}
hook global WinCreate .* %{
lsp-inlay-hints-enable window
lsp-auto-signature-help-enable
}
hook global WinSetOption filetype=(nix|haskell) %{
lsp-enable-window
}
set-option global lsp_completion_trigger "execute-keys 'h<a-h><a-k>\S[^\h\n,=;*(){}\[\]]\z<ret>'"
set-option global lsp_diagnostic_line_error_sign "!"
set-option global lsp_diagnostic_line_warning_sign "?"
hook global WinSetOption filetype=(rust) %{
map window user "l" ':enter-user-mode lsp<ret>' -docstring "LSP mode"
lsp-enable-window
lsp-auto-hover-insert-mode-disable
set-option window lsp_hover_anchor true
set-face window DiagnosticError default+u
set-face window DiagnosticWarning default+u
set-option window lsp_server_configuration rust.clippy_preference="on"
}
# hook global WinSetOption filetype=rust %{
# lsp-enable-window hook window BufWritePre .* lsp-formatting-sync
# hook window -group rust-inlay-hints BufWritePost .* rust-analyzer-inlay-hints
# hook -once -always window WinSetOption filetype=.* %{
# remove-hooks window rust-inlay-hints
# }
# }
map global normal <a-d> ':lsp-definition<ret>'
# --- kakoune-rainbow
hook global ModuleLoaded rainbow %{
set-option global rainbow_colors rgb:FF3B2F+db rgb:FF9500+db rgb:FFCC02+db rgb:27cd41+db rgb:007AFF+db rgb:AF52DE+db
hook global WinSetOption filetype=(rust|python|c|cpp|scheme|lisp|clojure|javascript|json|kak|haskell|python|latex|nix) %{
rainbow-enable-window
}
}
# --- alacritty.kak
hook global ModuleLoaded x11 %{
alias global terminal kitty-terminal
alias global popup alacritty-terminal-popup
}
# --- Kakship
hook global ModuleLoaded kakship %{
kakship-enable
}
# --- Broot
define-command -override broot-oneoff-select -docstring 'focus broot' %{
evaluate-commands %sh{
d="$(dirname "$kak_buffile")"
b="$(basename "$kak_buffile")"
echo echo -debug "$d"
broot_cmd="broot"
if [ -d "$d" ]; then
broot_cmd="$broot_cmd --cmd \":focus $d;:select $b\""
fi
echo "kks-connect ala-popup sh -c '""kks send edit $broot_cmd""'"
}
}
define-command ala-popup -params .. -shell-completion -docstring 'alacritty-terminal-popup <program> [arguments]: create a new terminal as an Alacritty window (class: popup, app_id: popup)' %{
nop %sh{
setsid alacritty -o window.dimensions.columns=200 window.dimensions.lines=57 --title popup --class 'alacritty-popup' --command "$@" < /dev/null > /dev/null 2>&1 &
}
}
# --- Map
map global normal <c-f> ':fzf-mode<ret>f<ret>'
map global normal <c-t> ':alacritty-popup<ret>'
require-module fzf
set-option global fzf_terminal_command 'ala-popup kak -c %val{session} -e "%arg{@}"'
require-module alacritty
require-module rainbow

View file

@ -0,0 +1,48 @@
{
config,
lib,
pkgs,
...
}: let
inherit (config.modules.other.system) username;
in {
config.home-manager.users.${username}.programs.kakoune.config.keyMappings = [
{
mode = "normal";
key = "<esc>";
effect = ";,";
docstring = "Press escape to clear highlighted text and collapse cursors";
}
{
mode = "normal";
key = "<c-v>";
effect = ":comment-line<ret>";
docstring = "Comment a line with <c-v>!";
}
{
mode = "normal";
key = "b";
effect = ":db<ret>";
docstring = "close current buffer";
}
{
mode = "normal";
key = "n";
effect = ":bp<ret>";
docstring = "go to next buffer";
}
{
mode = "normal";
key = "m";
effect = ":bn<ret>";
docstring = "go to next buffer";
}
{
mode = "normal";
key = " f";
effect = ":fzf-mode<ret>";
docstring = "open fzf";
}
];
}

View file

@ -0,0 +1,20 @@
# add_newline = false
format = """
\$directory
\${custom.separator}
"""
[directory]
format = '[$path/]($style)'
truncate_length = 2
truncate_to_repo = false
use_logical_pat = true
style = "fg:cyan"
truncate_symbol = "../"
disabled = false
[custom.separator]
format = "[ ||| ]($style)"
style = "fg:purple"
disabled = false

View file

@ -0,0 +1,34 @@
{
pkgs,
config,
lib,
inputs,
...
}: let
cfg = config.modules.system.programs.editors.neovim;
inherit (builtins) filter map toString elem;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix;
inherit (lib.lists) concatLists;
inherit (lib) mkIf;
mkNeovimModule = {
path,
ignoredPaths ? [],
}:
filter (hasSuffix ".nix") (
map toString (
filter (path: path != ./default.nix && !elem path ignoredPaths) (listFilesRecursive path)
)
);
nvf = inputs.neovim-flake;
in {
imports = concatLists [
# neovim-flake home-manager module
[nvf.nixosModules.default]
# construct this entire directory as a module
# which means all default.nix files will be imported automtically
(mkNeovimModule {path = ./.;})
];
}

View file

@ -0,0 +1,134 @@
-- luacheck: ignore
-- alias for vim.api.nvim_create_autocmd
local create_autocmd = vim.api.nvim_create_autocmd
-- alias for vim.api.nvim_create_augroup
local create_augroup = vim.api.nvim_create_augroup
create_autocmd('BufWritePre', {
pattern = { '/tmp/*', 'COMMIT_EDITMSG', 'MERGE_MSG', '*.tmp', '*.bak' },
callback = function()
vim.opt_local.undofile = false
end,
})
-- Remove whitespaces on save
-- this is normally handled by the formatter
-- but this should help when the formatter
-- is not working or has timed out
-- create_autocmd('BufWritePre', {
-- pattern = '',
-- command = ':%s/\\s\\+$//e',
-- })
-- Disable line wrapping & spell checking
-- for the terminal buffer
create_autocmd({ 'FileType' }, {
pattern = { 'toggleterm' },
callback = function()
vim.opt_local.wrap = false
vim.opt_local.spell = false
end,
})
-- Enable spell checking & line wrapping
-- for git commit messages
create_autocmd({ 'FileType' }, {
pattern = { 'gitcommit' },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
})
-- Highlight yank after yanking
local highlight_group = create_augroup('YankHighlight', { clear = true })
create_autocmd({ 'TextYankPost' }, {
pattern = { '*' },
group = highlight_group,
callback = function()
vim.highlight.on_yank({ higroup = 'Visual', timeout = 200 })
end,
})
-- Close terminal window if process exists with code 0
create_autocmd('TermClose', {
callback = function()
if not vim.b.no_auto_quit then
vim.defer_fn(function()
if vim.api.nvim_get_current_line() == '[Process exited 0]' then
vim.api.nvim_buf_delete(0, { force = true })
end
end, 50)
end
end,
})
-- Start insert mode automatically
-- when editing a Git commit message
create_augroup('AutoInsert', { clear = true })
create_autocmd('FileType', {
group = 'AutoInsert',
pattern = 'gitcommit',
command = 'startinsert',
})
-- Disable cursorline in insert mode
create_augroup('CursorLine', { clear = true })
create_autocmd({ 'InsertLeave', 'WinEnter' }, {
group = 'CursorLine',
callback = function()
vim.wo.cursorline = true
end,
})
create_autocmd({ 'InsertEnter', 'WinLeave' }, {
group = 'CursorLine',
callback = function()
vim.wo.cursorline = false
end,
})
-- Create the necessary directory structure for the file being saved.
create_augroup('AutoMkdir', { clear = true })
create_autocmd('BufWritePre', {
group = 'AutoMkdir',
callback = function(event)
local file = vim.loop.fs_realpath(event.match) or event.match
vim.fn.mkdir(vim.fn.fnamemodify(file, ':p:h'), 'p')
end,
})
-- Adjust the window size when the terminal is resized
create_autocmd('VimResized', {
command = 'wincmd =',
})
-- Allow closing certain windows with "q"
-- and remove them from the buffer list
create_augroup('close_with_q', { clear = true })
create_autocmd('FileType', {
group = 'close_with_q',
pattern = {
'help',
'lspinfo',
'TelescopePrompt',
},
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.keymap.set('n', 'q', '<cmd>close<cr>', { buffer = event.buf, silent = true })
end,
})
-- Mark internally when nvim is focused
-- and when it is not
create_autocmd('FocusGained', {
callback = function()
vim.g.nvim_focused = true
end,
})
create_autocmd('FocusLost', {
callback = function()
vim.g.nvim_focused = false
end,
})

View file

@ -0,0 +1,38 @@
local opt = vim.opt
local options = {
showmode = false, -- disable the -- STATUS -- line
showtabline = 0, -- never show the tabline
startofline = true, -- motions like "G" also move to the first char
virtualedit = 'block', -- visual-block mode can select beyond end of line
showmatch = true, -- when closing a bracket, briefly flash the matching one
matchtime = 1, -- duration of that flashing n deci-seconds
signcolumn = 'yes:1', -- static width
report = 9001, -- disable "x more/fewer lines" messages
diffopt = opt.diffopt:append('vertical'), -- diff mode: vertical splits
backspace = { 'indent', 'eol', 'start' }, -- backspace through everything in insert mode
hidden = true, -- Enable background buffers
history = 100, -- Remember N lines in history
lazyredraw = false, -- Faster scrolling if enabled, breaks noice
synmaxcol = 240, -- Max column for syntax highlight
updatetime = 250, -- ms to wait for trigger an event
-- If 0, move cursor line will not scroll window.
-- If 999, cursor line will always be in middle of window.
scrolloff = 0,
}
-- iterate over the options table and set the options
-- for each key = value pair
for key, value in pairs(options) do
opt[key] = value
end
-- Don't auto-comment new lines automatically
-- that happens when you press enter at the end
-- of a comment line, and comments the next line
-- That's annoying and we don't want it!
-- don't continue comments automagically
-- https://neovim.io/doc/user/options.html#'formatoptions'
opt.formatoptions:remove('c')
opt.formatoptions:remove('r')
opt.formatoptions:remove('o')

View file

@ -0,0 +1,17 @@
-- disable the "how to disable mouse" message
-- in right click popups
vim.cmd.aunmenu([[PopUp.How-to\ disable\ mouse]])
vim.cmd.aunmenu([[PopUp.-1-]])
vim.cmd.amenu([[PopUp.Inspect <Cmd>Inspect<CR>]])
vim.cmd.amenu([[PopUp.Telescope <Cmd>Telescope<CR>]])
vim.cmd.amenu([[PopUp.Code\ action <Cmd>lua vim.lsp.buf.code_action()<CR>]])
vim.cmd.amenu([[PopUp.LSP\ Hover <Cmd>lua vim.lsp.buf.hover()<CR>]])
-- Add a blinking cursor in certain modes.
vim.opt.guicursor = {
'n-c-v:block-Cursor',
'i-ci-ve-r-o:blinkwait250-blinkon250-blinkoff250-Cursor',
'i-ci-ve:ver25-Cursor',
'r-cr-o:hor20-Cursor',
}

View file

@ -0,0 +1,21 @@
-- taken from https://github.com/sitiom/nvim-numbertoggle
vim.api.nvim_create_autocmd({ 'BufEnter', 'FocusGained', 'InsertLeave', 'CmdlineLeave', 'WinEnter' }, {
pattern = '*',
group = vim.api.nvim_create_augroup('NumberToggle', {}),
callback = function()
if vim.o.nu and vim.api.nvim_get_mode().mode ~= 'i' then
vim.opt.relativenumber = true
end
end,
})
vim.api.nvim_create_autocmd({ 'BufLeave', 'FocusLost', 'InsertEnter', 'CmdlineEnter', 'WinLeave' }, {
pattern = '*',
group = vim.api.nvim_create_augroup('NumberToggle', {}),
callback = function()
if vim.o.nu then
vim.opt.relativenumber = false
vim.cmd('redraw')
end
end,
})

View file

@ -0,0 +1,3 @@
-- More natural pane splitting
vim.o.splitbelow = true
vim.o.splitright = true

View file

@ -0,0 +1,93 @@
local opt = vim.opt
-- luacheck: ignore
-- When true, all the windows are automatically made the same size after splitting or closing a window.
-- When false, splitting a window will reduce the size of the current window and leave the other windows the same.
opt.equalalways = false
opt.cmdheight = 1 -- Better display for messages
opt.colorcolumn = '+0' -- Align text at 'textwidth'
opt.showtabline = 2 -- Always show the tabs line
opt.helpheight = 0 -- Disable help window resizing
opt.winwidth = 30 -- Minimum width for active window
opt.winminwidth = 1 -- Minimum width for inactive windows
opt.winheight = 1 -- Minimum height for active window
opt.winminheight = 1 -- Minimum height for inactive window
opt.pumheight = 10 -- Maximum number of items to show in the popup menu
opt.winminwidth = 1 -- min width of inactive window
-- opt.pumblend = 100 -- Popup blend, 100 means transparent
opt.cursorline = true
opt.whichwrap:append('<,>,h,l,[,]')
opt.list = true
-- characters to fill the statuslines, vertical separators and special
-- lines in the window.opt.whichwrap:append('<,>,h,l,[,]')
opt.fillchars:append({
-- replace window border with slightly thicker characters
-- although taking a bit of more space, it helps me better
-- identify the window borders
horiz = '',
horizup = '',
horizdown = '',
vert = '',
vertleft = '',
vertright = '',
verthoriz = '',
eob = ' ', -- suppress end of buffer lines (~)
diff = '', -- deleted lines of the 'diff' option
msgsep = '',
-- replace fold chars
fold = ' ',
foldopen = '',
foldclose = '',
})
-- List chars that would b shown on all modes
-- better kept simple, because it gets REALLY
-- noisy in an average buffer
local normal_listchars = {
extends = '', -- Alternatives: … ,»
precedes = '', -- Alternatives: … ,«
}
opt.listchars = normal_listchars
-- Show listchars while in Insert mode.
local insert_listchars = {
eol = nil,
tab = '▎·',
lead = '·',
space = '·',
trail = '.',
multispace = '',
nbsp = '¤',
}
-- Show listchars while in Insert mode.
vim.api.nvim_create_augroup('InsertModeListChars', { clear = true })
vim.api.nvim_create_autocmd({ 'InsertEnter', 'InsertLeavePre' }, {
group = 'InsertModeListChars',
pattern = '*',
callback = function(args)
if vim.tbl_contains({ 'quickfix', 'prompt' }, args.match) then
return
end
if args.event == 'InsertEnter' then
vim.opt_local.listchars = insert_listchars
else
vim.opt_local.listchars = normal_listchars
end
-- check if ibl is enabled
-- @diagnostic disable-next-line: no-unknown, unused-local
local status_ok, ibl = pcall(require, 'ibl')
if not status_ok then
return
end
require('ibl').debounced_refresh(0)
end,
})

View file

@ -0,0 +1,18 @@
-- luacheck: ignore
vim.g.markdown_fenced_languages = { 'shell=bash' }
local file_syntax_map = {
{ pattern = '*.rasi', syntax = 'scss' },
{ pattern = 'flake.lock', syntax = 'json' },
{ pattern = '*.ignore', syntax = 'gitignore' }, -- also ignore for fd/ripgrep
{ pattern = '*.ojs', syntax = 'javascript' },
{ pattern = '*.astro', syntax = 'astro' },
{ pattern = '*.mdx', syntax = 'mdx' }
}
for _, elem in ipairs(file_syntax_map) do
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
pattern = elem.pattern,
command = 'set syntax=' .. elem.syntax,
})
end

View file

@ -0,0 +1,22 @@
local cmd = vim.cmd
-- luacheck: ignore
local abbreviations = {
Wq = 'wq', -- keep making those typos
WQ = 'wq',
Wqa = 'wqa',
W = 'w',
Q = 'q',
Qa = 'qa',
Bd = 'bd',
E = 'e',
q1 = 'q!', -- this is for when I don't want to reach to shift
qa1 = 'qa!',
mk = 'mark', -- make marks faster
st = 'sort', -- sort
}
-- add more abbreviations
for left, right in pairs(abbreviations) do
cmd.cnoreabbrev(('%s %s'):format(left, right))
end

View file

@ -0,0 +1,13 @@
-- If the cursor has been idle for some time, check if the current buffer
-- has been modified externally. prompt the user to reload it if has.
local bufnr = vim.api.nvim_get_current_buf()
-- luacheck: ignore
vim.opt_local.autoread = true
vim.api.nvim_create_autocmd('CursorHold', {
group = vim.api.nvim_create_augroup('Autoread', { clear = true }),
buffer = bufnr,
callback = function()
vim.cmd('silent! checktime')
end,
})

View file

@ -0,0 +1,68 @@
-- luacheck: ignore
vim.opt.spelllang:append('cjk') -- disable spellchecking for asian characters (VIM algorithm does not support it)
vim.opt.shortmess = {
t = true, -- truncate file messages at start
A = true, -- ignore annoying swap file messages
o = true, -- file-read message overwrites previous
O = true, -- file-read message overwrites previous
T = true, -- truncate non-file messages in middle
f = true, -- (file x of x) instead of just (x of x
F = true, -- Don't give file info when editing a file, NOTE: this breaks autocommand messages
s = true,
c = true,
W = true, -- Don't show [w] or written when writing
}
-- Disable nvim intro
vim.opt.shortmess:append('sI')
-- Some of those are already disasbled in the Neovim wrapper
-- as configured by nvf. I'm just making sure they are disabled
-- here as well.
local disable_distribution_plugins = function()
local disabled_built_ins = {
'2html_plugin',
'getscript',
'getscriptPlugin',
'gzip',
'logipat',
'matchit',
'matchparen',
'tar',
'tarPlugin',
'rrhelper',
'spellfile_plugin',
'vimball',
'vimballPlugin',
'zip',
'zipPlugin',
'tutor',
'rplugin',
'synmenu',
'optwin',
'compiler',
'bugreport',
'ftplugin',
'netrw',
'netrwPlugin',
'netrwSettings',
'netrwFileHandlers',
-- "skip_ts_context_commentstring_module"
}
for _, plugin in pairs(disabled_built_ins) do
g['loaded_' .. plugin] = 1
end
end
-- https://github.com/neovim/neovim/issues/14090#issuecomment-1177933661
-- vim.g.do_filetype_lua = 1
-- vim.g.did_load_filetypes = 0
-- Neovim should not be able to load from those paths since
-- we ultimately want to be able to *only* want the nvf config
-- to be the effective one
vim.opt.runtimepath:remove('/etc/xdg/nvim')
vim.opt.runtimepath:remove('/etc/xdg/nvim/after')
vim.opt.runtimepath:remove('/usr/share/vim/vimfiles')

View file

@ -0,0 +1,22 @@
-- Diagnostic settings:
-- see: `:help vim.diagnostic.config`
vim.diagnostic.config({
update_in_insert = true,
virtual_text = false,
signs = true,
underline = true,
severity_sort = true,
virtual_lines = {
only_current_line = true,
spacing = 2,
},
float = {
focusable = false,
style = 'minimal',
border = 'rounded',
source = 'always',
header = '',
prefix = '',
},
})

View file

@ -0,0 +1,34 @@
-- luacheck: ignore
local float_options = {
border = 'single',
max_width = math.ceil(vim.api.nvim_win_get_width(0) * 0.6),
max_height = math.ceil(vim.api.nvim_win_get_height(0) * 0.8),
}
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = true,
signs = false,
underline = true,
update_in_insert = false,
severity_sort = true,
})
vim.lsp.handlers['textDocument/show_line_diagnostics'] = vim.lsp.with(vim.lsp.handlers.hover, float_options)
-- Prevent show notification
-- <https://github.com/neovim/neovim/issues/20457#issuecomment-1266782345>
vim.lsp.handlers['textDocument/hover'] = function(_, result, ctx, config)
config = config or float_options
config.focus_id = ctx.method
if not result then
return
end
local markdown_lines = vim.lsp.util.convert_input_to_markdown_lines(result.contents)
markdown_lines = vim.lsp.util.trim_empty_lines(markdown_lines)
if vim.tbl_isempty(markdown_lines) then
return
end
return vim.lsp.util.open_floating_preview(markdown_lines, 'markdown', config)
end
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, float_options)

View file

@ -0,0 +1,30 @@
if vim.g.neovide then
local vks = vim.keymap.set
vim.g.neovide_scale_factor = 1.0
vim.g.minianimate_disable = true
vim.g.neovide_window_blurred = true
vim.g.neovide_transparency = 0.80
vim.g.neovide_show_border = true
vim.g.neovide_input_macos_alt_is_meta = true
vim.g.neovide_cursor_animate_command_line = false -- noice incompat
vim.g.neovide_cursor_smooth_blink = true
vim.g.neovide_cursor_vfx_mode = 'ripple'
-- keymaps
vks('v', '<D-c>', '"+y') -- Copy
vks({ 'n', 'v' }, '<D-v>', '"+P') -- Paste
vks({ 'i', 'c' }, '<D-v>', '<C-R>+') -- Paste
vks('t', '<D-v>', [[<C-\><C-N>"+P]]) -- Paste
vks('n', '<D-+>', function()
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * 1.1
end)
vks('n', '<D-->', function()
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor / 1.1
end)
vks({ 'n', 'v', 't', 'i' }, '<D-}>', [[<C-\><C-N><Cmd>tabnext<CR>]])
vks({ 'n', 'v', 't', 'i' }, '<D-{>', [[<C-\><C-N><Cmd>tabprev<CR>]])
vks({ 'n', 'v', 't', 'i' }, '<D-l>', [[<C-\><C-N><Cmd>tabnext #<CR>]])
vks({ 'n', 'v', 't', 'i' }, '<D-t>', [[<C-\><C-N><Cmd>tabnew<CR>]])
vks({ 'n', 'v', 't', 'i' }, '<D-w>', [[<C-\><C-N><Cmd>tabclose<CR>]])
end

View file

@ -0,0 +1,33 @@
-- https://github.com/asvetliakov/vscode-neovim#normal-mode-control-keys
-- available by default
-- CTRL-a
-- CTRL-b
-- CTRL-c
-- CTRL-d
-- CTRL-e
-- CTRL-f
-- CTRL-i
-- CTRL-o
-- CTRL-r
-- CTRL-u
-- CTRL-v
-- CTRL-w
-- CTRL-x
-- CTRL-y
-- CTRL-]
-- CTRL-j
-- CTRL-k
-- CTRL-l
-- CTRL-h
-- CTRL-/
if vim.g.vscode then
vim.keymap.set('n', 'H', '<Cmd>Tabprevious<CR>', { noremap = true, silent = true })
vim.keymap.set('n', 'L', '<Cmd>Tabnext<CR>', { noremap = true, silent = true })
vim.keymap.set(
'n',
'<Leader>p',
"<<Cmd>call VSCodeNotify('workbench.action.quickOpen')<CR>>",
{ noremap = true, silent = true }
)
end

View file

@ -0,0 +1,70 @@
local noice = require('noice')
local no_top_text = {
opts = {
border = {
text = { top = '' },
},
},
}
-- luacheck: ignore
noice.setup({
cmdline = {
format = {
cmdline = no_top_text,
filter = no_top_text,
lua = no_top_text,
search_down = no_top_text,
search_up = no_top_text,
},
},
lsp = {
override = {
['cmp.entry.get_documentation'] = true,
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
['vim.lsp.util.stylize_markdown'] = true,
},
progress = {
enabled = false,
},
},
popupmenu = {
backend = 'cmp',
},
routes = {
{
filter = {
event = 'msg_show',
kind = 'search_count',
},
opts = { skip = true },
},
{
-- skip progress messages from noisy servers
filter = {
event = 'lsp',
kind = 'progress',
cond = function(message)
local client = vim.tbl_get(message.opts, 'progress', 'client')
return client == 'ltex'
end,
},
opts = { skip = true },
},
},
views = {
cmdline_popup = {
border = {
style = 'single',
},
},
confirm = {
border = {
style = 'single',
text = { top = '' },
},
},
},
})

View file

@ -0,0 +1,9 @@
{
programs.neovim-flake.settings.vim.maps = {
insert = {
# vsnip
#"<C-jn>".action = "<Plug>(vsnip-jump-next)";
#"<C-jp>".action = "<Plug>(vsnip-jump-prev)";
};
};
}

View file

@ -0,0 +1,57 @@
{
programs.neovim-flake.settings.vim.maps = {
normal = {
# "<leader>gg".action = "<cmd>LazyGit<CR>";
# General
"<leader>fd".action = "<cmd>lua vim.g.formatsave = not vim.g.formatsave<CR>";
"<leader>zt".action = ":<C-U>let g:default_terminal = v:count1<CR>";
# "<leader>ld".action = ":lua vim.diagnostic.setqflist({open = true})<CR>";
# "<leader>lf".action = ":lua vim.lsp.buf.format()<CR>";
# "<leader>li".action = ":lua vim.lsp.buf.implementation()<CR>";
"<leader>;".action = "A;<esc>"; # Append #
# Diffview
"<leader>gdq".action = "<cmd>DiffviewClose<CR>";
"<leader>gdd".action = "<cmd>DiffviewOpen ";
"<leader>gdm".action = "<cmd>DiffviewOpen<CR>";
"<leader>gdh".action = "<cmd>DiffviewFileHistory %<CR>";
"<leader>gde".action = "<cmd>DiffviewToggleFiles<CR>";
# Git
"<leader>gu".action = "<cmd>Gitsigns undo_stage_hunk<CR>";
"<leader>g<C-w>".action = "<cmd>Gitsigns preview_hunk<CR>";
"<leader>gp".action = "<cmd>Gitsigns prev_hunk<CR>";
"<leader>gn".action = "<cmd>Gitsigns next_hunk<CR>";
"<leader>gP".action = "<cmd>Gitsigns preview_hunk_inline<CR>";
"<leader>gR".action = "<cmd>Gitsigns reset_buffer<CR>";
"<leader>gb".action = "<cmd>Gitsigns blame_line<CR>";
"<leader>gD".action = "<cmd>Gitsigns diffthis HEAD<CR>";
"<leader>gw".action = "<cmd>Gitsigns toggle_word_diff<CR>";
# Movement
"<C-h>".action = "<C-W>h";
"<C-j>".action = "<C-W>j";
"<C-k>".action = "<C-W>k";
"<C-l>".action = "<C-W>l";
# Telescope
"<M-f>".action = "<cmd>Telescope resume<CR>";
"<leader>fq".action = "<cmd>Telescope quickfix<CR>";
"<leader>f/".action = "<cmd>Telescope live_grep<cr>";
};
normalVisualOp = {
"<leader>gs".action = "<cmd>Gitsigns stage_hunk<CR>";
"<leader>gr".action = "<cmd>Gitsigns reset_hunk<CR>";
"<leader>lr".action = "<cmd>lua vim.lsp.buf.references()<CR>";
# ssr.nvim
"<leader>sr".action = ":lua require('ssr').open()<CR>";
# Toggleterm
"<leader>ct" = {
# action = ":<C-U>ToggleTermSendVisualLines v:count<CR>";
action = "':ToggleTermSendVisualLines ' . v:count == 0 ? g:default_terminal : v:count";
expr = true;
};
};
};
}

View file

@ -0,0 +1,9 @@
{
programs.neovim-flake.settings.vim.maps = {
select = {
# vsnip
#"<C-jn>".action = "<Plug>(vsnip-jump-next)";
#"<C-jp>".action = "<Plug>(vsnip-jump-prev)";
};
};
}

View file

@ -0,0 +1,7 @@
{
programs.neovim-flake.settings.vim.maps = {
terminal = {
"<M-x>".action = "<cmd>q<CR>";
};
};
}

View file

@ -0,0 +1,206 @@
{
config,
pkgs,
...
}: let
inherit (config.modules.other.system) username;
inherit (pkgs.vimPlugins) friendly-snippets aerial-nvim nvim-surround undotree mkdir-nvim ssr-nvim direnv-vim legendary-nvim lazygit-nvim;
inherit (pkgs) fetchFromGitHub;
inherit (pkgs.vimUtils) buildVimPlugin;
pluginSources = {
smart-splits = buildVimPlugin {
name = "smart-splits";
src = fetchFromGitHub {
owner = "mrjones2014";
repo = "smart-splits.nvim";
rev = "95833675cd92538bf9cded1d2d58d1fc271c5428";
hash = "sha256-TsEzHalLTLp9USV0aGRadAObViC/OpIJeuEJ95lJUL8=";
};
};
regexplainer = buildVimPlugin {
name = "nvim-regexplainer";
src = fetchFromGitHub {
owner = "bennypowers";
repo = "nvim-regexplainer";
rev = "4250c8f3c1307876384e70eeedde5149249e154f";
hash = "sha256-15DLbKtOgUPq4DcF71jFYu31faDn52k3P1x47GL3+b0=";
};
};
specs-nvim = buildVimPlugin {
name = "specs.nvim";
src = fetchFromGitHub {
owner = "notashelf";
repo = "specs.nvim";
rev = "0792aaebf8cbac0c8545c43ad648b98deb83af42";
hash = "sha256-doHE/3bRuC8lyYxMk927JmwLfiy7aR22+i+BNefEGJ4=";
};
};
deferred-clipboard = buildVimPlugin {
name = "deferred-clipboard";
src = fetchFromGitHub {
owner = "EtiamNullam";
repo = "deferred-clipboard.nvim";
rev = "810a29d166eaa41afc220cc7cd85eeaa3c43b37f";
hash = "sha256-nanNQEtpjv0YKEkkrPmq/5FPxq+Yj/19cs0Gf7YgKjU=";
};
};
/*
data-viewer-nvim = buildVimPlugin {
name = "data-viewer.nvim";
src = fetchFromGitHub {
owner = "VidocqH";
repo = "data-viewer.nvim";
rev = "40ddf37bb7ab6c04ff9e820812d1539afe691668";
hash = "sha256-D5hvLhsYski11H9qiDDL2zlZMtYmbpHgpewiWR6C7rE=";
};
};
*/
vim-nftables = buildVimPlugin {
name = "vim-nftables";
src = fetchFromGitHub {
owner = "awisse";
repo = "vim-nftables";
rev = "bc29309080b4c7e1888ffb1a830846be16e5b8e7";
hash = "sha256-L1x3Hv95t/DBBrLtPBKrqaTbIPor/NhVuEHVIYo/OaA=";
};
};
neotab-nvim = buildVimPlugin {
name = "neotab.nvim";
src = fetchFromGitHub {
owner = "kawre";
repo = "neotab.nvim";
rev = "6c6107dddaa051504e433608f59eca606138269b";
hash = "sha256-bSFKbjj8fJHdfBzYoQ9l3NU0GAYfdfCbESKbwdbLNSw=";
};
};
};
in {
programs.neovim-flake.settings.vim.extraPlugins = {
# plugins that are pulled from nixpkgs
direnv = {package = direnv-vim;};
friendly-snippets = {package = friendly-snippets;};
mkdir-nvim = {package = mkdir-nvim;};
lazygit-nvim = {package = lazygit-nvim;};
aerial = {
package = aerial-nvim;
setup = "require('aerial').setup {}";
};
nvim-surround = {
package = nvim-surround;
setup = "require('nvim-surround').setup {}";
};
undotree = {
package = undotree;
setup = ''
vim.g.undotree_ShortIndicators = true
vim.g.undotree_TreeVertShape = ''
'';
};
ssr-nvim = {
package = ssr-nvim;
setup = "require('ssr').setup {}";
};
legendary = {
package = legendary-nvim;
setup = ''
require('legendary').setup {};
'';
};
# plugins that are built from their sources
# regexplainer = {package = pluginSources.regexplainer;};
# vim-nftables = {package = pluginSources.vim-nftables;};
/*
data-view = {
package = pluginSources.data-viewer-nvim;
setup = ''
-- open data files in data-viewer.nvim
vim.api.nvim_exec([[
autocmd BufReadPost,BufNewFile *.sqlite,*.csv,*.tsv DataViewer
]], false)
-- keybinds
vim.api.nvim_set_keymap('n', '<leader>dv', ':DataViewer<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>dvn', ':DataViewerNextTable<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>dvp', ':DataViewerPrevTable<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>dvc', ':DataViewerClose<CR>', {noremap = true})
'';
};
*/
smart-splits = {
package = pluginSources.smart-splits;
setup = "require('smart-splits').setup {}";
};
neotab-nvim = {
package = pluginSources.neotab-nvim;
setup = ''
require('neotab').setup {
tabkey = "<Tab>",
act_as_tab = true,
behavior = "nested", ---@type ntab.behavior
pairs = { ---@type ntab.pair[]
{ open = "(", close = ")" },
{ open = "[", close = "]" },
{ open = "{", close = "}" },
{ open = "'", close = "'" },
{ open = '"', close = '"' },
{ open = "`", close = "`" },
{ open = "<", close = ">" },
},
exclude = {},
smart_punctuators = {
enabled = false,
semicolon = {
enabled = false,
ft = { "cs", "c", "cpp", "java" },
},
escape = {
enabled = false,
triggers = {}, ---@type table<string, ntab.trigger>
},
},
}
'';
};
specs-nvim = {
package = pluginSources.specs-nvim;
setup = ''
require('specs').setup {
show_jumps = true,
popup = {
delay_ms = 0,
inc_ms = 15,
blend = 15,
width = 10,
winhl = "PMenu",
fader = require('specs').linear_fader,
resizer = require('specs').shrink_resizer
},
ignore_filetypes = {'NvimTree', 'undotree'},
ignore_buftypes = {nofile = true},
}
-- toggle specs using the <C-b> keybind
vim.api.nvim_set_keymap('n', '<C-b>', ':lua require("specs").show_specs()', { noremap = true, silent = true })
-- bind specs to navigation keys
vim.api.nvim_set_keymap('n', 'n', 'n:lua require("specs").show_specs()<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', 'N', 'N:lua require("specs").show_specs()<CR>', { noremap = true, silent = true })
'';
};
};
}

View file

@ -0,0 +1,8 @@
_: {
programs.neovim-flake.settings.vim = {
assistant.copilot = {
enable = false;
cmp.enable = false;
};
};
}

View file

@ -0,0 +1,16 @@
_: {
programs.neovim-flake.settings.vim = {
autocomplete = {
enable = true;
type = "nvim-cmp";
mappings = {
# close = "<C-e>";
# confirm = "<tab>";
next = "<C-n>";
previous = "<C-p>";
scrollDocsDown = "<C-j>";
scrollDocsUp = "<C-k>";
};
};
};
}

View file

@ -0,0 +1,5 @@
_: {
programs.neovim-flake.settings.vim = {
autopairs.enable = true;
};
}

View file

@ -0,0 +1,8 @@
_: {
programs.neovim-flake.settings.vim = {
binds = {
whichKey.enable = true;
cheatsheet.enable = true;
};
};
}

View file

@ -0,0 +1,5 @@
_: {
programs.neovim-flake.settings.vim = {
comments.comment-nvim.enable = true;
};
}

View file

@ -0,0 +1,7 @@
_: {
programs.neovim-flake.settings.vim = {
dashboard = {
alpha.enable = true;
};
};
}

View file

@ -0,0 +1,8 @@
_: {
programs.neovim-flake.settings.vim = {
debugger.nvim-dap = {
enable = true;
ui.enable = true;
};
};
}

View file

@ -0,0 +1,64 @@
_: {
programs.neovim-flake.settings.vim = {
filetree = {
nvimTree = {
enable = true;
openOnSetup = true;
mappings = {
#toggle = "<C-w>";
toggle = "<leader>e";
};
setupOpts = {
disable_netrw = true;
update_focused_file.enable = true;
hijack_unnamed_buffer_when_opening = true;
hijack_cursor = true;
hijack_directories = {
enable = true;
auto_open = true;
};
git = {
enable = true;
show_on_dirs = false;
timeout = 500;
};
view = {
cursorline = false;
width = 35;
};
renderer = {
indent_markers.enable = true;
root_folder_label = false; # inconsistent
icons = {
modified_placement = "after";
git_placement = "after";
show.git = true;
show.modified = true;
};
};
diagnostics.enable = true;
modified = {
enable = true;
show_on_dirs = false;
show_on_open_dirs = true;
};
actions = {
change_dir.enable = false;
change_dir.global = false;
open_file.window_picker.enable = true;
};
};
};
};
};
}

View file

@ -0,0 +1,5 @@
_: {
programs.neovim-flake.settings.vim = {
gestures.gesture-nvim.enable = false;
};
}

View file

@ -0,0 +1,12 @@
_: {
programs.neovim-flake.settings.vim = {
git = {
enable = true;
vim-fugitive.enable = true;
gitsigns = {
enable = true;
codeActions.enable = false; # no.
};
};
};
}

View file

@ -0,0 +1,47 @@
_: {
programs.neovim-flake.settings.vim = {
languages = {
enableLSP = true;
enableFormat = true;
enableTreesitter = true;
enableExtraDiagnostics = true;
markdown.enable = true;
html.enable = true;
java.enable = true;
css.enable = true;
tailwind.enable = true;
ts.enable = true;
go.enable = true;
python.enable = true;
bash.enable = true;
typst.enable = false;
zig.enable = true;
dart.enable = false;
elixir.enable = false;
svelte.enable = false;
sql.enable = false;
lua = {
enable = true;
lsp.neodev.enable = true;
};
nix = {
enable = true;
lsp.enable = true;
};
rust = {
enable = true;
crates.enable = true;
};
clang = {
enable = true;
lsp = {
enable = true;
server = "clangd";
};
};
};
};
}

View file

@ -0,0 +1,15 @@
_: {
programs.neovim-flake.settings.vim = {
lsp = {
formatOnSave = true;
lspkind.enable = true;
lsplines.enable = true;
lightbulb.enable = false;
lspsaga.enable = false;
lspSignature.enable = true;
nvimCodeActionMenu.enable = true;
# trouble.enable = false;
# nvim-docs-view.enable = true;
};
};
}

View file

@ -0,0 +1,11 @@
{config, ...}: let
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = {
minimap = {
# cool for vanity but practically useless on small screens
minimap-vim.enable = false;
codewindow.enable = false;
};
};
}

View file

@ -0,0 +1,9 @@
_: {
programs.neovim-flake.settings.vim = {
notes = {
todo-comments.enable = true;
mind-nvim.enable = false;
obsidian.enable = false;
};
};
}

View file

@ -0,0 +1,9 @@
{config, ...}: let
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = {
notify = {
nvim-notify.enable = true;
};
};
}

View file

@ -0,0 +1,7 @@
{config, ...}: let
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = {
presence.neocord.enable = false;
};
}

View file

@ -0,0 +1,24 @@
{config, ...}: let
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = {
projects = {
project-nvim = {
enable = true;
setupOpts = {
manualMode = false;
detectionMethods = ["lsp" "pattern"];
patterns = [
".git"
".hg"
"Makefile"
"package.json"
"index.*"
".anchor"
"flake.nix"
];
};
};
};
};
}

View file

@ -0,0 +1,10 @@
{config, ...}: let
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = {
session.nvim-session-manager = {
enable = false;
setupOpts.autoload_mode = "Disabled"; # misbehaves with dashboard
};
};
}

View file

@ -0,0 +1,10 @@
_: {
programs.neovim-flake.settings.vim = {
statusline = {
lualine = {
enable = true;
theme = "catppuccin";
};
};
};
}

View file

@ -0,0 +1,7 @@
_: {
programs.neovim-flake.settings.vim = {
tabline = {
nvimBufferline.enable = true;
};
};
}

View file

@ -0,0 +1,5 @@
_: {
programs.neovim-flake.settings.vim = {
telescope.enable = true;
};
}

View file

@ -0,0 +1,6 @@
{config, ...}: let
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = {
};
}

View file

@ -0,0 +1,18 @@
_: {
programs.neovim-flake.settings.vim = {
terminal = {
toggleterm = {
enable = true;
mappings.open = "<C-t>";
setupOpts = {
direction = "tab";
lazygit = {
enable = true;
direction = "tab";
};
};
};
};
};
}

View file

@ -0,0 +1,10 @@
_: {
programs.neovim-flake.settings.vim = {
theme = {
enable = true;
name = "catppuccin";
style = "mocha";
transparent = true;
};
};
}

View file

@ -0,0 +1,20 @@
{
config,
pkgs,
...
}: let
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = {
treesitter = {
fold = true;
context.enable = false; # FIXME: currently broken, I do not know why.
# extra grammars that will be installed by Nix
grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
regex # for regexplainer
kdl # zellij configurations are in KDL, I want syntax highlighting
];
};
};
}

View file

@ -0,0 +1,34 @@
_: {
programs.neovim-flake.settings.vim = {
ui = {
noice.enable = true;
colorizer.enable = true;
modes-nvim.enable = false;
illuminate.enable = true;
breadcrumbs = {
enable = true;
source = "nvim-navic";
navbuddy.enable = false;
};
smartcolumn = {
enable = true;
setupOpts = {
columnAt.languages = {
markdown = [80];
nix = [150];
ruby = 110;
java = 120;
go = [130];
};
};
};
borders = {
enable = true;
globalStyle = "rounded";
};
};
};
}

View file

@ -0,0 +1,24 @@
{pkgs, ...}: {
programs.neovim-flake.settings.vim = {
utility = {
ccc.enable = true;
icon-picker.enable = true;
diffview-nvim.enable = true;
#
vim-wakatime = {
enable = true;
cli-package = pkgs.wakatime-cli;
};
motion = {
hop.enable = false;
leap.enable = false;
};
preview = {
glow.enable = true;
markdownPreview.enable = true;
};
};
};
}

View file

@ -0,0 +1,30 @@
_: {
programs.neovim-flake.settings.vim = {
visuals = {
enable = true;
nvimWebDevicons.enable = true;
scrollBar.enable = false;
smoothScroll.enable = false;
cellularAutomaton.enable = true;
highlight-undo.enable = true;
indentBlankline.enable = true;
cursorline = {
enable = true;
lineTimeout = 0;
};
fidget-nvim = {
enable = true;
setupOpts = {
notification.window = {
winblend = 0;
border = "none";
render_limit = 10;
};
};
};
};
};
}

View file

@ -0,0 +1,8 @@
-- luacheck: ignore
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
pattern = 'gitconfig*,.gitconfig*',
callback = function()
vim.bo.filetype = 'gitconfig'
end,
once = false,
})

View file

@ -0,0 +1,8 @@
-- luacheck: ignore
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
pattern = '*.graphql,*.graphqls,*.gql',
callback = function()
vim.bo.filetype = 'graphql'
end,
once = false,
})

View file

@ -0,0 +1,4 @@
-- luacheck: ignore
vim.filetype.add({
filename = { ['.envrc'] = 'bash' },
})

View file

@ -0,0 +1,2 @@
-- luacheck: ignore
vim.opt_local.textwidth = 80

View file

@ -0,0 +1,5 @@
-- luacheck: ignore
vim.opt_local.tabstop = 4
vim.opt_local.shiftwidth = 0
vim.opt_local.expandtab = false
vim.opt_local.list = false

View file

@ -0,0 +1,14 @@
vim.keymap.set('n', '<leader>jf', '<cmd>%!jq<cr>', { noremap = true, silent = true, desc = 'Format with jq' })
vim.keymap.set('n', '<leader>jm', '<cmd>%!jq -c<cr>', { noremap = true, silent = true, desc = 'Minify with jq' })
-- add comma to the end of the line on new line
vim.keymap.set('n', 'o', function()
local line = vim.api.nvim_get_current_line()
local should_add_comma = string.find(line, '[^,{[]$')
if should_add_comma then
return 'A,<cr>'
else
return 'o'
end
end, { buffer = true, expr = true })

View file

@ -0,0 +1,13 @@
-- luacheck: ignore
local opts = { noremap = true, silent = true, buffer = 0 }
local wincmd = vim.b.pager and 'q' or 'c'
vim.keymap.set('n', 'q', '<cmd>lclose<CR><C-W>' .. wincmd, opts)
vim.keymap.set('n', '<Leader>o', function()
-- TODO: can this be done in a floating window?
require('man').show_toc()
end, opts)
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '')
.. (vim.b.undo_ftplugin ~= nil and ' | ' or '')
.. 'sil! nunmap <buffer> <Leader>o'
.. ' | sil! nunmap <buffer> q'

View file

@ -0,0 +1,30 @@
-- luacheck: ignore
vim.opt_local.textwidth = 80
local CR = vim.api.nvim_replace_termcodes('<cr>', true, true, true)
local function toggle_checkbox()
local cursor = vim.api.nvim_win_get_cursor(0)
local lineno = cursor[1]
local line = vim.api.nvim_buf_get_lines(0, lineno - 1, lineno, false)[1] or ''
if string.find(line, '%[ %]') then
line = line:gsub('%[ %]', '%[x%]')
else
line = line:gsub('%[x%]', '%[ %]')
end
vim.api.nvim_buf_set_lines(0, lineno - 1, lineno, false, { line })
vim.api.nvim_win_set_cursor(0, cursor)
pcall(vim.fn['repeat#set'], ':ToggleCheckbox' .. CR)
end
vim.api.nvim_create_user_command(
'ToggleCheckbox',
toggle_checkbox,
vim.tbl_extend('force', { desc = 'toggle checkboxes' }, {})
)
vim.keymap.set('n', '<leader>op', toggle_checkbox, {
noremap = true,
silent = true,
desc = 'Toggle checkbox',
buffer = 0,
})

View file

@ -0,0 +1,2 @@
-- luacheck: ignore
vim.wo.wrap = true

View file

@ -0,0 +1,2 @@
-- luacheck: ignore
vim.opt_local.shiftwidth = 2

View file

@ -0,0 +1,30 @@
; extends
; inject sql into any const string with word query in the name
; e.g. const query = `SELECT * FROM users WHERE name = 'John'`;
(const_spec
name: (identifier) @_name (#match? @_name "[Qq]uery")
value: (expression_list
(raw_string_literal) @injection.content)
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "sql"))
; inject sql in single line strings
(call_expression
(selector_expression
field: (field_identifier) @_field (#any-of? @_field "GetContext" "Get" "ExecContext" "Exec" "SelectContext" "Select" "In" "Rebind"))
(argument_list
(raw_string_literal) @injection.content)
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "sql")
)
; inject sql in multi line strings
(call_expression
(selector_expression
field: (field_identifier) @_field (#any-of? @_field "GetContext" "Get" "ExecContext" "Exec" "SelectContext" "Select" "In" "Rebind"))
(argument_list
(interpreted_string_literal) @injection.content)
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "sql")
)

View file

@ -0,0 +1,2 @@
;; extends
(( jsx_text ) @injection.content (#set! injection.language "markdown") )

View file

@ -0,0 +1,5 @@
;extends
(fenced_code_block (code_fence_content) @class.inner) @class.outer
(paragraph) @function.outer @function.inner

View file

@ -0,0 +1,12 @@
;extends
[
(shortcut_link)
] @nospell
(strikethrough
(emphasis_delimiter)
(strikethrough
(emphasis_delimiter)
(emphasis_delimiter))
(emphasis_delimiter))@markup.doublestrikethrough

View file

@ -0,0 +1,9 @@
((jsx_section)
@injection.content
(#set! injection.language "tsx")
(#set! injection.include-children))
((markdown_section)
@injection.content
(#set! injection.language "markdown")
(#set! injection.combined))

View file

@ -0,0 +1,14 @@
;extends
(macro_invocation
(scoped_identifier
path: (identifier) @path (#eq? @path "sqlx")
name: (identifier) @name (#match? @name "^query.*")
)
(token_tree
(raw_string_literal) @injection.content
(#set! injection.language "sql")
(#set! injection.include-children)
)
(#offset! @injection.content 0 3 0 -2)
)

View file

@ -0,0 +1,5 @@
;; extends
((ident) @constant
(#eq? @constant "lambda")
(#set! conceal "λ")
)

View file

@ -0,0 +1,42 @@
contrib
Contrib
gitignore
dotfiles
nyx
notashelf
utils
neovim
glab
gh
ripgrep
wip
thoughtbot
kubectl
CoC
config
Capybara
mailserver
Mailserver
anyrun
ags
spicetify
Spicetify
firefox
Firefox
Hyprland
Hyprwm
Xorg
X11
devShell
devshell
nixos
NixOS
nixpkgs
Nixpkgs
filetree
sourcetree
url
uri

View file

@ -0,0 +1,95 @@
# Credits to raf aka Notashelf, link to his repo is in the README.md
{
config,
lib,
pkgs,
inputs,
...
}: let
inherit (builtins) filter map toString;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix fileContents;
inherit (lib.attrsets) genAttrs;
inherit (lib) mkIf;
cfg = config.modules.system.programs.editors.neovim;
nvf = inputs.neovim-flake;
inherit (nvf.lib.nvim.dag) entryBefore;
in {
config = mkIf cfg.enable {
programs.neovim-flake = {
enable = true;
defaultEditor = true;
enableManpages = true;
settings = {
vim = {
# use neovim-unwrapped from nixpkgs
# alternatively, neovim-nightly from the neovim-nightly overlay
# via inputs.neovim-nightly.packages.${pkgs.stdenv.system}.neovim
package = pkgs.neovim-unwrapped;
viAlias = true;
vimAlias = true;
withNodeJs = false;
withPython3 = false;
withRuby = false;
preventJunkFiles = true;
useSystemClipboard = true;
tabWidth = 4;
autoIndent = true;
spellcheck = {
enable = true;
languages = ["en" "de"];
};
enableLuaLoader = true;
enableEditorconfig = true;
debugMode = {
enable = false;
logFile = "/tmp/nvim.log";
};
additionalRuntimePaths = [
#(mkRuntimeDir "after")
#(mkRuntimeDir "spell")
./runtime
./runtime
];
# while I should be doing this in luaConfigRC below
# I have come to realise that spellfile contents are
# actually **not** loaded when luaConfigRC is used.
# as spellfile is a vim thing, this should be fine
# configRC.spellfile = entryAnywhere ''
# set spellfile=${toString ./runtime/spell/en.utf-8.add} " toString sanitizes the path
# '';
# additional lua configuration that I can append
# or, to be more precise, randomly inject into
# the lua configuration of my Neovim configuration
# wrapper. This is recursively read from the lua
# directory, so we do not need to use require
luaConfigRC = let
# get the name of each lua file in the lua directory, where setting files reside
# and import them recursively
configPaths = filter (hasSuffix ".lua") (map toString (listFilesRecursive ./lua));
# generates a key-value pair that looks roughly as follows:
# `<filePath> = entryAnywhere ''<contents of filePath>''`
# which is expected by neovim-flake's modified DAG library
luaConfig = genAttrs configPaths (file:
entryBefore ["luaScript"] ''
${fileContents "${file}"}
'');
in
luaConfig;
};
};
};
};
}

View file

@ -0,0 +1,13 @@
_: {
imports = [
./vesktop.nix
./foot.nix
./mpv.nix
./zathura.nix
./spicetify.nix
./steam.nix
./waybar.nix
./schizofox.nix
./minecraft.nix
];
}

View file

@ -0,0 +1,88 @@
{
config,
inputs',
lib,
pkgs,
...
}: let
cfg = config.modules.system.programs.terminals.foot;
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
home.sessionVariables.TERM = "foot";
programs.foot = {
enable = true;
package = inputs'.nixpkgs-wayland.packages.foot;
settings = {
main = {
term = "foot";
app-id = "foot";
title = "foot";
locked-title = "no";
# line-height = 20;
letter-spacing = 0;
horizontal-letter-offset = 0;
vertical-letter-offset = -0.75;
box-drawings-uses-font-glyphs = "no";
dpi-aware = "no";
initial-window-size-chars = "104x36";
initial-window-mode = "windowed";
pad = "5x5 center";
resize-delay-ms = 100;
bold-text-in-bright = "no";
word-delimiters = '',`|:"'()[]{}<>'';
selection-target = "primary";
};
desktop-notifications.command = "${pkgs.libnotify}/bin/notify-send -a \${app-id} -i \${app-id} \${title} \${body}";
bell = {
urgent = "yes";
notify = "yes";
command = "${pkgs.libnotify}/bin/notify-send bell";
command-focused = "no";
};
scrollback = {
lines = 100000;
multiplier = 10.0;
indicator-position = "relative";
indicator-format = "line";
};
url = {
launch = "${pkgs.xdg-utils}/bin/xdg-open \${url}";
label-letters = "sadfjklewcmpgh";
osc8-underline = "always";
protocols = "http, https, ftp, ftps, file, gemini, gopher, irc, ircs";
uri-characters = ''
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[]'';
};
cursor = {
style = "beam";
blink = "true";
};
mouse = {
hide-when-typing = "yes"; # not really needed since we already enable this in Hyprland
alternate-scroll-mode = "yes";
};
csd = {preferred = "server";};
key-bindings = {
show-urls-launch = "Control+Shift+u";
unicode-input = "Control+Shift+i";
};
};
};
};
};
}

View file

@ -0,0 +1,22 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
inherit (config.modules.other.system) username;
cfg = config.modules.programs.minecraft;
in {
options.modules.programs.minecraft = {
enable = mkEnableOption "minecraft";
wayland = mkEnableOption "wayland";
};
config = mkIf cfg.enable {
home-manager.users.${username} = {
# Install minecraft
home.packages = with pkgs; [prismlauncher];
};
};
}

View file

@ -0,0 +1,26 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.modules.usrEnv.programs.media.mpv;
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.mpv = {
enable = true;
config = {
hwdec = "auto";
volume = 50;
osc = "no";
osd-bar = "no";
border = "no";
};
scripts = with pkgs.mpvScripts; [mpris thumbfast sponsorblock uosc];
};
};
};
}

View file

@ -0,0 +1,193 @@
{
config,
inputs,
lib,
...
}: let
cfg = config.modules.system.programs.firefox;
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
inherit (builtins) listToAttrs;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
imports = [inputs.schizofox.homeManagerModule];
programs.schizofox = {
enable = true;
theme = {
colors = {
background-darker = "000000";
background = "000000";
foreground = "f7f7f7";
};
font = "Lexend";
extraUserChrome = ''
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
/*
* Hide tab bar, navigation bar and scrollbars
* !important may be added to force override, but not necessary
* #content is not necessary to hide scroll bars
*/
#TabsToolbar {visibility: collapse;}
'';
};
search = {
defaultSearchEngine = "DuckDuckGo";
removeEngines = ["Google" "Bing" "Amazon.com" "eBay" "Twitter" "Wikipedia"];
addEngines = [
{
Name = "NixOS Packages";
Description = "NixOS Unstable package search";
Alias = "!np";
Method = "GET";
URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}";
}
{
Name = "NixOS Options";
Description = "NixOS Unstable option search";
Alias = "!no";
Method = "GET";
URLTemplate = "https://search.nixos.org/options?channel=unstable&query={searchTerms}";
}
{
Name = "NixOS Wiki";
Description = "NixOS Wiki search";
Alias = "!nw";
Method = "GET";
URLTemplate = "https://nixos.wiki/index.php?search={searchTerms}";
}
{
Name = "Home Manager Options";
Description = "Home Manager option search";
Alias = "!hm";
Method = "GET";
URLTemplate = "https://home-manager-options.extranix.com/?query={searchTerms}&release=master";
}
{
Name = "Arch Wiki";
Description = "Arch Wiki search";
Alias = "!aw";
Method = "GET";
URLTemplate = "https://wiki.archlinux.org/index.php?search={searchTerms}";
}
{
Name = "Gentoo Wiki";
Description = "Gentoo Wiki search";
Alias = "!gw";
Method = "GET";
URLTemplate = "https://wiki.gentoo.org/index.php?search={searchTerms}";
}
{
Name = "Debian Wiki";
Description = "Debian Wiki search";
Alias = "!dw";
Method = "GET";
URLTemplate = "https://wiki.debian.org/FrontPage?action=fullsearch&value={searchTerms}";
}
{
Name = "noogle";
Descriptiom = "Noogle Search";
Alias = "!ng";
Method = "GET";
URLTemplate = "https://noogle.dev/";
}
];
};
extensions = {
simplefox.enable = true;
darkreader.enable = true;
enableExtraExtensions = true;
enableDefaultExtensions = true;
extraExtensions = let
extensions = [
{
id = "{c2c003ee-bd69-42a2-b0e9-6f34222cb046}";
name = "auto-tab-discard";
}
{
id = "{74145f27-f039-47ce-a470-a662b129930a}";
name = "clearurls";
}
{
id = "DontFuckWithPaste@raim.ist";
name = "dont-fuck-with-paste";
}
{
id = "{96ef5869-e3ba-4d21-b86e-21b163096400}";
name = "font-fingerprint-defender";
}
{
id = "uBlock0@raymondhill.net";
name = "uBlock Origin";
}
{
id = "{d7742d87-e61d-4b78-b8a1-b469842139fa}";
name = "vimium-ff";
}
{
id = "{a4c4eda4-fb84-4a84-b4a1-f7c1cbf2a1ad}";
name = "refined-github-";
}
{
id = "sponsorBlocker@ajay.app";
name = "sponsorblock";
}
{
id = "treestyletab@piro.sakura.ne.jp";
name = "Tree Style Tab";
}
];
# shamelessly stolen from raf, thanks.
mappedExtensions =
map (extension: {
name = extension.id;
value = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/${extension.name}/latest.xpi";
};
})
extensions;
in
listToAttrs mappedExtensions;
};
security = {
sanitizeOnShutdown = false;
sandbox = false;
noSessionRestore = false;
userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0";
};
misc = {
drm.enable = true;
contextMenu.enable = true;
};
# taken from diniamo
settings = {
"gfx.webrender.all" = true;
"media.ffmpeg.vaapi.enabled" = true;
"media.rdd-ffmpeg.enabled" = true;
"media.av1.enabled" = true;
"gfx.x11-egl.force-enabled" = true;
"widget.dmabuf.force-enabled" = true;
"layers.acceleration.force-enabled" = true;
"browser.startup.page" = 3;
"browser.ctrlTab.sortByRecentlyUsed" = true;
# This makes websites prefer a dark theme (in theory)
"layout.css.prefers-color-scheme.content-override" = 0;
};
};
};
};
}

View file

@ -0,0 +1,31 @@
{
config,
pkgs,
lib,
inputs,
inputs',
...
}: let
cfg = config.modules.system.programs.spotify;
inherit (config.modules.other.system) username;
spicePkgs = inputs'.spicetify-nix.legacyPackages;
in {
config = lib.mkIf cfg.enable {
home-manager.users.${username} = {
imports = [inputs.spicetify-nix.homeManagerModules.default];
programs.spicetify = {
enable = true;
spotifyPackage = pkgs.spotify;
theme = spicePkgs.themes.catppuccin;
colorScheme = "mocha";
enabledExtensions = with spicePkgs.extensions; [
# shuffle
# popupLyrics
adblock
# betterGenres
# playlistIcons
];
};
};
};
}

View file

@ -0,0 +1,20 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.system.programs.steam;
in {
config = mkIf cfg.enable {
programs.steam = {
enable = true;
gamescopeSession.enable = true;
extraCompatPackages = with pkgs; [proton-ge-bin];
};
# See
# https://wiki.nixos.org/wiki/GameMode
programs.gamemode.enable = true;
};
}

View file

@ -0,0 +1,372 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.system.programs.discord;
inherit (config.modules.other.system) username;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
home.packages = with pkgs; [vesktop];
xdg.configFile."vesktop/settings.json".text = builtins.toJSON {
discordBranch = "ptb";
firstLaunch = false;
arRPC = "on";
splashColor = "rgb(219, 222, 225)";
splashBackground = "rgb(49, 51, 56)";
checkUpdates = false;
staticTitle = true;
disableMinSize = true;
minimizeToTray = false;
tray = false;
appBadge = false;
};
xdg.configFile."vesktop/settings/settings.json".text = builtins.toJSON {
notifyAboutUpdates = false;
autoUpdate = false;
autoUpdateNotification = false;
useQuickCss = true;
themeLinks = [
"https://github.com/Costeer/Gruvbox-Material-Themes/blob/main/Discord%20Theme/gruvboxmaterial.theme.css"
];
enabledThemes = ["gruvboxmaterial.theme.css"];
enableReactDevtools = true;
frameless = false;
transparent = false;
winCtrlQ = false;
macosTranslucency = false;
disableMinSize = true;
winNativeTitleBar = false;
plugins = {
BadgeAPI.enabled = true;
CommandsAPI.enabled = true;
ContextMenuAPI.enabled = true;
MemberListDecoratorsAPI.enabled = true;
MessageAccessoriesAPI.enabled = true;
MessageDecorationsAPI.enabled = true;
MessageEventsAPI.enabled = true;
MessagePopoverAPI.enabled = true;
NoticesAPI.enabled = true;
ServerListAPI.enabled = true;
SettingsStoreAPI.enabled = true;
NoTrack.enabled = true;
Settings = {
enabled = true;
settingsLocation = "aboveActivity";
};
AlwaysAnimate.enabled = false;
AlwaysTrust.enabled = false;
AnonymiseFileNames.enabled = false;
"WebRichPresence (arRPC)".enabled = false;
BANger.enabled = false;
BetterFolders = {
enabled = true;
sidebar = true;
sidebarAnim = true;
closeAllFolders = false;
closeAllHomeButton = false;
closeOthers = false;
forceOpen = false;
keepIcons = false;
showFolderIcon = 1;
};
BetterGifAltText.enabled = false;
BetterNotesBox.enabled = false;
BetterRoleDot.enabled = false;
BetterUploadButton.enabled = true;
BiggerStreamPreview.enabled = true;
BlurNSFW.enabled = false;
CallTimer = {
enabled = true;
format = "human";
};
ClearURLs.enabled = true;
ColorSighted.enabled = true;
ConsoleShortcuts.enabled = false;
CopyUserURLs.enabled = true;
CrashHandler.enabled = true;
CustomRPC.enabled = false;
Dearrow.enabled = true;
DisableDMCallIdle.enabled = true;
EmoteCloner.enabled = false;
Experiments = {
enabled = true;
enableIsStaff = false;
};
F8Break.enabled = false;
FakeNitro = {
enabled = true;
enableEmojiBypass = true;
emojiSize = 48;
transformEmojis = true;
enableStickerBypass = true;
stickerSize = 160;
transformStickers = true;
transformCompoundSentence = false;
enableStreamQualityBypass = true;
};
FakeProfileThemes = {
enabled = true;
nitroFirst = true;
};
FavoriteEmojiFirst.enabled = true;
FavoriteGifSearch = {
enabled = true;
searchOption = "hostandpath";
};
FixImagesQuality.enabled = true;
FixSpotifyEmbed = {
enabled = true;
volume = 10;
};
ForceOwnerCrown.enabled = true;
FriendInvites.enabled = false;
GameActivityToggle.enabled = true;
GifPaste.enabled = true;
HideAttachments.enabled = true;
iLoveSpam.enabled = true;
IgnoreActivities = {
enabled = true;
ignoredActivities = [];
};
ImageZoom = {
enabled = true;
saveZoomValues = true;
invertScroll = true;
nearestNeighbour = false;
square = false;
zoom = 2;
size = 100;
zoomSpeed = 0.5;
};
InvisibleChat = {
enabled = true;
savedPasswords = "password";
};
KeepCurrentChannel.enabled = true;
LastFMRichPresence.enabled = false;
LoadingQuotes.enabled = false;
MemberCount.enabled = true;
MessageClickActions = {
enabled = true;
enableDeleteOnClick = true;
enableDoubleClickToEdit = true;
enableDoubeClickToReply = true;
requireModifier = true;
};
MessageLinkEmbeds = {
enabled = true;
automodEmbeds = "never";
listMode = "blacklist";
idList = "";
};
MessageLogger = {
enabled = true;
deleteStyle = "text";
ignoreBots = false;
ignoreSelf = false;
ignoreUsers = "";
ignoreChannels = "";
ignoreGuilds = "";
};
MessageTags.enabled = false;
MoreCommands.enabled = true;
MoreKaomoji.enabled = true;
MoreUserTags.enabled = true;
Moyai.enabled = false;
MuteNewGuild = {
enabled = true;
guild = false;
everyone = true;
role = true;
};
MutualGroupDMs.enabled = true;
NoBlockedMessages = {
enabled = false;
ignoreBlockedMessages = false;
};
NoDevtoolsWarning.enabled = false;
NoF1.enabled = false;
NoPendingCount.enabled = false;
NoProfileThemes.enabled = true;
NoReplyMention = {
enabled = true;
userList = "372809091208445953";
shouldPingListed = false;
inverseShiftReply = true;
};
NoScreensharePreview.enabled = true;
NoTypingAnimation = true;
NoUnblockToJump.enabled = true;
NSFWGateBypass.enabled = true;
oneko.enabled = false;
OpenInApp.enabled = false;
"Party mode 🎉".enabled = false;
PermissionFreeWill = {
enabled = true;
lockout = true;
onboarding = true;
};
PermissionsViewer = {
enabled = true;
permissionsSortOrder = 0;
defaultPermissionsDropdownState = false;
};
petpet.enabled = true;
PictureInPicture = {
enabled = true;
loop = false;
};
PinDMs.enabled = true;
PlainFolderIcon.enabled = false;
PlatformIndicators = {
enabled = true;
list = true;
badges = true;
messages = true;
colorMobileIndicator = true;
};
PreviewMessage.enabled = true;
PronounDB.enabled = false;
QuickMention.enabled = false;
QuickReply.enabled = false;
ReactErrorDecoder.enabled = false;
ReadAllNotificationsButton.enabled = false;
RelationshipNotifier = {
enabled = true;
notices = true;
offlineRemovals = true;
friends = true;
friendRequestCancels = true;
servers = true;
groups = true;
};
RevealAllSpoilers.enabled = true;
ReverseImageSearch.enabled = false;
ReviewDB.enabled = false;
RoleColorEverywhere = {
enabled = true;
chatMentions = true;
memberList = true;
voiceUsers = true;
};
SearchReply.enabled = true;
SendTimestamps.enabled = false;
ServerListIndicators = {
enabled = true;
mode = 3;
};
ServerProfile.enabled = true;
ShikiCodeblocks = {
enabled = true;
theme = "https://raw.githubusercontent.com/shikijs/shiki/0b28ad8ccfbf2615f2d9d38ea8255416b8ac3043/packages/shiki/themes/dark-plus.json";
tryHljs = "SECONDARY";
uesDevIcon = "GREYSCALE";
};
ShowAllMessageButtons.enabled = true;
ShowConnections = {
enabled = true;
iconSize = 32;
iconSpacing = 1;
};
ShowHiddenChannels = {
enabled = true;
hideUnreads = true;
showMode = 0;
defaultAllowedUsersAndRolesDropdownState = true;
};
ShowMeYourName.enabled = false;
ShowTimeouts.enabled = true;
SilentMessageToggle = {
enabled = true;
persistState = false;
autoDisable = true;
};
SilentTyping = {
enabled = true;
showIcon = false;
isEnabled = true;
};
SortFriendRequests.enabled = false;
SpotifyControls.enabled = false;
SpotifyCrack.enabled = false;
SpotifyShareCommands.enabled = false;
StartupTimings.enabled = false;
SupportHelper.enabled = true;
TextReplace.enabled = false;
TimeBarAllActivities.enabled = false;
Translate.enabled = false;
TypingIndicator = {
enabled = true;
includeMutedChannels = false;
includeBlockedUsers = true;
};
TypingTweaks = {
enabled = true;
showAvatars = true;
showRoleColors = true;
alternativeFormatting = true;
};
Unindent.enabled = true;
UnsuppressEmbeds.enabled = true;
UrbanDictionary.enabled = false;
UserVoiceShow = {
enabled = true;
showInUserProfileModal = true;
showVoiceChannelSectionHeader = true;
};
USRBG.enabled = false;
UwUifier.enabled = false;
ValidUser.enabled = false;
VoiceChatDoubleClick.enabled = true;
VcNarrator.enabled = false;
VencordToolbox.enabled = false;
ViewIcons = {
enabled = true;
format = "png";
imgSize = "2048";
};
ViewRaw = {
enabled = true;
clickMethod = "Left";
};
VoiceMessages = {
enabled = true;
noiseSuppression = true;
echoCancellation = true;
};
WebContextMenus = {
enabled = true;
addBack = true;
};
WebKeybinds.enabled = true;
GreetStickerPicker.enabled = false;
WhoReacted.enabled = true;
Wikisearch.enabled = false;
NormalizeMessageLinks.enabled = false;
"AI Noise Suppression" = {
enabled = true;
isEnabled = true;
};
SecretRingToneEnabler.enabled = false;
};
notifications = {
timeout = 5000;
position = "bottom-right";
useNative = "not-focused";
logLimit = 50;
};
cloud = {
authenticated = false;
url = "https://api.vencord.dev/";
settingsSync = false;
settingsSyncVersion = 1682768329526;
};
};
};
};
}

View file

@ -0,0 +1,46 @@
{pkgs, ...}: let
vivado-desktop-symbol = pkgs.makeDesktopItem {
name = "vivado2019.2";
desktopName = "Vivado";
exec = "${pkgs.nur.repos.Nick1296.vivado-2019-2}/bin/vivado";
};
in {
environment.systemPackages = [
# this propietary software is huge, but I need it for
# university
pkgs.nur.repos.Nick1296.vivado-2019-2
vivado-desktop-symbol
];
# Create udev rules. Reference: https://blog.kotatsu.dev/posts/2021-09-14-vivado-on-nixos/
services.udev.packages = [
(pkgs.writeTextFile {
name = "xilinx-dilligent-usb-udev";
destination = "/etc/udev/rules.d/52-xilinx-digilent-usb.rules";
text = ''
ATTR{idVendor}=="1443", MODE:="666"
ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Digilent", MODE:="666"
'';
})
(pkgs.writeTextFile {
name = "xilinx-pcusb-udev";
destination = "/etc/udev/rules.d/52-xilinx-pcusb.rules";
text = ''
ATTR{idVendor}=="03fd", ATTR{idProduct}=="0008", MODE="666"
ATTR{idVendor}=="03fd", ATTR{idProduct}=="0007", MODE="666"
ATTR{idVendor}=="03fd", ATTR{idProduct}=="0009", MODE="666"
ATTR{idVendor}=="03fd", ATTR{idProduct}=="000d", MODE="666"
ATTR{idVendor}=="03fd", ATTR{idProduct}=="000f", MODE="666"
ATTR{idVendor}=="03fd", ATTR{idProduct}=="0013", MODE="666"
ATTR{idVendor}=="03fd", ATTR{idProduct}=="0015", MODE="666"
'';
})
(pkgs.writeTextFile {
name = "xilinx-ftdi-usb-udev";
destination = "/etc/udev/rules.d/52-xilinx-ftdi-usb.rules";
text = ''
ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Xilinx", MODE:="666"
'';
})
];
}

View file

@ -0,0 +1,324 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.modules.programs.waybar;
inherit (config.modules.other.system) username;
in {
options.modules.programs.waybar.enable = lib.mkEnableOption "waybar";
config = lib.mkIf cfg.enable {
home-manager.users.${username} = {
programs.waybar = {
enable = true;
package = pkgs.waybar;
settings.mainBar = {
gtk-layer-shell = true;
layer = "top";
position = "bottom";
modules-left = ["tray" "mpd"];
modules-center = ["hyprland/workspaces"];
modules-right = [
"cpu"
"memory"
"pulseaudio"
"clock"
"backlight"
"battery"
];
pulseaudio = {
tooltip = false;
scroll-step = "1";
format = " {icon} {volume}%";
format-muted = " 󰸈 {volume}%";
format-icons = {default = ["󰕿" "󰖀" "󰕾"];};
on-click = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
};
"hyprland/workspaces" = {
sort-by-name = true;
sort-by-coordinates = false;
on-click = "activate";
#on-scroll = "~/Scripts/cycle_workspace.sh 1";
active-only = true;
format = "{icon}";
format-icons = {
"1" = "1";
"2" = "2";
"3" = "3";
"4" = "4";
"5" = "5";
"6" = "6";
"7" = "7";
"8" = "8";
"9" = "9";
"10" = "10";
"11" = "1";
"12" = "2";
"13" = "3";
"14" = "4";
"15" = "5";
"16" = "6";
"17" = "7";
"18" = "8";
"19" = "9";
"20" = "10";
"21" = "1";
"22" = "2";
"23" = "3";
"24" = "4";
"25" = "5";
"26" = "6";
"27" = "7";
"28" = "8";
"29" = "9";
"30" = "10";
};
};
tray = {
icon-size = 12;
spacing = 5;
};
# 󰃰
clock = {
interval = 1;
format = " {:%a %d %b %H:%M:%S}";
};
battery = {
interval = 10;
states = {
good = 75;
warning = 20;
critical = 10;
};
format = "{icon}{capacity}%";
format-charging = "󰚥{icon}{capacity}%";
format-discharging = "{icon}{capacity}%";
format-icons = ["󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
format-charging-icons = ["󰢟" "󰢜" "󰂆" "󰂇" "󰂈" "󰢝" "󰂉" "󰢞" "󰂊" "󰂋" "󰂅"];
};
cpu = {
interval = 1;
format = "󰻠 {}%";
max-length = 10;
};
memory = {
interval = 1;
format = "󰍛 {}%";
max-length = 10;
};
"hyprland/window" = {
format = "{}";
separate-outputs = true;
};
mpd = {
format = "󰝚 {artist} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})";
format-disconnected = "󰝚 Disconnected";
format-stopped = "󰝚 Stopped";
interval = 1;
tooltip-format = "MPD (connected)";
tooltip-format-disconnected = "MPD (disconnected)";
on-click = "mpc toggle";
};
};
style = ''
@define-color base #000000;
@define-color inactive #ab8f44;
@define-color active #1565c0;
@define-color text #ffffff;
* {
border-radius: 1px;
font-family: ComicShannsMono Nerd Font;
font-size: 16px;
}
window#waybar {
background-color: alpha(@base, 1.0);
border-radius: 0px;
}
window#waybar.hidden {
opacity: 0.2;
}
#window {
margin-top: 2px;
margin-bottom: 2px;
padding-left: 2px;
padding-right: 2px;
background: @base;
color: @text;
font-family: ComicShannsMono Nerd Font;
}
#workspaces {
padding-left: 5px;
}
#workspaces button {
border-radius: 0px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
margin-top: 2px;
margin-right: 2px;
margin-bottom: 2px;
margin-left: 2px;
background-color: @inactive;
color: @text;
min-width: 15px;
}
#workspaces button.active {
padding-top: 0px;
padding-bottom: 0px;
padding-right: 0px;
padding-left: 0px;
margin-top: 2px;
margin-right: 2px;
margin-bottom: 2px;
margin-left: 2px;
background-color: @active;
color: @base;
min-width: 15px;
}
#workspaces button.urgent {
background-color: @red;
}
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
.modules-right > widget:first-child > #workspaces {
margin-right: 0;
}
#pulseaudio {
margin-top: 2px;
margin-bottom: 2px;
margin-left: 2px;
margin-right: 2px;
padding-left: 0px;
padding-right: 0px;
transition: none;
background: @base;
color: @text;
}
#battery {
margin-top: 3px;
margin-bottom: 3px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
transition: none;
background: @base;
color: @text;
}
@keyframes blink {
to {
background-color: @red;
}
}
#battery.charging, #battery.plugged {
background-color: @base;
}
#battery.critical:not(.charging) {
background-color: @base;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#backlight {
margin-top: 3px;
margin-bottom: 3px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
transition: none;
background: @base;
color: @yellow;
}
#clock {
margin-top: 3px;
margin-bottom: 3px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
transition-property: min-width;
transition-duration: 0.5s;
background: @base;
color: @text;
}
#tray {
margin-top: 2px;
margin-bottom: 2px;
margin-left: 2px;
padding-left: 2px;
padding-right: 2px;
transition: none;
background: @base;
}
#custom-power {
font-size: 20px;
margin-top: 3px;
margin-bottom: 3px;
margin-left: 8px;
margin-right: 8px;
padding-left: 10px;
padding-right: 10px;
transition: none;
background: @base;
color: @red;
}
#custom-media {
margin-top: 3px;
margin-bottom: 3px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
transition: none;
background: @mantle;
}
#mpd {
margin-top: 3px;
margin-bottom: 3px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
transition: none;
background: @base;
color: @text;
}
'';
};
};
};
}

View file

@ -0,0 +1,28 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.system.programs.zathura;
inherit (config.modules.other.system) username;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.zathura = {
enable = true;
options = {
selection-clipboard = "clipboard";
adjust-open = "best-fit";
pages-per-row = "1";
scroll-page-aware = "true";
scroll-full-overlap = "0.01";
scroll-step = "100";
zoom-min = "10";
guioptions = "none";
};
};
};
};
}

View file

@ -0,0 +1,31 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.modules.programs.btop;
inherit (config.modules.other.system) username;
in {
options.modules.programs.btop.enable = mkEnableOption "btop";
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.btop = {
enable = true;
settings = {
theme_background = false;
vim_keys = true;
update_ms = 1000;
cpu_single_graph = true;
clock_format = "%X";
use_fstab = true;
io_mode = true;
net_sync = true;
net_iface = "enp4s0";
log_level = "WARNING";
};
};
};
};
}

View file

@ -0,0 +1,3 @@
_: {
imports = [./btop.nix ./newsboat.nix ./ncmpcpp.nix ./yazi.nix ./wtfutil.nix];
}

Some files were not shown because too many files have changed in this diff Show more