move to backup

This commit is contained in:
Dennis 2026-03-03 10:46:08 +01:00
parent 294dc66380
commit a0e3d792a9
182 changed files with 156 additions and 103 deletions

View file

@ -1,21 +0,0 @@
{
pkgs,
...
}:
{
systemd.services.actual = {
enable = true;
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
description = "user service for the actual budgeting server instance";
environment = {
ACTUAL_PORT = "9002";
};
serviceConfig = {
Type = "simple";
ExecStart = "/run/current-system/sw/bin/actual-server";
Restart = "on-failure";
RestartSec = 3;
};
};
}

View file

@ -1,115 +0,0 @@
{
services.aerospace = {
enable = true;
settings = {
accordion-padding = 25;
gaps = {
inner.horizontal = 6;
inner.vertical = 6;
outer.left = 6;
outer.bottom = 6;
outer.top = 6;
outer.right = 6;
};
workspace-to-monitor-force-assignment = {
"1" = "main";
"2" = "main";
"3" = "main";
"4" = "main";
"5" = "secondary";
"6" = "secondary";
};
mode.main.binding = {
alt-h = "focus left";
alt-j = "focus down";
alt-k = "focus up";
alt-l = "focus right";
alt-shift-h = "move left";
alt-shift-j = "move down";
alt-shift-k = "move up";
alt-shift-l = "move right";
alt-comma = "layout tiles horizontal vertical";
alt-period = "layout accordion horizontal vertical";
alt-f = "fullscreen";
alt-1 = "workspace 1";
alt-2 = "workspace 2";
alt-3 = "workspace 3";
alt-4 = "workspace 4";
alt-5 = "workspace 5";
alt-6 = "workspace 6";
alt-shift-1 = [
"move-node-to-workspace 1"
"workspace 1"
];
alt-shift-2 = [
"move-node-to-workspace 2"
"workspace 2"
];
alt-shift-3 = [
"move-node-to-workspace 3"
"workspace 3"
];
alt-shift-4 = [
"move-node-to-workspace 4"
"workspace 4"
];
alt-shift-5 = [
"move-node-to-workspace 5"
"workspace 5"
];
alt-shift-6 = [
"move-node-to-workspace 6"
"workspace 6"
];
alt-tab = "workspace-back-and-forth";
alt-shift-tab = "move-workspace-to-monitor --wrap-around next";
};
on-window-detected = [
{
"if".app-id = "app.zen-browser.zen";
run = "move-node-to-workspace 1";
}
{
"if".app-id = "company.thebrowser.Browser";
run = "move-node-to-workspace 1";
}
{
"if".app-id = "com.github.wez.wezterm";
run = "move-node-to-workspace 2";
}
{
"if".app-id = "com.mitchellh.ghostty";
run = "move-node-to-workspace 2";
}
{
"if".app-id = "com.apple.Preview";
run = "move-node-to-workspace 3";
}
{
"if".app-id = "com.apple.dt.Xcode";
run = "move-node-to-workspace 3";
}
{
"if".app-id = "com.postmanlabs.mac";
run = "move-node-to-workspace 3";
}
{
"if".app-id = "com.apple.iCal";
run = "move-node-to-workspace 4";
}
{
"if".app-id = "com.microsoft.teams2";
run = "move-node-to-workspace 5";
}
{
"if".app-id = "com.spotify.client";
run = "move-node-to-workspace 6";
}
{
"if".app-id = "com.apple.reminders";
run = "move-node-to-workspace 6";
}
];
};
};
}

View file

@ -1,11 +0,0 @@
{
programs.atuin = {
enable = true;
enableBashIntegration = false;
enableFishIntegration = false;
settings = {
style = "compact";
inline_height = 20;
};
};
}

View file

@ -1,98 +0,0 @@
{
config,
pkgs,
lib,
...
}:
let
# Declarative backrest config referencing the existing restic repo.
# The password is read at runtime from the agenix secret path via
# BACKREST_VAR_RESTIC_PASSWORD, which backrest expands as ${RESTIC_PASSWORD}
# inside the repo env block.
backrestConfig = builtins.toJSON {
version = 4;
modno = 1;
instance = "dnsc-server";
repos = [
{
id = "dnsc-storage";
uri = "sftp:dnsc-storage:restic/dnsc-server";
env = [ "RESTIC_PASSWORD_FILE=${config.age.secrets."restic/password".path}" ];
flags = [
"-o 'sftp.args=-i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new'"
];
autoInitialize = false;
guid = "15448172d015919712f015508d40e28d13db4c9e877bf545454c8289ad621069";
prunePolicy = {
schedule = {
disabled = true;
};
};
checkPolicy = {
schedule = {
disabled = true;
};
};
}
];
plans = [
{
id = "dnsc-storage-plan";
repo = "dnsc-storage";
paths = config.services.restic.backups."dnsc-storage".paths;
schedule = {
disabled = true;
};
retention = {
policyKeepLastN = 3;
};
}
];
auth = {
disabled = true;
};
};
in
{
environment.systemPackages = lib.mkAfter (
with pkgs;
[
backrest
]
);
# Write the declarative config into the backrest state dir at activation time.
# The file must be in a writable location because backrest creates a .bak
# alongside it when migrating. /var/lib/backrest is owned by the backrest user.
system.activationScripts.backrestConfig = {
deps = [ "users" ];
text = ''
install -d -m 750 /var/lib/backrest
install -m 640 \
${pkgs.writeText "backrest-config.json" backrestConfig} \
/var/lib/backrest/config.json
'';
};
systemd.services.backrest = {
enable = true;
description = "Restic GUI";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
environment = {
BACKREST_PORT = "9004";
BACKREST_RESTIC_COMMAND = "${pkgs.restic}/bin/restic";
BACKREST_CONFIG = "/var/lib/backrest/config.json";
BACKREST_DATA = "/var/lib/backrest/data";
};
serviceConfig = {
Type = "simple";
User = "root";
ExecStart = "${pkgs.backrest}/bin/backrest";
Restart = "on-failure";
RestartSec = "5s";
};
};
}

View file

@ -1,58 +0,0 @@
{
pkgs,
inputs,
...
}:
{
nix = {
channel.enable = false;
package = pkgs.nix;
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
settings = {
experimental-features = [
"nix-command"
"flakes"
];
};
};
nixpkgs = {
config = {
allowUnfree = true;
allowUnsupportedSystem = true;
};
};
environment.systemPackages = with pkgs; [
gcc
wget
git
btop
fish
ripgrep
fzf
fd
sd
bat
vim
just
tldr
fortune
ffmpeg
zoxide
sqlite
restic
imagemagick
sqlite
fortune
lazygit
tmux
tmuxinator
nix-prefetch
nix-prefetch-github
dua
opencode
vial
];
}

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
# Switch between Ripgrep launcher mode (CTRL-R) and fzf filtering mode (CTRL-F)
rm -f /tmp/rg-fzf-{r,f}
RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
INITIAL_QUERY="${*:-}"
fzf --ansi --disabled --query "$INITIAL_QUERY" \
--bind "start:reload($RG_PREFIX {q})+unbind(ctrl-r)" \
--bind "change:reload:sleep 0.1; $RG_PREFIX {q} || true" \
--bind "ctrl-f:unbind(change,ctrl-f)+change-prompt(2. fzf> )+enable-search+rebind(ctrl-r)+transform-query(echo {q} > /tmp/rg-fzf-r; cat /tmp/rg-fzf-f)" \
--bind "ctrl-r:unbind(ctrl-r)+change-prompt(1. ripgrep> )+disable-search+reload($RG_PREFIX {q} || true)+rebind(change,ctrl-f)+transform-query(echo {q} > /tmp/rg-fzf-f; cat /tmp/rg-fzf-r)" \
--color "hl:-1:underline,hl+:-1:underline:reverse" \
--prompt '1. ripgrep> ' \
--delimiter : \
--header ' CTRL-R (ripgrep mode) CTRL-F (fzf mode) ' \
--preview 'bat --color=always {1} --highlight-line {2}' \
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3' \
--bind 'enter:become(nvim {1} +{2})'

View file

@ -1,55 +0,0 @@
{
programs.bash = {
enable = true;
enableCompletion = true;
sessionVariables = {
GPG_TTY = "$(tty)";
PROMPT_DIRTRIM = 3;
GOPATH = "$HOME/go";
GOROOT = "$(brew --prefix golang)/libexec";
};
shellAliases = {
"ff" = "${./bin/ff.sh}";
"ipl" = "ifconfig | grep \"inet \" | grep -v 127.0.0.1 | awk '{print $2}' | head -n 1";
"ipp" = "curl -4 ifconfig.me";
"lg" = "lazygit";
"g" = "git";
"xsrc" = "source ~/.bashrc && source .bash_profile";
"ll" = "ls -l";
"la" = "ls -la";
};
profileExtra = ''
export PATH=\
$GOPATH/bin:\
$GOROOT/bin:\
/run/current-system/sw/bin:\
/opt/homebrew/bin:$PATH
'';
bashrcExtra = ''
# FNM
eval "$(fnm env --use-on-cd --shell bash)"
# emacs-libvterm
if [[ "$INSIDE_EMACS" = 'vterm' ]] \
&& [[ -n "$EMACS_VTERM_PATH" ]] \
&& [[ -f "$EMACS_VTERM_PATH/etc/emacs-vterm-bash.sh" ]]; then
source "$EMACS_VTERM_PATH/etc/emacs-vterm-bash.sh"
fi
'';
initExtra = ''
if [ "$TERM" == "dumb" ]; then
PS1="[\u@\h:\w]\\$ "
else
source ~/.git-prompt.sh
PROMPT_COMMAND='PS1_CMD1=$(__git_ps1 "(%s)")';
PS1="\[\e[95m\]\u\[\e[35m\]@\h\[\e[0m\] \[\e[96m\]\w\[\e[0m\] \[\e[95m\]$PS1_CMD1\n\[\e[96m\]λ\[\e[0m\] "
fi
'';
};
}

View file

@ -1,15 +0,0 @@
{
services.cockpit = {
enable = true;
openFirewall = true;
allowed-origins = [
"http://192.168.178.69:9090"
"wss://192.168.178.69:9090"
];
settings = {
WebService = {
AllowUnencrypted = true;
};
};
};
}

View file

@ -1,6 +0,0 @@
{
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}

View file

@ -1,11 +0,0 @@
{
virtualisation.docker = {
enable = true;
rootless = {
enable = true;
setSocketVariable = true;
};
};
users.users.dennis.extraGroups = [ "docker" ];
}

View file

@ -1,162 +0,0 @@
{ inputs, pkgs, ... }:
{
programs.firefox = {
enable = true;
nativeMessagingHosts = [ pkgs.firefoxpwa ];
languagePacks = [
"en-US"
"de"
];
policies = {
DisableTelemetry = true;
DisableFirefoxStudies = true;
DisablePocket = true;
DisableFirefoxScreenshots = true;
DisableForgetButton = true;
DisableMasterPasswordCreation = true;
DisableProfileImport = true;
DisableProfileRefresh = true;
DisableSetDesktopBackground = true;
DisplayBookmarksToolbar = "never";
DisplayMenuBar = "default-off";
SearchBar = "unified";
OfferToSaveLogins = false;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
DefaultDownloadDirectory = "\${home}/Downloads";
};
profiles = {
"dennis" = {
id = 0;
isDefault = true;
containersForce = true;
containers = {
default = {
name = "personal";
color = "turquoise";
icon = "chill";
id = 1;
};
};
extensions.force = true;
extensions.packages = with inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system}; [
ublock-origin
dearrow
bitwarden
sponsorblock
vimium
];
search = {
default = "google";
force = true;
engines = {
bing.metaData.hidden = true;
perplexity.metaData.hidden = true;
wikipedia.metaData.hidden = true;
ddg.metaData.hidden = true;
nix-packages = {
name = "Nix Packages";
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
nix-options = {
name = "Nix Options";
urls = [
{
template = "https://search.nixos.org/options";
params = [
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
nix-home-manager = {
name = "Nix Home Manager";
urls = [
{
template = "https://home-manager-options.extranix.com";
params = [
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nh" ];
};
nix-wiki = {
name = "Nix Wiki";
urls = [
{
template = "https://wiki.nixos.org/w/index.php";
params = [
{
name = "search";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nw" ];
};
};
};
settings = {
"browser.startup.homepage" = "https://home.dnsc.io";
"browser.newtabpage.pinned" = [
{
title = "[dnsc] Home";
url = "https://home.dnsc.io";
}
];
"browser.search.region" = "DE";
"general.useragent.locale" = "en-US";
"layout.css.prefers-color-scheme.content-override" = 0;
};
};
};
};
}

View file

@ -1,240 +0,0 @@
{ ... }:
{
programs.fish = {
enable = true;
functions = {
ff = "bash ${./ff.bash}";
fish_greeting = "fortune -a";
localip = "ifconfig | grep \"inet \" | grep -v 127.0.0.1 | awk '{print $2}' | head -n 1";
publicip = "curl -4 ifconfig.me";
enter_vps = "ssh dnsc-vps-sm -t tmux new -As main";
rebuild_vps = "ssh -t dnsc-vps-sm 'cd ~/nix-config && git pull && sudo just deploy'";
enter_server = "ssh dnsc-server -t tmux new -As main";
rebuild_server = "ssh -t dnsc-server 'cd ~/nix-config && git pull && sudo just deploy'";
kill_tunnels = /* fish */ ''
ps -o pid,command | grep "^[0-9]\{4,5\} ssh -fNL" | awk '{print $1}' | xargs kill -9
'';
dbui = ''
uvx --with PyMySQL --with sqlit-tui[ssh] --from sqlit-tui@1.2.11 sqlit
'';
dev_projects = /* fish */ ''
if test "$hn" = "dnsc-work"
begin
fd . ~/dev/ride/apps/backend/edge-services -t d -d 1;
fd . ~/dev/ride/apps/backend/backend-services -t d -d 1;
fd . ~/dev/ride/apps/frontend/projects -t d -d 1;
fd . ~/dev/ride/apps/native -t d -d 1;
fd . ~/dev/ride/packages -t d -d 1;
fd . ~/dev -t d -d 1;
echo "$HOME/dev/ride/apps/frontend";
echo "$HOME/dev/ride/apps/lib";
echo "$HOME/dev/ride/apps/packages";
end
else
begin
echo "$HOME/notes"
fd . ~/dev -t d -d 1
end
end
'';
cdd = /* fish */ ''
set folder (dev_projects | fzf)
cd $folder
'';
cdr = /* fish */ ''
set folder (dev_projects | fzf)
cd $folder
if test -n "$folder"
set service (basename $folder)
cd $folder
if test -f "package.json"
set script_cmd (jq -r '.scripts | to_entries | .[] | "\(.key): \(.value)"' package.json | fzf)
if test -n "$script_cmd"
set script_name (string split ": " $script_cmd)[1]
if test -n "$script_name"
echo "Running: npm run $script_name"
npm run $script_name
end
end
end
end
'';
sessionizer = /* fish */ ''
set -l selected (tmuxinator ls -n | tail -n +2 | fzf --prompt " switch to >> ")
if test -z "$selected"
return 1
end
tmuxinator start "$selected"
'';
tmux_sessionizer = /* fish */ ''
tmux display-popup -h 50% -w 80% -E sessionizer
'';
nn = /* fish */ ''
# Require a title argument
if test (count $argv) -lt 1
echo "Usage: nn \"My Note\""
return 1
end
# Join all arguments into single title (preserves spaces inside quotes)
set -l title $argv[1]
# Timestamp up to minutes, format: YYYY-MM-DD_HH-MM
set -l ts (date "+%Y%m%d%H%M")
# Normalize title: lowercase, replace spaces with hyphens, remove/replace
# characters unsafe for filenames (keep a-z0-9- and replace others with -)
set -l slug (string lower -- $title)
# Replace any sequence of non-alphanumeric characters with single hyphen
set -l slug (echo $slug | sed -E 's/[^a-z0-9]+/-/g' | sed -E 's/^-|-$//g')
# Compose filename
set -l filename "$ts"_"$slug.md"
# Directory for notes (change if you prefer another path)
set -l notes_dir ~/dev/notes
# Ensure directory exists
test -d $notes_dir; or mkdir -p $notes_dir
# Full path
set -l fullpath "$notes_dir/$filename"
# If file doesn't exist, create with timestamp and title at top
if not test -f $fullpath
# Human-friendly timestamp line (no seconds)
set -l display_ts (date "+%Y-%m-%d %H:%M")
printf "---\nCREATED_AT: %s\n---\n\n# %s\n\n" "$display_ts" "$title" > $fullpath
end
# Open file in neovim
nvim $fullpath
'';
fish_mode_prompt = /* fish */ ''
switch $fish_bind_mode
case default
set_color --bold brcyan
echo '[N] '
case insert
set_color --bold brgreen
echo '[I] '
case replace_one
set_color --bold yellow
echo '[R] '
case replace
set_color --bold bryellow
echo '[R] '
case visual
set_color --bold brmagenta
echo '[V] '
case '*'
set_color --bold red
echo '[?] '
end
set_color normal
'';
setup_winterly_theme_colors = /* fish */ ''
set --universal fish_color_autosuggestion brblack # autosuggestions
set --universal fish_color_command brwhite # commands
set --universal fish_color_comment brblack # code comments
set --universal fish_color_cwd brblack # current working directory in the default prompt
set --universal fish_color_end brblack # process separators like ';' and '&'
set --universal fish_color_error brwhite # highlight potential errors
set --universal fish_color_escape brblack # highlight character escapes like '\n' and '\x70'
set --universal fish_color_match yellow # highlight matching parenthesis
set --universal fish_color_normal brwhite # default color
set --universal fish_color_operator brblack # parameter expansion operators like '*' and '~'
set --universal fish_color_param bryellow # regular command parameters
set --universal fish_color_quote brmagenta # quoted blocks of text
set --universal fish_color_redirection brwhite # IO redirections
set --universal fish_color_search --bold --background=black --foreground=bryellow
set --universal fish_color_search_match --background black # highlight history search matches and the selected pager item (must be a background)
set --universal fish_pager_color_selected_background --background black --foreground brmagenta
set --universal fish_pager_color_progress --foreground=brwhite --background=black
set --universal fish_color_selection --background magenta # when selecting text (in vi visual mode)
set --universal fish_color_cancel brblack # the '^C' indicator on a canceled command
set --universal fish_color_host brwhite # current host system in some of fish default prompts
set --universal fish_color_host_remote yellow #ayu:syntax.constant current host system in some of fish default prompts, if fish is running remotely (via ssh or similar)
set --universal fish_color_user brwhite # current username in some of fish default prompts
'';
setup_homebrew = /* fish */ ''
fish_add_path /opt/homebrew/bin
if test -d (brew --prefix)"/share/fish/completions"
set -p fish_complete_path (brew --prefix)/share/fish/completions
end
if test -d (brew --prefix)"/share/fish/vendor_completions.d"
set -p fish_complete_path (brew --prefix)/share/fish/vendor_completions.d
end
'';
setup_path = /* fish */ ''
fish_add_path /run/wrappers/bin
fish_add_path /run/current-system/sw/bin
fish_add_path $HOME/.nix-profile/bin
if test "$(uname)" = "Darwin"
fish_add_path /nix/var/nix/profiles/default/bin
setup_homebrew
end
'';
setup_env = /* fish */ ''
for line in (cat $HOME/.env | grep -v '^#')
set item (string split -m 1 '=' $line)
set -gx $item[1] $item[2]
end
'';
setup_work = /* fish */ ''
fish_add_path $ANDROID_HOME/emulator
fish_add_path $ANDROID_HOME/platform-tools
fish_add_path $HOME/.local/share/uv/tools
rbenv init - | source
fnm env --use-on-cd --shell fish | source
'';
};
interactiveShellInit = /* fish */ ''
# Set some global values
set -x GPG_TTY (tty)
set hn (prompt_hostname)
fish_vi_key_bindings insert
fish_vi_cursor xterm
setup_winterly_theme_colors
setup_env
setup_path
if test "$hn" = "dnsc-work"
setup_work
end
# Custom init
direnv hook fish | source
# Auto start tmux
if status is-interactive; and not set -q TMUX
if tmux list-sessions >/dev/null 2>&1
# Attach to the first available session
tmux a
else
# Create a new session
tmux new-session -t main
end
end
'';
shellAbbrs = {
lg = "lazygit";
gg = "lazygit";
g = "git";
frc = "source ~/.config/fish/**/*.fish";
};
};
}

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
# Switch between Ripgrep launcher mode (CTRL-R) and fzf filtering mode (CTRL-F)
rm -f /tmp/rg-fzf-{r,f}
RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
INITIAL_QUERY="${*:-}"
fzf --ansi --disabled --query "$INITIAL_QUERY" \
--bind "start:reload($RG_PREFIX {q})+unbind(ctrl-r)" \
--bind "change:reload:sleep 0.1; $RG_PREFIX {q} || true" \
--bind "ctrl-f:unbind(change,ctrl-f)+change-prompt(2. fzf> )+enable-search+rebind(ctrl-r)+transform-query(echo {q} > /tmp/rg-fzf-r; cat /tmp/rg-fzf-f)" \
--bind "ctrl-r:unbind(ctrl-r)+change-prompt(1. ripgrep> )+disable-search+reload($RG_PREFIX {q} || true)+rebind(change,ctrl-f)+transform-query(echo {q} > /tmp/rg-fzf-f; cat /tmp/rg-fzf-r)" \
--color "hl:-1:underline,hl+:-1:underline:reverse" \
--prompt '1. ripgrep> ' \
--delimiter : \
--header ' CTRL-R (ripgrep mode) CTRL-F (fzf mode) ' \
--preview 'bat --color=always {1} --highlight-line {2}' \
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3' \
--bind 'enter:become(nvim {1} +{2})'

View file

@ -1,57 +0,0 @@
{
programs.ghostty = {
enable = true;
enableFishIntegration = true;
package = null;
settings = {
font-size = 18;
font-family = "Victor Mono";
font-style = "SemiBold";
background-opacity = 0.945;
window-padding-x = 0;
window-padding-y = 0;
window-padding-balance = true;
window-inherit-working-directory = true;
window-theme = "ghostty";
shell-integration-features = true;
scrollback-limit = 100000;
link-url = true;
link-previews = true;
title = " ";
background = "#0f0b15";
foreground = "#ffffff";
cursor-color = "#d369af";
selection-foreground = "#af85ea";
selection-background = "#572454";
palette = [
"0=#0f0b15"
"1=#f47359"
"2=#29a444"
"3=#b58a52"
"4=#3f95f6"
"5=#d369af"
"6=#4fbaef"
"7=#b8c6d5"
"8=#807c9f"
"9=#ff6a7a"
"10=#00a392"
"11=#df9080"
"12=#029fff"
"13=#af85ea"
"14=#35afbf"
"15=#ffffff"
];
keybind = [
"ctrl+plus=increase_font_size:2"
"ctrl+minus=decrease_font_size:2"
"ctrl+0=reset_font_size"
"ctrl+shift+a=select_all"
"ctrl+shift+c=copy_to_clipboard"
"ctrl+shift+v=paste_from_clipboard"
"cmd+c=copy_to_clipboard"
"cmd+v=paste_from_clipboard"
"global:cmd+semicolon=toggle_quick_terminal"
];
};
};
}

View file

@ -1,56 +0,0 @@
{
programs.ghostty = {
enable = true;
enableFishIntegration = true;
settings = {
font-size = 14;
font-family = "VictorMono Nerd Font";
font-style = "SemiBold";
background-opacity = 0.945;
window-padding-x = 0;
window-padding-y = 0;
window-padding-balance = true;
window-inherit-working-directory = true;
window-theme = "ghostty";
shell-integration-features = true;
scrollback-limit = 100000;
link-url = true;
link-previews = true;
title = " ";
background = "#0f0b15";
foreground = "#ffffff";
cursor-color = "#d369af";
selection-foreground = "#af85ea";
selection-background = "#572454";
palette = [
"0=#0f0b15"
"1=#f47359"
"2=#29a444"
"3=#b58a52"
"4=#3f95f6"
"5=#d369af"
"6=#4fbaef"
"7=#b8c6d5"
"8=#807c9f"
"9=#ff6a7a"
"10=#00a392"
"11=#df9080"
"12=#029fff"
"13=#af85ea"
"14=#35afbf"
"15=#ffffff"
];
keybind = [
"ctrl+plus=increase_font_size:2"
"ctrl+minus=decrease_font_size:2"
"ctrl+0=reset_font_size"
"ctrl+shift+a=select_all"
"ctrl+shift+c=copy_to_clipboard"
"ctrl+shift+v=paste_from_clipboard"
"cmd+c=copy_to_clipboard"
"cmd+v=paste_from_clipboard"
"global:cmd+semicolon=toggle_quick_terminal"
];
};
};
}

View file

@ -1,28 +0,0 @@
{
programs.git = {
enable = true;
settings = {
init = {
defaultBranch = "main";
};
core = {
ignorecase = "false";
};
pull = {
rebase = false;
};
push = {
autoSetupRemote = true;
};
user = {
name = "Dennis Schoepf";
email = "me@dnsc.io";
};
};
ignores = [ ".DS_Store" ];
};
}

View file

@ -1,205 +0,0 @@
{
services.glance = {
enable = true;
settings = {
server = {
port = 9001;
};
theme = {
background-color = "hsl(264 31.3% 6.3%)";
primary-color = "hsl(9 92.1% 85.1%)";
contrast-multiplier = 1.2;
positive-color = "hsl(174 100% 32%)";
negative-color = "hsl(354 100% 70.8%)";
disable-picker = false;
};
pages = [
{
name = "Home";
columns = [
{
size = "small";
widgets = [
{
type = "monitor";
cache = "1m";
title = "Selfhosted";
sites = [
{
title = "Fastmail";
url = "https://app.fastmail.com/";
icon = "si:protonmail";
}
{
title = "Actual";
url = "https://finance.dnsc.io";
icon = "si:actualbudget";
}
{
title = "Vaultwarden";
url = "https://vault.dnsc.io";
icon = "si:vaultwarden";
}
{
title = "Uptime Kuma";
url = "https://uptime.dnsc.io";
icon = "si:uptimekuma";
}
{
title = "dnsc.io";
url = "https://dnsc.io";
icon = "si:htmx";
}
{
title = "Jellyfin";
url = "http://192.168.178.69:8096";
icon = "si:jellyfin";
allow-insecure = true;
}
];
}
{
type = "bookmarks";
groups = [
{
title = "Hosting";
color = "hsl(187 56.6% 47.8%)";
links = [
{
title = "Hetzner";
url = "https://console.hetzner.com/projects/1355757/dashboard";
}
{
title = "Netcup";
url = "https://www.servercontrolpanel.de/SCP/Home";
}
{
title = "Porkbun";
url = "https://porkbun.com/account/domainsSpeedy";
}
];
}
{
title = "Dev";
color = "hsl(319 37.6% 63.5%)";
links = [
{
title = "Codeberg";
url = "https://codeberg.org/dnscio";
}
{
title = "Github";
url = "https://github.com/dennisschoepf?tab=repositories";
}
];
}
];
}
];
}
{
size = "full";
widgets = [
{
type = "group";
widgets = [
{
type = "hacker-news";
limit = 15;
collapse-after = 5;
}
{
type = "rss";
title = "r/neovim";
single-line-titles = true;
feeds = [
{
url = "https://www.reddit.com/r/neovim.rss";
}
];
}
{
type = "rss";
title = "r/onepiece";
single-line-titles = true;
feeds = [
{
url = "https://www.reddit.com/r/onepiece.rss";
}
];
}
{
type = "rss";
title = "r/triathlon";
single-line-titles = true;
feeds = [
{
url = "https://www.reddit.com/r/triathlon.rss";
}
];
}
];
}
{
type = "twitch-channels";
channels = [
"theprimeagen"
"tsoding"
"noway4u_sir"
"broxah"
"caedrel"
"bashbunni"
];
}
{
type = "videos";
collapse-after = 6;
channels = [
"UCuTaETsuCOkJ0H_GAztWt0Q"
"UCJVMrR290HU9pDxaP35u_cg"
"UCqqJQ_cXSat0KIAVfIfKkVA"
"UCdC0An4ZPNr_YiFiYoVbwaw"
"UCsXVk37bltHxD1rDPwtNM8Q"
"UCofJu853kJKpkg4y5a-9YXg"
"UCewLMcro9tNP97XQ1rxtLXQ"
"UCuo9VyowIT-ljA5G2ZuC6Yw"
"UCipCyKo5D3FyWE6_TpQyr5A"
"UCmL9OhLB27r1lTCHQ3pEiIQ"
"UCNIuvl7V8zACPpTmmNIqP2A"
"UC-gct8TB_8l5HsQHBBr8hyQ"
];
}
];
}
{
size = "small";
widgets = [
{
type = "server-stats";
servers = [
{
name = "dnsc-vps-sm";
type = "local";
}
];
}
{
type = "calendar";
first-day-of-the-week = "monday";
}
{
type = "weather";
units = "metric";
hour-format = "24h";
location = "Munich, Germany";
}
];
}
];
}
];
};
};
}

View file

@ -1,38 +0,0 @@
{
nix-homebrew = {
enable = true;
user = "dennis";
autoMigrate = true;
};
homebrew = {
user = "dennis";
enable = true;
onActivation = {
autoUpdate = true;
upgrade = true;
cleanup = "zap";
};
brews = [
"go"
"mas"
];
casks = [
"font-victor-mono"
"font-victor-mono-nerd-font"
"vlc"
"ghostty"
"hiddenbar"
"eurkey"
"karabiner-elements"
"caffeine"
"raycast"
"spotify"
"zen"
"keyboard-cowboy"
];
};
}

View file

@ -1,175 +0,0 @@
{
services.homepage-dashboard = {
enable = true;
listenPort = 9001;
allowedHosts = "home.dnsc.io";
settings = {
theme = "dark";
maxBookmarkGroupColumns = 2;
headerStyle = "boxedWidgets";
background = {
image = "https://i.ibb.co/v6FjzW5V/winter.png";
opacity = 40;
brightness = 50;
};
};
widgets = [
{
resources = {
cpu = true;
cputemp = true;
units = "metric";
};
}
{
resources = {
memory = true;
uptime = true;
network = true;
};
}
];
services = [
{
"VPS" = [
{
"Vaultwarden" = {
href = "https://vault.dnsc.io";
icon = "vaultwarden.png";
};
}
{
"Uptime Kuma" = {
href = "https://uptime.dnsc.io";
icon = "uptime-kuma.png";
};
}
{
"Actual" = {
href = "https://finance.dnsc.io";
icon = "actual-budget.png";
};
}
{
"Slides" = {
href = "https://slides.dnsc.io";
icon = "slidev.png";
};
}
{
"Homepage" = {
href = "https://dnsc.io";
icon = "html.png";
};
}
];
}
{
"Homelab" = [
{
"Jellyfin" = {
href = "http://100.103.199.4:8096";
icon = "jellyfin.png";
};
}
{
"Syncthing" = {
href = "http://100.103.199.4:8384";
icon = "syncthing.png";
};
}
];
}
];
bookmarks = [
{
Hosting = [
{
Porkbun = [
{
abbr = "PB";
href = "https://porkbun.com/account/domainsSpeedy";
}
];
}
{
Hetzner = [
{
abbr = "HZ";
href = "https://console.hetzner.com/projects/1355757/dashboard";
}
];
}
];
}
{
Apps = [
{
Fastmail = [
{
abbr = "FM";
href = "https://app.fastmail.com";
}
];
}
{
YNAB = [
{
abbr = "YN";
href = "https://app.ynab.com";
}
];
}
];
}
{
Dev = [
{
Codeberg = [
{
abbr = "CB";
href = "https://codeberg.org";
}
];
}
{
Github = [
{
abbr = "GH";
href = "https://github.com/dennisschoepf";
}
];
}
];
}
{
Entertainment = [
{
YouTube = [
{
abbr = "YT";
href = "https://youtube.com/feed/subscriptions";
}
];
}
{
Twitch = [
{
abbr = "TW";
href = "https://www.twitch.tv/directory/following";
}
];
}
{
Overcast = [
{
abbr = "OC";
href = "https://overcast.fm";
}
];
}
];
}
];
};
}

View file

View file

@ -1,9 +0,0 @@
{
services.immich = {
enable = true;
port = 9003;
host = "192.168.178.69";
openFirewall = true;
mediaLocation = "/main/pictures";
};
}

View file

@ -1,26 +0,0 @@
{
pkgs,
...
}:
{
services.jellyfin = {
enable = true;
openFirewall = true;
};
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
};
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
intel-vaapi-driver
libva-vdpau-driver
intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
vpl-gpu-rt # QSV on 11th gen or newer
];
};
}

View file

@ -1,15 +0,0 @@
{
services.keyd = {
enable = true;
keyboards = {
default = {
ids = [ "05ac:024f" ];
settings = {
main = {
space = "overload(control, space)";
};
};
};
};
};
}

View file

@ -1,21 +0,0 @@
{ config, ... }:
{
programs.lazygit = {
enable = true;
settings = {
gui = {
nerdFontsVersion = "3";
theme = {
lightTheme = false;
activeBorderColor = [ "magenta" "bold" ];
searchingActiveBorderColor = [ "cyan" "bold" ];
inactiveBorderColor = [ "#807c9f" ];
optionsTextColor = [ "#807c9f" ];
selectedLineBgColor = [ "#331531" ];
inactiveViewSelectedLineBgColor = [ "#1d202f" ];
};
};
};
};
}

View file

@ -1,165 +0,0 @@
{
inputs,
pkgs,
...
}:
{
programs.librewolf = {
enable = true;
nativeMessagingHosts = [ pkgs.firefoxpwa ];
policies = {
AutofillAddressEnabled = true;
AutofillCreditCardEnabled = false;
DisableAppUpdate = true;
DisableFeedbackCommands = true;
DisableFirefoxStudies = true;
DisablePocket = true;
DisableTelemetry = true;
DontCheckDefaultBrowser = true;
OfferToSaveLogins = false;
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
};
settings = {
"webgl.disabled" = false;
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.cookies" = false;
};
profiles.default = {
isDefault = true;
name = "default";
settings = {
"layout.css.prefers-color-scheme.content-override" = 0;
};
bookmarks = {
force = true;
settings = [
{
name = "Home";
url = "https://home.dnsc.io";
}
"separator"
{
name = "Nix Packages";
url = "https://search.nixos.org/packages";
}
{
name = "Nix Options";
url = "https://search.nixos.org/options";
}
{
name = "Home Manager";
url = "https://home-manager-options.extranix.com/";
}
];
};
containersForce = true;
containers = {
default = {
name = "personal";
color = "turquoise";
icon = "chill";
id = 1;
};
};
search = {
default = "google";
force = true;
engines = {
nix-packages = {
name = "Nix Packages";
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
nix-options = {
name = "Nix Options";
urls = [
{
template = "https://search.nixos.org/options";
params = [
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
nix-home-manager = {
name = "Nix Home Manager";
urls = [
{
template = "https://home-manager-options.extranix.com";
params = [
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nh" ];
};
nix-wiki = {
name = "Nix Wiki";
urls = [
{
template = "https://wiki.nixos.org/w/index.php";
params = [
{
name = "search";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nw" ];
};
};
};
extensions.force = true;
extensions.packages = with inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system}; [
ublock-origin
dearrow
bitwarden
sponsorblock
vimium
];
};
};
}

View file

@ -1,61 +0,0 @@
{ pkgs, ... }:
{
system = {
primaryUser = "dennis";
stateVersion = 5;
activationScripts.postActivation.text = ''
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
'';
defaults = {
NSGlobalDomain."com.apple.swipescrolldirection" = false;
dock = {
autohide = true;
autohide-delay = 0.01;
autohide-time-modifier = 0.01;
expose-group-apps = true;
launchanim = false;
minimize-to-application = true;
orientation = "right";
show-recents = false;
persistent-apps = [
"/Applications/Helium.app"
"/Applications/Ghostty.app"
"/System/Applications/System Settings.app/"
];
persistent-others = [
"/Users/dennis/Downloads"
];
};
finder = {
AppleShowAllExtensions = true;
CreateDesktop = false;
FXEnableExtensionChangeWarning = false;
FXPreferredViewStyle = "clmv";
ShowPathbar = true;
ShowStatusBar = true;
};
loginwindow = {
LoginwindowText = "(λ) powered by nix-darwin";
};
menuExtraClock = {
Show24Hour = true;
ShowDate = 0;
};
screencapture = {
location = "/Users/dennis/Downloads";
target = "file";
};
spaces.spans-displays = false;
};
};
security.pam.services.sudo_local.touchIdAuth = true;
}

View file

@ -0,0 +1,34 @@
{
inputs,
lib,
config,
...
}:
with lib;
let
cfg = config.neovim;
in
{
options.neovim = {
enable = mkOption {
type = types.bool;
default = false;
description = "Enable neovim";
};
extraPackages = mkOption {
type = types.listOf types.package;
default = [ ];
description = "Additional packages to install alongside neovim on the system.";
};
};
flake-file.inputs.nixvim.url = "github:nix-community/nixvim";
flake.modules.homeManager.neovim = {
imports = [ inputs.nixvim.homeModules.nixvim ];
programs.nixvim = {
enable = cfg.enable;
};
};
}

View file

@ -1,45 +0,0 @@
{ ... }:
{
plugins.opencode = {
enable = true;
settings = {
provider.enabled = "tmux";
};
};
keymaps = [
{
action.__raw = ''function() require("opencode").ask("@this: ", { submit = true }) end'';
key = "<leader>at";
options.desc = "ask opencode about this";
}
{
action.__raw = ''function() require("opencode").toggle() end'';
key = "<leader>aa";
options.desc = "toggle opencode";
}
{
action.__raw = ''function() require("opencode").select() end'';
key = "<leader>as";
options.desc = "select an opencode action";
}
{
mode = [
"n"
"x"
];
action.__raw = ''function() return require("opencode").operator("@this ") end'';
key = "go";
options.desc = "add range to opencode";
}
{
mode = [
"n"
];
action.__raw = ''function() return require("opencode").operator("@this ") .. "_" end'';
key = "go";
options.desc = "add line to opencode";
}
];
}

View file

@ -1,13 +0,0 @@
{ ... }:
{
colorscheme = "winterly";
# Make palette available to this module but
# also for other configuration (e.g. lualine)
extraFiles."lua/dnsc/palette.lua".source = ./extraFiles/palette.lua;
# Set custorscheme in neovims runtimepath so that neovim
# discovers it automatically
extraFiles."colors/winterly.lua".source = ./extraFiles/winterly.lua;
}

View file

@ -1,29 +0,0 @@
{
plugins.blink-cmp = {
enable = true;
settings = {
keymap = {
preset = "enter";
"<Tab>" = [
"select_next"
"fallback"
];
"<S-Tab>" = [
"select_prev"
"fallback"
];
"<C-y>" = [
"select_and_accept"
];
"<C-k>" = [
"show_documentation"
"hide_documentation"
];
};
appearance.nerd_font_variant = "mono";
completion.documentation.auto_show = false;
signature.enabled = true;
cmdline.completion.menu.auto_show = true;
};
};
}

View file

@ -1,27 +0,0 @@
{ pkgs, ... }:
# These options are imported in nixvim.imports and therefore
# every option here lives within `programs.nixvim`
{
enable = true;
defaultEditor = true;
package = pkgs.neovim-unwrapped;
# Setup some aliases
vimAlias = true;
vimdiffAlias = true;
imports = [
./colorscheme.nix
./completion.nix
./editing.nix
./picker.nix
./formatter.nix
./git.nix
./lsp.nix
./options.nix
./statusline.nix
./keybindings.nix
./ai.nix
];
}

View file

@ -1,79 +0,0 @@
{ pkgs, ... }:
{
plugins.sleuth.enable = true;
plugins.nvim-surround.enable = true;
plugins.flash.enable = true;
plugins.blink-pairs = {
enable = true;
};
plugins.treesitter = {
enable = true;
highlight.enable = true;
indent.enable = true;
folding.enable = true;
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
angular
bash
css
html
javascript
jsdoc
json
lua
make
markdown
markdown_inline
go
gomod
gotmpl
python
styled
tsx
typescript
nix
regex
toml
vim
vimdoc
xml
yaml
];
};
plugins.substitute = {
enable = true;
luaConfig.post = /* lua */ ''
local sub = require("substitute")
vim.keymap.set("n", "s", sub.operator, { noremap = true })
vim.keymap.set("n", "ss", sub.line, { noremap = true })
vim.keymap.set("n", "S", sub.eol, { noremap = true })
vim.keymap.set("x", "s", sub.visual, { noremap = true })
'';
};
extraPlugins = [
pkgs.vimPlugins.vim-cool
];
autoCmd = [
{
callback.__raw = "function() vim.highlight.on_yank() end";
event = [
"TextYankPost"
];
}
{
event = [ "FileType" ];
pattern = "qf";
callback.__raw = /* lua */ ''
function()
vim.keymap.set("n", "<CR>", "<CR>", { buffer = true })
end
'';
}
];
}

View file

@ -1,33 +0,0 @@
return {
fg = "#ffffff",
fg_alt = "#bf8a9f",
fg_dim = "#807c9f",
bg = "#0f0b15",
bg_secondary = "#1d202f",
grey = "#807c9f",
grey_bright = "#807c9f",
red = "#f47359",
red_bright = "#ff6a7a",
red_subtle_bg = "#67182f",
green = "#29a444",
green_bright = "#00a392",
green_subtle_bg = "#10452f",
yellow = "#b58a52",
yellow_bright = "#df9080",
yellow_brighter = "#FCC1B6",
yellow_subtle_bg = "#54362a",
blue = "#3f95f6",
blue_bright = "#029fff",
blue_subtle_bg = "#2a346e",
blue_subtle_dark_bg = "#003045",
magenta = "#d369af",
magenta_bright = "#af85ea",
magenta_brighter = "#c57faf",
magenta_subtle_bg = "#572454",
magenta_subtle_bg_darker = "#331531",
cyan = "#4fbaef",
cyan_bright = "#35afbf",
cyan_subtle_bg = "#133d56",
silver = "#b8c6d5",
silver_bright = "#ffffff",
}

View file

@ -1,368 +0,0 @@
local palette = require("dnsc.palette")
vim.cmd.highlight("clear")
vim.g.colors_name = "winterly"
local hi = function(name, val)
-- Force links
val.force = true
-- Make sure that `cterm` attribute is not populated from `gui`
val.cterm = val.cterm or {} ---@type vim.api.keyset.highlight
-- Define global highlight
vim.api.nvim_set_hl(0, name, val)
end
-- General
hi("Normal", { fg = palette.fg })
hi("Conceal", { fg = palette.silver, bg = palette.grey, ctermfg = "LightGrey", ctermbg = "DarkGrey" })
hi("Cursor", { bg = palette.magenta_bright })
hi("DiffText", { bg = palette.yellow_subtle_bg, bold = true, ctermbg = "DarkYellow", cterm = { bold = true } })
hi("ErrorMsg", { fg = palette.red_bright, bg = palette.red_subtle_bg, ctermfg = "White", ctermbg = "DarkRed" })
hi("IncSearch", { bg = palette.magenta_subtle_bg, fg = palette.magenta })
hi("ModeMsg", { bold = true, cterm = { bold = true } })
hi("NonText", { fg = palette.grey, ctermfg = "DarkGrey" })
hi("PmenuSbar", { bg = palette.grey, ctermbg = "Grey" })
hi("StatusLine", { reverse = true, bold = true, cterm = { reverse = true, bold = true } })
hi("StatusLineNC", { reverse = true, cterm = { reverse = true } })
hi("TabLineFill", { reverse = true, cterm = { reverse = true } })
hi("TabLineSel", { bold = true, cterm = { bold = true } })
hi("TermCursor", { reverse = true, cterm = { reverse = true } })
hi("WinBar", { bold = true, cterm = { bold = true } })
hi("WildMenu", { fg = palette.bg, bg = palette.yellow_subtle_bg, ctermfg = "Black", ctermbg = "Yellow" })
hi("VertSplit", { link = "Comment" })
hi("WinSeparator", { link = "VertSplit" })
hi("WinBarNC", { link = "WinBar" })
hi("DiffTextAdd", { link = "DiffText" })
hi("EndOfBuffer", { link = "NonText" })
hi("LineNrAbove", { link = "LineNr" })
hi("LineNrBelow", { link = "LineNr" })
hi("QuickFixLine", { link = "Search" })
hi("CursorLineSign", { link = "SignColumn" })
hi("CursorLineFold", { link = "FoldColumn" })
hi("CurSearch", { link = "Search" })
hi("PmenuKind", { link = "Pmenu" })
hi("PmenuKindSel", { link = "PmenuSel" })
hi("PmenuMatch", { link = "Pmenu" })
hi("PmenuMatchSel", { link = "PmenuSel" })
hi("PmenuExtra", { link = "Pmenu" })
hi("PmenuExtraSel", { link = "PmenuSel" })
hi("PreInsert", { link = "Added" })
hi("ComplMatchIns", {})
hi("ComplHint", { link = "NonText" })
hi("ComplHintMore", { link = "MoreMsg" })
hi("Whitespace", { link = "NonText" })
hi("MsgSeparator", { link = "StatusLine" })
hi("NormalFloat", { link = "Pmenu" })
hi("FloatBorder", { bg = palette.bg_secondary, fg = palette.fg_dim })
hi("FloatTitle", { bg = palette.bg_secondary, fg = palette.fg, bold = true })
hi("FloatFooter", { link = "Title" })
hi("FloatShadow", { bg = palette.bg, blend = 80 })
hi("FloatShadowThrough", { bg = palette.bg, blend = 100 })
hi("RedrawDebugNormal", { reverse = true, cterm = { reverse = true } })
hi("RedrawDebugClear", { bg = palette.yellow_subtle_bg, ctermbg = "DarkYellow" })
hi("RedrawDebugComposed", { bg = palette.green_subtle_bg, ctermbg = "DarkGreen" })
hi("RedrawDebugRecompose", { bg = palette.red_subtle_bg, ctermbg = "DarkRed" })
hi("Error", { link = "ErrorMsg" })
hi("NvimInternalError", { link = "ErrorMsg" })
hi("Todo", { fg = palette.blue_bright, bg = palette.blue_subtle_bg, ctermbg = "DarkBlue", ctermfg = "LightBlue" })
hi("String", { link = "Constant" })
hi("Character", { link = "Constant" })
hi("Number", { link = "Boolean" })
hi("Boolean", { fg = palette.magenta_bright, bold = true })
hi("Float", { link = "Number" })
hi("Function", { link = "Identifier" })
hi("Conditional", { link = "Statement" })
hi("Repeat", { link = "Statement" })
hi("Label", { link = "Statement" })
hi("Operator", { fg = palette.fg_alt, italic = false, ctermfg = "White" })
hi("Keyword", { link = "Statement" })
hi("Exception", { link = "Statement" })
hi("Include", { link = "PreProc" })
hi("Define", { link = "PreProc" })
hi("Macro", { link = "PreProc" })
hi("PreCondit", { link = "PreProc" })
hi("StorageClass", { link = "Type" })
hi("Structure", { link = "Type" })
hi("Typedef", { bold = true, fg = palette.yellow_brighter, ctermfg = "LightYellow" })
hi("Tag", { link = "Special" })
hi("SpecialChar", { link = "Special" })
hi("Delimiter", { link = "Special" })
hi("SpecialComment", { link = "Special" })
hi("Debug", { link = "Special" })
hi("DiagnosticError", { fg = palette.red_bright, ctermfg = 1 })
hi("DiagnosticWarn", { fg = palette.yellow, ctermfg = 3 })
hi("DiagnosticInfo", { fg = palette.cyan, ctermfg = 4 })
hi("DiagnosticHint", { fg = palette.silver, ctermfg = 7 })
hi("DiagnosticOk", { fg = palette.green_bright, ctermfg = 10 })
hi("DiagnosticUnderlineError", { fg = palette.red_bright, undercurl = true, cterm = { underline = true } })
hi("DiagnosticUnderlineWarn", { fg = palette.yellow, undercurl = true, cterm = { underline = true } })
hi("DiagnosticUnderlineInfo", { fg = palette.cyan, undercurl = true, cterm = { underline = true } })
hi("DiagnosticUnderlineHint", { fg = palette.silver, undercurl = true, cterm = { underline = true } })
hi("DiagnosticUnderlineOk", { fg = palette.green_bright, undercurl = true, cterm = { underline = true } })
hi("DiagnosticVirtualTextError", { link = "DiagnosticError" })
hi("DiagnosticVirtualTextWarn", { link = "DiagnosticWarn" })
hi("DiagnosticVirtualTextInfo", { link = "DiagnosticInfo" })
hi("DiagnosticVirtualTextHint", { link = "DiagnosticHint" })
hi("DiagnosticVirtualTextOk", { link = "DiagnosticOk" })
hi("DiagnosticFloatingError", { link = "DiagnosticError" })
hi("DiagnosticFloatingWarn", { link = "DiagnosticWarn" })
hi("DiagnosticFloatingInfo", { link = "DiagnosticInfo" })
hi("DiagnosticFloatingHint", { link = "DiagnosticHint" })
hi("DiagnosticFloatingOk", { link = "DiagnosticOk" })
hi("DiagnosticSignError", { link = "DiagnosticError" })
hi("DiagnosticSignWarn", { link = "DiagnosticWarn" })
hi("DiagnosticSignInfo", { link = "DiagnosticInfo" })
hi("DiagnosticSignHint", { link = "DiagnosticHint" })
hi("DiagnosticSignOk", { link = "DiagnosticOk" })
hi("DiagnosticDeprecated", { fg = palette.red, strikethrough = true, cterm = { strikethrough = true } })
hi("DiagnosticUnnecessary", { link = "Unused" })
hi("LspInlayHint", { link = "NonText" })
hi("SnippetTabstop", { link = "Visual" })
hi("SnippetTabstopActive", { link = "SnippetTabstop" })
-- Text
hi("@markup.raw", { link = "Special" })
hi("@markup.link", { link = "Identifier" })
hi("@markup.link.label", { link = "ConstantUnderlined" })
hi("@markup.heading", { link = "Title" })
hi("@markup.heading.gitcommit", { bg = palette.bg, fg = palette.fg, bold = true })
hi("@markup.link.url", { link = "Underlined" })
hi("@markup.underline", { link = "Underlined" })
hi("@comment.todo", { link = "Todo" })
-- Miscs
hi("@comment", { link = "Comment" })
hi("@punctuation", { link = "Delimiter" })
-- Constants
hi("@constant", { link = "Constant" })
hi("@constant.builtin", { link = "Special" })
hi("@constant.macro", { link = "Define" })
hi("@keyword.directive", { link = "Define" })
hi("@string", { link = "String" })
hi("@string.escape", { link = "SpecialChar" })
hi("@string.special", { link = "SpecialChar" })
hi("@character", { link = "Character" })
hi("@character.special", { link = "SpecialChar" })
hi("@number", { link = "Number" })
hi("@boolean", { link = "Boolean" })
hi("@number.float", { link = "Float" })
-- Functions
hi("@function", { link = "Function" })
hi("@function.builtin", { link = "Special" })
hi("@function.macro", { link = "Macro" })
hi("@function.method", { link = "Function" })
hi("@variable.parameter", { link = "Identifier" })
hi("@variable.parameter.builtin", { link = "Special" })
hi("@variable.member", { link = "Identifier" })
hi("@property", { link = "Identifier" })
hi("@attribute", { link = "Macro" })
hi("@attribute.builtin", { link = "Special" })
hi("@constructor", { link = "Special" })
-- Keywords
hi("@keyword.conditional", { link = "Conditional" })
hi("@keyword.repeat", { link = "Repeat" })
hi("@keyword.type", { link = "Structure" })
hi("@label", { link = "Label" })
hi("@operator", { link = "Operator" })
hi("@keyword", { link = "Keyword" })
hi("@keyword.exception", { link = "Exception" })
hi("@variable", { link = "Identifier" })
hi("@type", { link = "Type" })
hi("@type.builtin", { link = "Type" })
hi("@type.definition", { link = "Typedef" })
hi("@module", { link = "Identifier" })
hi("@keyword.import", { link = "Include" })
hi("@keyword.directive", { link = "PreProc" })
hi("@keyword.debug", { link = "Debug" })
hi("@tag", { link = "Tag" })
hi("@tag.tsx", { link = "Identifier" })
hi("@tag.builtin", { link = "Special" })
-- LSP semantic tokens
hi("@lsp.type.class", { link = "Structure" })
hi("@lsp.type.comment", { link = "Comment" })
hi("@lsp.type.decorator", { link = "Function" })
hi("@lsp.type.enum", { link = "Structure" })
hi("@lsp.type.enumMember", { link = "Constant" })
hi("@lsp.type.function", { link = "Function" })
hi("@lsp.type.interface", { link = "Structure" })
hi("@lsp.type.macro", { link = "Macro" })
hi("@lsp.type.method", { link = "Function" })
hi("@lsp.type.namespace", { link = "Structure" })
hi("@lsp.type.parameter", { link = "Identifier" })
hi("@lsp.type.property", { link = "Identifier" })
hi("@lsp.type.struct", { link = "Structure" })
hi("@lsp.type.type", { link = "Type" })
hi("@lsp.type.typeParameter", { link = "TypeDef" })
hi("@lsp.type.variable", { link = "Identifier" })
hi("@lsp.typemod.keyword.documentation", { fg = palette.grey, bold = true })
if vim.o.background == "light" then
-- TODO: Define light scheme
else
-- Default colors only used with a dark background.
hi("ColorColumn", { bg = palette.red_subtle_bg, ctermbg = "DarkRed" })
hi("CursorColumn", { bg = palette.grey, ctermbg = "DarkGrey" })
hi("CursorLine", { bg = palette.magenta_subtle_bg_darker, cterm = { underline = true } })
hi("CursorLineNr", {
fg = palette.fg,
bg = palette.magenta_subtle_bg_darker,
bold = true,
ctermfg = "White",
cterm = { underline = true },
})
hi("DiffAdd", { fg = palette.green_bright, bg = palette.green_subtle_bg, ctermbg = "DarkGreen" })
hi("DiffChange", { fg = palette.yellow_brighter, bg = palette.yellow_subtle_bg, ctermbg = "DarkYellow" })
hi("DiffDelete", { fg = palette.red_bright, bg = palette.red_subtle_bg, ctermbg = "DarkRed" })
hi("Directory", { fg = palette.magenta, bold = true, ctermfg = "Magenta" })
hi("FoldColumn", { fg = palette.cyan_bright, bg = palette.grey, ctermfg = "Cyan", ctermbg = "DarkGrey" })
hi("Folded", { fg = palette.cyan_bright, bg = palette.grey, ctermfg = "Cyan", ctermbg = "DarkGrey" })
hi("LineNr", { fg = palette.grey_bright, ctermfg = "Grey" })
hi(
"MatchParen",
{ fg = palette.fg_alt, bg = palette.magenta_subtle_bg, ctermbg = "DarkMagenta", ctermfg = "Black" }
)
hi("MoreMsg", { fg = palette.grey, ctermfg = "DarkGrey" })
hi("Pmenu", { bg = palette.bg_secondary, ctermfg = "White", ctermbg = "Black" })
hi("PmenuSel", {
bg = palette.magenta_subtle_bg,
fg = palette.fg,
bold = true,
ctermfg = "LightMagenta",
ctermbg = "DarkMagenta",
})
hi("PmenuThumb", { bg = palette.fg, ctermbg = "White" })
hi("Question", { fg = palette.green_bright, bold = true, ctermfg = "LightGreen" })
hi("Search", { link = "IncSearch" })
hi("Substitute", {
fg = palette.green_bright,
bg = palette.green_subtle_bg,
bold = true,
ctermfg = "DarkBlue",
ctermbg = "LightBlue",
})
hi("SignColumn", { fg = palette.grey_bright, bg = palette.bg, ctermfg = "Cyan", ctermbg = "DarkGrey" })
hi("SpecialKey", { fg = palette.cyan_bright, ctermfg = "LightBlue" })
hi("SpellBad", { fg = palette.red, undercurl = true, ctermbg = "Red" })
hi("SpellCap", { fg = palette.blue, undercurl = true, ctermbg = "Blue" })
hi("SpellLocal", { fg = palette.cyan, undercurl = true, ctermbg = "Cyan" })
hi("SpellRare", { fg = palette.magenta, undercurl = true, ctermbg = "Magenta" })
hi("StatusLineTerm", {
fg = palette.bg,
bg = palette.green_bright,
bold = true,
ctermfg = "Black",
ctermbg = "LightGreen",
cterm = { bold = true },
})
hi("StatusLineTermNC", { fg = palette.bg, bg = palette.green_bright, ctermfg = "Black", ctermbg = "LightGreen" })
hi(
"TabLine",
{ bg = palette.grey, underline = true, ctermfg = "White", ctermbg = "DarkGrey", cterm = { underline = true } }
)
hi("Title", { fg = palette.magenta_bright, bold = true, ctermfg = "Magenta" })
hi("Visual", {
fg = palette.magenta_brighter,
bg = palette.magenta_subtle_bg,
ctermfg = "LightMagenta",
ctermbg = "DarkMagenta",
})
hi("WarningMsg", { fg = palette.red_bright, ctermfg = "LightRed" })
hi("Comment", { fg = palette.grey, ctermfg = "Cyan" })
hi("Unused", { fg = palette.grey_bright, undercurl = true, ctermfg = "LightGrey" })
hi("Constant", { fg = palette.yellow_brighter, ctermfg = "LightYellow" })
hi("ConstantUnderlined", { fg = palette.yellow_brighter, underline = true, ctermfg = "LightYellow" })
hi("Special", { fg = palette.silver, ctermfg = "LightGrey" })
hi("Identifier", { fg = palette.fg, ctermfg = "White", cterm = { bold = true } })
hi("Statement", { fg = palette.fg_alt, bold = true, ctermfg = "White" })
hi("PreProc", { fg = palette.magenta, ctermfg = "LightMagenta" })
hi("Type", { fg = palette.silver, bold = true, ctermfg = "LightCyan" })
hi("Underlined", { fg = palette.silver, underline = true, ctermfg = "LightGrey", cterm = { underline = true } })
hi("Ignore", { fg = palette.bg, ctermfg = "Black" })
hi(
"Added",
{ fg = palette.green_bright, bg = palette.green_subtle_bg, ctermfg = "LightGreen", ctermbg = "DarkGreen" }
)
hi(
"Changed",
{ fg = palette.blue_bright, bg = palette.blue_subtle_bg, ctermfg = "LightBlue", ctermbg = "DarkBlue" }
)
hi("Removed", { fg = palette.red_bright, bg = palette.red_subtle_bg, ctermfg = "LightRed", ctermbg = "DarkRed" })
hi("NotificationInfo", { fg = palette.silver, bg = palette.bg, ctermfg = "White", ctermbg = "Black" })
-- Snacks
hi("SnacksIndentScope", { fg = palette.magenta, ctermfg = "LightGrey" })
hi("SnacksIndent", { fg = palette.magenta_subtle_bg, ctermfg = "DarkGrey" })
hi(
"SnacksPickerCursorLine",
{ bg = palette.magenta_subtle_bg, fg = palette.fg, bold = true, cterm = { underline = true } }
)
hi("SnacksPickerListCursorLine", { link = "SnacksPickerCursorLine" })
hi("SnacksPickerTitle", { link = "FloatTitle" })
hi("SnacksBackdrop", { link = "Pmenu" })
-- Flash
hi("FlashMatch", { reverse = true })
hi("FlashLabel", { bg = palette.fg, fg = palette.bg })
-- FzfLua
hi("FzfLuaNormal", { link = "Pmenu" })
hi("FzfLuaBorder", { link = "Pmenu" })
hi("FzfLuaTitle", { link = "Pmenu" })
hi("FzfLuaBackdrop", { link = "Pmenu" })
hi("FzfLuaPreviewNormal", { link = "FzfLuaNormal" })
hi("FzfLuaPreviewBorder", { link = "FzfLuaBorder" })
hi("FzfLuaPreviewTitle", { link = "FzfLuaTitle" })
hi(
"FzfLuaCursorLine",
{ bg = palette.magenta_subtle_bg, fg = palette.fg, bold = true, cterm = { underline = true } }
)
hi("FzfLuaTitleFlags", { link = "FzfLuaCursorLine" })
hi("FzfLuaCursorLineNr", { link = "FzfLuaCursorLine" })
hi("FzfLuaHeaderBind", { link = "Pmenu" })
hi("FzfLuaHeaderText", { link = "Comment" })
hi("FzfLuaPathLineNr", { link = "Pmenu" })
hi("FzfLuaPathColNr", { link = "Pmenu" })
hi("FzfLuaLivePrompt", { link = "Pmenu" })
hi("FzfLuaCmdBuf", { link = "Comment" })
hi("FzfLuaBufName", { link = "Pmenu" })
hi("FzfLuaBufId", { link = "Special" })
hi("FzfLuaBufLineNr", { link = "Special" })
hi("FzfLuaBufFlagCur", { link = "Pmenu" })
hi("FzfLuaBufFlagAlt", { link = "Comment" })
-- Blinkpairs
hi("BlinkPairsOrange", { link = "Comment" })
hi("BlinkPairsPurple", { fg = palette.magenta_brighter })
hi("BlinkPairsBlue", { fg = palette.magenta_bright })
-- Neogit
hi("NeogitDiffAdd", { link = "DiffAdd" })
hi("NeogitDiffDelete", { link = "DiffDelete" })
hi("NeogitDiffContext", { bg = palette.bg_secondary, fg = palette.fg })
hi("NeogitDiffContextCursor", { bg = palette.magenta_subtle_bg_darker, fg = palette.magenta_brighter })
hi("NeogitDiffAddCursor", { bg = palette.green_bright, fg = palette.green_subtle_bg })
hi("NeogitDiffDeleteCursor", { bg = palette.red_bright, fg = palette.red_subtle_bg })
hi("NeogitDiffContextHighlight", { link = "NeogitDiffContext" })
hi("NeogitDiffAddHighlight", { link = "DiffAdd" })
hi("NeogitDiffDeleteHighlight", { link = "DiffDelete" })
hi("NeogitHunkHeader", { bg = palette.bg_secondary, fg = palette.grey_bright })
hi("NeogitHunkMergeHeader", { link = "NeogitHunkHeader" })
hi("NeogitHunkHeaderHighlight", { bg = palette.magenta_subtle_bg, fg = palette.magenta_brighter })
hi("NeogitHunkHeaderCursor", { link = "NeogitHunkHeaderHighlight" })
hi("NeogitCommitViewHeader", { bg = palette.bg_secondary, fg = palette.fg })
hi("NeogitDiffHeader", { bg = palette.bg, fg = palette.grey_bright, bold = true })
hi("NeogitActiveItem", { bg = palette.grey_bright, fg = palette.bg, bold = true })
end

View file

@ -1,56 +0,0 @@
{ pkgs, ... }:
{
plugins.conform-nvim = {
enable = true;
settings = {
formatters_by_ft = {
typescriptreact = {
__unkeyed-1 = "biome-check";
__unkeyed-2 = "prettierd";
stop_after_first = true;
};
astro = [ "prettierd" ];
typescript = {
__unkeyed-1 = "biome-check";
__unkeyed-2 = "prettierd";
stop_after_first = true;
};
javascript = {
__unkeyed-1 = "biome-check";
__unkeyed-2 = "prettierd";
stop_after_first = true;
};
javascriptreact = {
__unkeyed-1 = "biome-check";
__unkeyed-2 = "prettierd";
stop_after_first = true;
};
html = [ "prettierd" ];
htmlangular = [ "prettierd" ];
css = {
__unkeyed-1 = "biome-check";
__unkeyed-2 = "prettierd";
stop_after_first = true;
};
yaml = [ "prettierd" ];
markdown = [ "prettierd" ];
json = {
__unkeyed-1 = "biome-check";
__unkeyed-2 = "prettierd";
stop_after_first = true;
};
lua = [ "stylua" ];
go = [ "goimports" ];
gomod = [ "goimports" ];
gowork = [ "goimports" ];
gotmpl = [ "goimports" ];
};
format_on_save = {
timeout_ms = 500;
lsp_format = "fallback";
};
};
extraPackages = [pkgs.stylua];
};
}

View file

@ -1,28 +0,0 @@
{
plugins.gitportal = {
enable = true;
};
keymaps = [
{
key = "<leader>gll";
action = "<cmd>GitPortal<cr>";
options.desc = "Open line in Git provider";
}
{
key = "<leader>gll";
action = "<cmd>GitPortal<cr>";
options.desc = "Open line in Git provider";
}
{
key = "<leader>gly";
action = "<cmd>GitPortal copy_link_to_clipboard<cr>";
options.desc = "Copy link to line at Git provider";
}
{
key = "<leader>glo";
action = "<cmd>GitPortal open_link<cr>";
options.desc = "Open link to line at Git provider";
}
];
}

View file

@ -1,129 +0,0 @@
{
plugins.which-key = {
enable = true;
icons.mappings = false;
};
keymaps = [
# Open
{
mode = [ "n" ];
key = "<leader>od";
action = "<cmd>vsplit | lua vim.lsp.buf.definition()<cr>";
options.desc = "Go to definition in other window";
}
# Buffer
{
mode = [ "n" ];
key = "<leader>bn";
action = "<cmd>bn<cr>";
options.desc = "Move to next buffer";
}
{
mode = [ "n" ];
key = "<leader>bp";
action = "<cmd>bp<cr>";
options.desc = "Move to previous buffer";
}
{
mode = [ "n" ];
key = "<leader>bk";
action = "<cmd>bn<cr>";
options.desc = "Kill buffer and window";
}
# File
{
mode = [ "n" ];
key = "<leader>fn";
action = "<cmd>enew<cr>";
options.desc = "Create a new file";
}
{
mode = [ "n" ];
key = "<leader>fs";
action = "<cmd>w<cr>";
options.desc = "Save currently opened file";
}
# Quit
{
mode = [ "n" ];
key = "<leader>qq";
action = "<cmd>qa!<cr>";
options.desc = "Leave neovim";
}
# Window
{
mode = [ "n" ];
key = "<leader>w+";
action = ":vertical resize +4<cr>";
options.desc = "Increase window size";
}
{
mode = [ "n" ];
key = "<leader>w-";
action = ":vertical resize -4<cr>";
options.desc = "Decrease window size";
}
{
mode = [ "n" ];
key = "<leader>wx";
action = ":bd<cr>";
options.desc = "Kill active window and buffer";
}
{
mode = [ "n" ];
key = "<leader>wh";
action = "<C-W>h";
options.desc = "Move to window on left";
}
{
mode = [ "n" ];
key = "<leader>wj";
action = "<C-W>j";
options.desc = "Move to window on bottom";
}
{
mode = [ "n" ];
key = "<leader>wk";
action = "<C-W>k";
options.desc = "Move to window on top";
}
{
mode = [ "n" ];
key = "<leader>wl";
action = "<C-W>l";
options.desc = "Move to window on right";
}
{
mode = [ "n" ];
key = "<leader>ws";
action = "<cmd>sp<cr>";
options.desc = "Split windows horizontally";
}
{
mode = [ "n" ];
key = "<leader>wv";
action = "<cmd>vsp<cr>";
options.desc = "Split windows vertically";
}
{
mode = [ "n" ];
key = "<leader>wd";
action = "<cmd>close<cr>";
options.desc = "Delete window only";
}
{
mode = [
"n"
"x"
"o"
];
key = "<CR>";
action.__raw = /* lua */ ''function() require("flash").jump() end'';
}
];
}

View file

@ -1,199 +0,0 @@
{ pkgs, ... }:
{
plugins.lspconfig.enable = true;
lsp = {
enable = true;
servers = {
lua_ls = {
enable = true;
package = pkgs.lua-language-server;
packageFallback = true;
};
nil_ls = {
enable = true;
package = pkgs.nil;
packageFallback = true;
};
gopls = {
enable = true;
package = pkgs.gopls;
packageFallback = true;
};
ts_ls = {
enable = true;
package = pkgs.typescript-language-server;
packageFallback = true;
};
jsonls = {
enable = true;
package = pkgs.vscode-langservers-extracted;
packageFallback = true;
};
cssls = {
enable = true;
package = pkgs.vscode-langservers-extracted;
packageFallback = true;
};
html = {
enable = true;
package = pkgs.vscode-langservers-extracted;
packageFallback = true;
};
astro = {
enable = true;
package = pkgs.astro-language-server;
packageFallback = true;
config.init_options.typescript.tsdk = "${pkgs.typescript}/lib/node_modules/typescript/lib";
};
eslint = {
enable = true;
package = pkgs.vscode-langservers-extracted;
packageFallback = true;
config = {
root_markers = [
".eslintrc"
".eslintrc.js"
".eslintrc.cjs"
".eslintrc.yaml"
".eslintrc.yml"
".eslintrc.json"
"eslint.config.js"
"eslint.config.mjs"
"eslint.config.cjs"
"eslint.config.ts"
"eslint.config.mts"
"eslint.config.cts"
"package.json"
];
settings = {
validate = "on";
useESLintClass = false;
experimental = {
useFlatConfig = true;
};
codeActionOnSave = {
enable = false;
mode = "all";
};
format = true;
quiet = false;
onIgnoredFiles = "off";
rulesCustomizations = { };
run = "onType";
problems = {
shortenToSingleLine = false;
};
nodePath = "";
workingDirectory = {
mode = "location";
};
codeAction = {
disableRuleComment = {
enable = true;
location = "separateLine";
};
showDocumentation = {
enable = true;
};
};
};
handlers = {
"eslint/openDoc".__raw = /* lua */ ''
function(_, result)
if result then
vim.ui.open(result.url)
end
return {}
end
'';
"eslint/confirmESLintExecution" = /* lua */ ''
function(_, result)
if not result then
return
end
return 4 -- approved
end
'';
"eslint/probeFailed" = /* lua */ ''
function()
vim.notify("[lspconfig] ESLint probe failed.", vim.log.levels.WARN)
return {}
end
'';
"eslint/noLibrary" = /* lua */ ''
function()
vim.notify("[lspconfig] Unable to find ESLint library.", vim.log.levels.WARN)
return {}
end
'';
};
on_new_config.__raw = /* lua */ ''
function(config, new_root_dir)
-- This function is called when LSP attaches to a new buffer
-- Set the working directory to the root where eslint config is found
config.settings = config.settings or {}
config.settings.workspaceFolder = {
uri = new_root_dir,
name = vim.fn.fnamemodify(new_root_dir, ":t"),
}
-- Detect flat config
local flat_config_files = {
"eslint.config.js",
"eslint.config.mjs",
"eslint.config.cjs",
"eslint.config.ts",
"eslint.config.mts",
"eslint.config.cts",
}
for _, file in ipairs(flat_config_files) do
local config_path = new_root_dir .. "/" .. file
if vim.uv.fs_stat(config_path) then
config.settings.experimental = config.settings.experimental or {}
config.settings.experimental.useFlatConfig = true
break
end
end
-- Support Yarn PnP
local pnp_cjs = new_root_dir .. "/.pnp.cjs"
local pnp_js = new_root_dir .. "/.pnp.js"
if vim.uv.fs_stat(pnp_cjs) or vim.uv.fs_stat(pnp_js) then
config.cmd = vim.list_extend({ "yarn", "exec" }, config.cmd or {})
end
end
'';
};
};
biome = {
enable = true;
package = null;
packageFallback = false;
};
};
keymaps = [
{
key = "<leader>ca";
lspBufAction = "code_action";
}
{
key = "<leader>e";
action = "<cmd>lua vim.diagnostic.open_float()<cr>";
}
];
};
# Define diagnostic appearance
diagnostic.settings = {
virtual_text = false;
signs = true;
underline = true;
update_in_insert = false;
severity_sort = false;
};
}

View file

@ -1,47 +0,0 @@
{
globals = {
mapleader = " ";
maplocalleader = " ";
};
clipboard.register = "unnamedplus";
opts = {
backup = false;
cmdheight = 1;
conceallevel = 0;
fileencoding = "utf-8";
hlsearch = true;
ignorecase = true;
mouse = "a";
pumheight = 10;
showmode = false;
smartindent = true;
breakindent = true;
showtabline = 0;
smartcase = true;
splitbelow = true;
splitright = true;
swapfile = false;
termguicolors = true;
timeoutlen = 600;
undofile = true;
updatetime = 230;
writebackup = false;
expandtab = true;
shiftwidth = 2;
tabstop = 2;
cursorline = true;
number = true;
relativenumber = true;
numberwidth = 2;
signcolumn = "yes";
linebreak = true;
breakat = " ^I!@*-+;:,./?";
scrolloff = 4;
sidescrolloff = 4;
winbar = "";
foldlevel = 99;
foldlevelstart = 99;
};
}

View file

@ -1,171 +0,0 @@
{ pkgs, ... }:
{
plugins.oil = {
enable = true;
settings = {
keymaps = {
"q" = "actions.close";
};
columns = [
"icon"
"permissions"
"size"
"mtime"
];
};
};
extraPlugins = [ pkgs.vimPlugins.snacks-nvim ];
extraConfigLua = /* lua */ ''
local Snacks = require("snacks");
local filter_lsp_definitions = function(item)
if item.file:match("/react/ts5.0/") or item.file:match("react.d.ts") then
return false
end
return true
end
Snacks.setup({
bigfile = { enabled = true },
bufdelete = { enabled = true },
git = { enabled = true },
indent = { enabled = true },
input = { enabled = true },
notifier = { enabled = true },
picker = {
enabled = true,
prompt = "λ ",
layout = { preset = "ivy" },
},
statuscolumn = { enabled = true },
})
'';
keymaps = [
# Git
{
key = "<leader>gb";
action.__raw = "function() Snacks.git.blame_line() end";
options.desc = "Show git blame for current line";
}
# Picker
{
key = "<leader>.";
action.__raw = "function() Snacks.picker.files({ hidden = true }) end";
options.desc = "Files";
}
{
key = "<leader><leader>";
action.__raw = "function() Snacks.picker.git_files() end";
options.desc = "Git files";
}
# Find
{
key = "<leader>fr";
action.__raw = "function() Snacks.picker.recent() end";
options.desc = "Recent";
}
{
key = "<leader>fp";
action.__raw = "function() Snacks.picker.projects() end";
options.desc = "Projects";
}
{
key = "<leader>bb";
action.__raw = "function() Snacks.picker.buffers() end";
options.desc = "List buffers";
}
{
key = "<leader>bd";
action.__raw = "function() Snacks.bufdelete() end";
options.desc = "Delete buffer";
}
{
key = "<leader>bD";
action.__raw = "function() Snacks.bufdelete.all() end";
options.desc = "Delete all buffers";
}
{
key = "<leader>bo";
action.__raw = "function() Snacks.bufdelete.other() end";
options.desc = "Delete other buffers";
}
# Search
{
key = "<leader>ss";
action.__raw = "function() Snacks.picker.grep() end";
options.desc = "Grep";
}
{
mode = [
"n"
"x"
];
key = "<leader>sw";
action.__raw = "function() Snacks.picker.grep_word() end";
options.desc = "Visual selection or word";
}
{
key = "<leader>su";
action.__raw = "function() Snacks.picker.undo() end";
options.desc = "Undo History";
}
# Diagnostics
{
key = "<leader>td";
action.__raw = "function() Snacks.picker.diagnostics_buffer() end";
options.desc = "Buffer Diagnostics";
}
{
key = "<leader>ta";
action.__raw = "function() Snacks.picker.diagnostics() end";
options.desc = "Diagnostics";
}
# LSP
{
key = "gd";
action.__raw = "function() Snacks.picker.lsp_definitions({ filter = { filter = filter_lsp_definitions } }) end";
options.desc = "Goto Definition";
}
{
key = "gD";
action.__raw = "function() Snacks.picker.lsp_declarations() end";
options.desc = "Goto Declaration";
}
{
key = "grr";
action.__raw = "function() Snacks.picker.lsp_references() end";
options = {
desc = "References";
nowait = true;
};
}
{
key = "gI";
action.__raw = "function() Snacks.picker.lsp_implementations() end";
options.desc = "Goto Implementation";
}
{
key = "gy";
action.__raw = "function() Snacks.picker.lsp_type_definitions() end";
options.desc = "Goto T[y]pe Definition";
}
# Notifications and highlights
{
key = "<leader>on";
action.__raw = "function() Snacks.notifier.show_history() end";
options.desc = "Open notification history";
}
{
key = "<leader>oh";
action.__raw = "function() Snacks.picker.highlights() end";
options.desc = "List highlights";
}
{
key = "<leader>n";
action = "<cmd>Oil<cr>";
options.desc = "Opens file explorer";
}
];
}

View file

@ -1,96 +0,0 @@
{
plugins.lualine = {
enable = true;
settings = {
options = {
theme = {
__raw = "winterly_lualine";
};
icons_enabled = false;
component_separators = {
left = "|";
right = "|";
};
section_separators = {
left = "";
right = "";
};
};
sections = {
lualine_a = [
{
__unkeyed-1 = "mode";
fmt = {
__raw = "function(str) return str:sub(1, 1) end";
};
}
];
lualine_b = [
{
__unkeyed-1 = "filename";
file_status = true;
newfile_status = false;
path = 4;
shorting_target = 120;
symbols = {
modified = "[+]";
readonly = "[-]";
unnamed = "[No Name]";
newfile = "[New]";
};
}
"encoding"
];
lualine_c = null;
lualine_x = null;
lualine_y = [
"branch"
"diff"
"diagnostics"
];
lualine_z = [
"location"
];
};
};
# Sets up my custom colorscheme
luaConfig.pre = /* lua */ ''
local palette = require("dnsc.palette")
local winterly_lualine = {
normal = {
a = { bg = palette.magenta, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.magenta },
c = { bg = palette.bg_secondary, fg = palette.magenta },
},
insert = {
a = { bg = palette.cyan_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.cyan_bright },
c = { bg = palette.bg_secondary, fg = palette.cyan_bright },
},
visual = {
a = { bg = palette.blue_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.blue_bright },
c = { bg = palette.bg_secondary, fg = palette.blue_bright },
},
replace = {
a = { bg = palette.red_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.red_bright },
c = { bg = palette.bg_secondary, fg = palette.red_bright },
},
command = {
a = { bg = palette.green_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.green_bright },
c = { bg = palette.bg_secondary, fg = palette.green_bright },
},
inactive = {
a = { bg = palette.bg_secondary, fg = palette.fg_dim },
b = { bg = palette.bg_secondary, fg = palette.fg_dim },
c = { bg = palette.bg_secondary, fg = palette.fg_dim },
},
}
'';
};
}

View file

@ -1,5 +0,0 @@
setlocal expandtab
setlocal smartindent
setlocal tabstop=2
setlocal shiftwidth=2
setlocal conceallevel=2

View file

@ -1,5 +0,0 @@
setlocal expandtab
setlocal smartindent
setlocal tabstop=2
setlocal shiftwidth=2
setlocal conceallevel=2

View file

@ -1,6 +0,0 @@
setlocal expandtab
setlocal smartindent
setlocal tabstop=2
setlocal shiftwidth=2
setlocal conceallevel=2
setlocal nocompatible

View file

@ -1 +0,0 @@
/nix/store/mp57l6qar04fcicsvmryl7fjzq6wwfmp-home-manager-files/.config/nvim/colors/winterly.lua

View file

@ -1,7 +0,0 @@
au BufNewFile,BufRead Appfile set ft=ruby
au BufNewFile,BufRead Deliverfile set ft=ruby
au BufNewFile,BufRead Fastfile set ft=ruby
au BufNewFile,BufRead Gymfile set ft=ruby
au BufNewFile,BufRead Matchfile set ft=ruby
au BufNewFile,BufRead Snapfile set ft=ruby
au BufNewFile,BufRead Scanfile set ft=ruby

View file

@ -1 +0,0 @@
/nix/store/mp57l6qar04fcicsvmryl7fjzq6wwfmp-home-manager-files/.config/nvim/init.lua

View file

@ -1,23 +0,0 @@
{
"blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" },
"codecompanion.nvim": { "branch": "main", "commit": "a8c696d1fc4268085e4306d54af39b07be884b17" },
"conform.nvim": { "branch": "master", "commit": "cde4da5c1083d3527776fee69536107d98dae6c9" },
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
"follow-md-links.nvim": { "branch": "main", "commit": "728d96d268eef9666f0ee77a083e7e2f0b44f607" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitportal.nvim": { "branch": "main", "commit": "2420f27c6269184f13d018f347f36eb120403110" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
"mini.pairs": { "branch": "main", "commit": "b316e68f2d242d5bd010deaab645daa27ed86297" },
"nvim-surround": { "branch": "main", "commit": "fcfa7e02323d57bfacc3a141f8a74498e1522064" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"schemastore.nvim": { "branch": "main", "commit": "eed1834170f343c14a6768f085b26b3571a55302" },
"snacks.nvim": { "branch": "main", "commit": "3c5c23ba91e608bd89bb36d76cb005aa63d20dbf" },
"substitute.nvim": { "branch": "main", "commit": "9db749a880e3dd3b0eb57f698aa8f1e1630e1f25" },
"vim-cool": { "branch": "master", "commit": "9ea940c0d537e55de0de4c0298c04b976960fb12" },
"vim-dispatch": { "branch": "master", "commit": "a2ff28abdb2d89725192db5b8562977d392a4d3f" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
}

View file

@ -1,25 +0,0 @@
local function get_typescript_server_path(root_dir)
local project_roots = vim.fs.find("node_modules", { path = root_dir, upward = true, limit = math.huge })
for _, project_root in ipairs(project_roots) do
local typescript_path = project_root .. "/typescript"
local stat = vim.loop.fs_stat(typescript_path)
if stat and stat.type == "directory" then
return typescript_path .. "/lib"
end
end
return ""
end
return {
cmd = { "astro-ls", "--stdio" },
filetypes = { "astro" },
root_markers = { "package.json", "tsconfig.json", "jsconfig.json", ".git" },
init_options = {
typescript = {},
},
before_init = function(_, config)
if config.init_options and config.init_options.typescript and not config.init_options.typescript.tsdk then
config.init_options.typescript.tsdk = get_typescript_server_path(config.root_dir)
end
end,
}

View file

@ -1,34 +0,0 @@
---@type vim.lsp.Config
return {
cmd = function(dispatchers, config)
local cmd = 'biome'
local local_cmd = (config or {}).root_dir and config.root_dir .. '/node_modules/.bin/biome'
if local_cmd and vim.fn.executable(local_cmd) == 1 then
cmd = local_cmd
end
return vim.lsp.rpc.start({ cmd, 'lsp-proxy' }, dispatchers)
end,
filetypes = {
'astro',
'css',
'graphql',
'html',
'javascript',
'javascriptreact',
'json',
'jsonc',
'svelte',
'typescript',
'typescriptreact',
'vue',
},
workspace_required = true,
root_markers = {
'package-lock.json',
'yarn.lock',
'pnpm-lock.yaml',
'bun.lockb',
'bun.lock',
'deno.lock',
},
}

View file

@ -1,152 +0,0 @@
local utils = require("dnsc.utils")
local lsp = vim.lsp
local eslint_config_files = {
".eslintrc",
".eslintrc.js",
".eslintrc.cjs",
".eslintrc.yaml",
".eslintrc.yml",
".eslintrc.json",
"eslint.config.js",
"eslint.config.mjs",
"eslint.config.cjs",
"eslint.config.ts",
"eslint.config.mts",
"eslint.config.cts",
}
---@type vim.lsp.Config
return {
cmd = { "vscode-eslint-language-server", "--stdio" },
filetypes = {
"javascript",
"javascriptreact",
"javascript.jsx",
"typescript",
"typescriptreact",
"typescript.tsx",
"vue",
"svelte",
"astro",
"htmlangular",
},
workspace_required = true,
on_attach = function(client, bufnr)
vim.api.nvim_buf_create_user_command(0, "LspEslintFixAll", function()
client:request_sync("workspace/executeCommand", {
command = "eslint.applyAllFixes",
arguments = {
{
uri = vim.uri_from_bufnr(bufnr),
version = lsp.util.buf_versions[bufnr],
},
},
}, nil, bufnr)
end, {})
end,
root_markers = eslint_config_files,
-- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation.
settings = {
validate = "on",
packageManager = nil,
useESLintClass = false,
experimental = {
useFlatConfig = false,
},
codeActionOnSave = {
enable = false,
mode = "all",
},
format = true,
quiet = false,
onIgnoredFiles = "off",
rulesCustomizations = {},
run = "onType",
problems = {
shortenToSingleLine = false,
},
-- nodePath configures the directory in which the eslint server should start its node_modules resolution.
-- This path is relative to the workspace folder (root dir) of the server instance.
nodePath = "",
-- use the workspace folder location or the file location (if no workspace folder is open) as the working directory
workingDirectory = { mode = "auto" },
codeAction = {
disableRuleComment = {
enable = true,
location = "separateLine",
},
showDocumentation = {
enable = true,
},
},
},
before_init = function(_, config)
-- The "workspaceFolder" is a VSCode concept. It limits how far the
-- server will traverse the file system when locating the ESLint config
-- file (e.g., .eslintrc).
local root_dir = config.root_dir
if root_dir then
config.settings = config.settings or {}
config.settings.workspaceFolder = {
uri = root_dir,
name = vim.fn.fnamemodify(root_dir, ":t"),
}
-- Support flat config files
-- They contain 'config' in the file name
local flat_config_files = vim.tbl_filter(function(file)
return file:match("config")
end, eslint_config_files)
for _, file in ipairs(flat_config_files) do
local found_files = vim.fn.globpath(root_dir, file, true, true)
-- Filter out files inside node_modules
local filtered_files = {}
for _, found_file in ipairs(found_files) do
if string.find(found_file, "[/\\]node_modules[/\\]") == nil then
table.insert(filtered_files, found_file)
end
end
if #filtered_files > 0 then
config.settings.experimental = config.settings.experimental or {}
config.settings.experimental.useFlatConfig = true
break
end
end
-- Support Yarn2 (PnP) projects
local pnp_cjs = root_dir .. "/.pnp.cjs"
local pnp_js = root_dir .. "/.pnp.js"
if vim.uv.fs_stat(pnp_cjs) or vim.uv.fs_stat(pnp_js) then
local cmd = config.cmd
config.cmd = vim.list_extend({ "yarn", "exec" }, cmd)
end
end
end,
handlers = {
["eslint/openDoc"] = function(_, result)
if result then
vim.ui.open(result.url)
end
return {}
end,
["eslint/confirmESLintExecution"] = function(_, result)
if not result then
return
end
return 4 -- approved
end,
["eslint/probeFailed"] = function()
vim.notify("[lspconfig] ESLint probe failed.", vim.log.levels.WARN)
return {}
end,
["eslint/noLibrary"] = function()
vim.notify("[lspconfig] Unable to find ESLint library.", vim.log.levels.WARN)
return {}
end,
},
}

View file

@ -1,99 +0,0 @@
---@brief
---
--- https://github.com/golang/tools/tree/master/gopls
---
--- Google's lsp server for golang.
--- @class go_dir_custom_args
---
--- @field envvar_id string
---
--- @field custom_subdir string?
local mod_cache = nil
local std_lib = nil
---@param custom_args go_dir_custom_args
---@param on_complete fun(dir: string | nil)
local function identify_go_dir(custom_args, on_complete)
local cmd = { "go", "env", custom_args.envvar_id }
vim.system(cmd, { text = true }, function(output)
local res = vim.trim(output.stdout or "")
if output.code == 0 and res ~= "" then
if custom_args.custom_subdir and custom_args.custom_subdir ~= "" then
res = res .. custom_args.custom_subdir
end
on_complete(res)
else
vim.schedule(function()
vim.notify(
("[gopls] identify " .. custom_args.envvar_id .. " dir cmd failed with code %d: %s\n%s"):format(
output.code,
vim.inspect(cmd),
output.stderr
)
)
end)
on_complete(nil)
end
end)
end
---@return string?
local function get_std_lib_dir()
if std_lib and std_lib ~= "" then
return std_lib
end
identify_go_dir({ envvar_id = "GOROOT", custom_subdir = "/src" }, function(dir)
if dir then
std_lib = dir
end
end)
return std_lib
end
---@return string?
local function get_mod_cache_dir()
if mod_cache and mod_cache ~= "" then
return mod_cache
end
identify_go_dir({ envvar_id = "GOMODCACHE" }, function(dir)
if dir then
mod_cache = dir
end
end)
return mod_cache
end
---@param fname string
---@return string?
local function get_root_dir(fname)
if mod_cache and fname:sub(1, #mod_cache) == mod_cache then
local clients = vim.lsp.get_clients({ name = "gopls" })
if #clients > 0 then
return clients[#clients].config.root_dir
end
end
if std_lib and fname:sub(1, #std_lib) == std_lib then
local clients = vim.lsp.get_clients({ name = "gopls" })
if #clients > 0 then
return clients[#clients].config.root_dir
end
end
return vim.fs.root(fname, "go.work") or vim.fs.root(fname, "go.mod") or vim.fs.root(fname, ".git")
end
---@type vim.lsp.Config
return {
cmd = { "gopls" },
filetypes = { "go", "gomod", "gowork", "gotmpl" },
root_dir = function(bufnr, on_dir)
local fname = vim.api.nvim_buf_get_name(bufnr)
get_mod_cache_dir()
get_std_lib_dir()
-- see: https://github.com/neovim/nvim-lspconfig/issues/804
on_dir(get_root_dir(fname))
end,
}

View file

@ -1,15 +0,0 @@
return {
cmd = { "vscode-json-language-server", "--stdio" },
filetypes = { "json", "jsonc" },
init_options = {
provideFormatter = true,
},
root_markers = { ".git" },
single_file_support = true,
settings = {
json = {
schemas = require("schemastore").json.schemas(),
validate = { enable = true },
},
},
}

View file

@ -1,46 +0,0 @@
return {
cmd = { "lua-language-server" },
filetypes = { "lua" },
root_markers = {
".luarc.json",
".luarc.jsonc",
".luacheckrc",
".stylua.toml",
"stylua.toml",
"selene.toml",
"selene.yml",
".git",
},
single_file_support = true,
log_level = vim.lsp.protocol.MessageType.Warning,
on_init = function(client)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if
path ~= vim.fn.stdpath("config")
and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc"))
then
return
end
end
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
runtime = {
version = "LuaJIT",
},
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
},
},
})
end,
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
},
},
},
}

View file

@ -1,5 +0,0 @@
return {
cmd = { "nil" },
filetypes = { "nix" },
root_markers = { "flake.nix", ".git" },
}

View file

@ -1,153 +0,0 @@
function root_markers_with_field(root_files, new_names, field, fname)
local path = vim.fn.fnamemodify(fname, ":h")
local found = vim.fs.find(new_names, { path = path, upward = true })
for _, f in ipairs(found or {}) do
-- Match the given `field`.
for line in io.lines(f) do
if line:find(field) then
root_files[#root_files + 1] = vim.fs.basename(f)
break
end
end
end
return root_files
end
function insert_package_json(root_files, field, fname)
return root_markers_with_field(root_files, { "package.json", "package.json5" }, field, fname)
end
return {
cmd = { "tailwindcss-language-server", "--stdio" },
-- filetypes copied and adjusted from tailwindcss-intellisense
filetypes = {
-- html
"aspnetcorerazor",
"astro",
"astro-markdown",
"blade",
"clojure",
"django-html",
"htmldjango",
"edge",
"eelixir", -- vim ft
"elixir",
"ejs",
"erb",
"eruby", -- vim ft
"gohtml",
"gohtmltmpl",
"haml",
"handlebars",
"hbs",
"html",
"htmlangular",
"html-eex",
"heex",
"jade",
"leaf",
"liquid",
"markdown",
"mdx",
"mustache",
"njk",
"nunjucks",
"php",
"razor",
"slim",
"twig",
-- css
"css",
"less",
"postcss",
"sass",
"scss",
"stylus",
"sugarss",
-- js
"javascript",
"javascriptreact",
"reason",
"rescript",
"typescript",
"typescriptreact",
-- mixed
"vue",
"svelte",
"templ",
},
settings = {
tailwindCSS = {
validate = true,
lint = {
cssConflict = "warning",
invalidApply = "error",
invalidScreen = "error",
invalidVariant = "error",
invalidConfigPath = "error",
invalidTailwindDirective = "error",
recommendedVariantOrder = "warning",
},
classAttributes = {
"class",
"className",
"class:list",
"classList",
"ngClass",
},
includeLanguages = {
eelixir = "html-eex",
elixir = "phoenix-heex",
eruby = "erb",
heex = "phoenix-heex",
htmlangular = "html",
templ = "html",
},
},
},
before_init = function(_, config)
if not config.settings then
config.settings = {}
end
if not config.settings.editor then
config.settings.editor = {}
end
if not config.settings.editor.tabSize then
config.settings.editor.tabSize = vim.lsp.util.get_effective_tabstop()
end
end,
workspace_required = true,
root_dir = function(bufnr, on_dir)
local root_files = {
-- Generic
"tailwind.config.js",
"tailwind.config.cjs",
"tailwind.config.mjs",
"tailwind.config.ts",
"postcss.config.js",
"postcss.config.cjs",
"postcss.config.mjs",
"postcss.config.ts",
-- Phoenix
"assets/tailwind.config.js",
"assets/tailwind.config.cjs",
"assets/tailwind.config.mjs",
"assets/tailwind.config.ts",
-- Django
"theme/static_src/tailwind.config.js",
"theme/static_src/tailwind.config.cjs",
"theme/static_src/tailwind.config.mjs",
"theme/static_src/tailwind.config.ts",
"theme/static_src/postcss.config.js",
-- Rails
"app/assets/stylesheets/application.tailwind.css",
"app/assets/tailwind/application.css",
}
local fname = vim.api.nvim_buf_get_name(bufnr)
root_files = insert_package_json(root_files, "tailwindcss", fname)
root_files = root_markers_with_field(root_files, { "mix.lock" }, "tailwind", fname)
on_dir(vim.fs.dirname(vim.fs.find(root_files, { path = fname, upward = true })[1]))
end,
}

View file

@ -1,22 +0,0 @@
return {
cmd = { "typescript-language-server", "--stdio" },
filetypes = {
"javascript",
"javascriptreact",
"javascript.jsx",
"typescript",
"typescriptreact",
"typescript.tsx",
},
root_markers = { "tsconfig.json", "package.json", ".git" },
init_options = {
hostInfo = "neovim",
preferences = {
includeCompletionsForModuleExports = true,
includeCompletionsForImportStatements = true,
importModuleSpecifierPreference = "relative",
importModuleSpecifierEnding = "minimal",
},
},
single_file_support = true,
}

View file

@ -1,10 +0,0 @@
local opts = { noremap = true, silent = true, expr = true }
-- Non-leader general keybindings
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", opts)
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", opts)
vim.keymap.set("n", "<C-d>", "<C-d>zz", { desc = "Move down" })
vim.keymap.set("n", "<C-u>", "<C-u>zz", { desc = "Move up" })
vim.keymap.set("n", "n", "nzzzv", { desc = "Move to next occurence" })
vim.keymap.set("n", "N", "Nzzzv", { desc = "Move to next occurence" })
vim.keymap.set("n", "<C-f>", "<Nop>")

View file

@ -1,80 +0,0 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.cmd([[colorscheme winterly]])
local options = {
backup = false, -- creates a backup file
clipboard = "unnamedplus", -- allows neovim to access the system clipboard
cmdheight = 1, -- more space in the neovim command line for displaying messages
completeopt = { "menu", "menuone", "noselect" }, -- mostly just for cmp
conceallevel = 0, -- so that `` is visible in markdown files
fileencoding = "utf-8", -- the encoding written to a file
hlsearch = true, -- highlight all matches on previous search pattern
ignorecase = true, -- ignore case in search patterns
mouse = "a", -- allow the mouse to be used in neovim
pumheight = 10, -- pop up menu height
showmode = false, -- we don't need to see things like -- INSERT -- anymore
smartindent = true,
breakindent = true,
showtabline = 0, -- always show tabs
smartcase = true, -- smart case
splitbelow = true, -- force all horizontal splits to go below current window
splitright = true, -- force all vertical splits to go to the right of current window
swapfile = false, -- creates a swapfile
termguicolors = true, -- set term gui colors (most terminals support this)
timeoutlen = 600, -- time to wait for a mapped sequence to complete (in milliseconds)
undofile = true, -- enable persistent undo
updatetime = 230, -- faster completion (4000ms default)
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
expandtab = true, -- convert tabs to spaces
shiftwidth = 2, -- the number of spaces inserted for each indentation
tabstop = 2, -- insert 2 spaces for a tab
cursorline = true, -- highlight the current line
number = true, -- set numbered lines
relativenumber = true, -- set relative numbered lines
numberwidth = 4, -- set number column width to 2 {default 4}
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
linebreak = true,
breakat = " ^I!@*-+;:,./?",
scrolloff = 6, -- is one of my fav
sidescrolloff = 4,
winbar = nil,
foldlevel = 99,
foldlevelstart = 99,
}
vim.opt.shortmess:append("c")
for k, v in pairs(options) do
vim.opt[k] = v
end
-- Setup lazy.nvim
require("lazy").setup({
spec = {
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "winterly" } },
-- automatically check for plugin updates
checker = { enabled = false },
})

View file

@ -1,34 +0,0 @@
vim.lsp.enable("ts_ls")
vim.lsp.enable("lua_ls")
vim.lsp.enable("jsonls")
vim.lsp.enable("nil_ls")
vim.lsp.enable("astro")
vim.lsp.enable("tailwindcss")
vim.lsp.enable("gopls")
vim.lsp.enable("eslint")
vim.lsp.enable("biome")
vim.diagnostic.config({
virtual_text = false,
signs = true,
underline = true,
update_in_insert = false,
severity_sort = false,
})
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
vim.keymap.set(
"n",
"<leader>e",
"<cmd>lua vim.diagnostic.open_float()<cr>",
{ buffer = args.buf, desc = "Show diagnostics on current line" }
)
vim.keymap.set(
"n",
"<leader>ca",
"<cmd>lua vim.lsp.buf.code_action()<cr>",
{ buffer = args.buf, desc = "Code actions for current line" }
)
end,
})

View file

@ -1 +0,0 @@
/nix/store/mp57l6qar04fcicsvmryl7fjzq6wwfmp-home-manager-files/.config/nvim/lua/dnsc/palette.lua

View file

@ -1,152 +0,0 @@
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
})
function tbl_flatten(t)
--- @diagnostic disable-next-line:deprecated
return nvim_eleven and vim.iter(t):flatten(math.huge):totable() or vim.tbl_flatten(t)
end
function search_ancestors(startpath, func)
if nvim_eleven then
validate("func", func, "function")
end
if func(startpath) then
return startpath
end
local guard = 100
for path in vim.fs.parents(startpath) do
-- Prevent infinite recursion if our algorithm breaks
guard = guard - 1
if guard == 0 then
return
end
if func(path) then
return path
end
end
end
local function escape_wildcards(path)
return path:gsub("([%[%]%?%*])", "\\%1")
end
function strip_archive_subpath(path)
-- Matches regex from zip.vim / tar.vim
path = vim.fn.substitute(path, "zipfile://\\(.\\{-}\\)::[^\\\\].*$", "\\1", "")
path = vim.fn.substitute(path, "tarfile:\\(.\\{-}\\)::.*$", "\\1", "")
return path
end
local function root_pattern(...)
local patterns = tbl_flatten({ ... })
return function(startpath)
startpath = strip_archive_subpath(startpath)
for _, pattern in ipairs(patterns) do
local match = search_ancestors(startpath, function(path)
for _, p in ipairs(vim.fn.glob(table.concat({ escape_wildcards(path), pattern }, "/"), true, true)) do
if vim.loop.fs_stat(p) then
return path
end
end
end)
if match ~= nil then
return match
end
end
end
end
local function filter(arr, fn)
if type(arr) ~= "table" then
return arr
end
local filtered = {}
for k, v in pairs(arr) do
if fn(v, k, arr) then
table.insert(filtered, v)
end
end
return filtered
end
local function filterReactDTS(value)
-- Depending on typescript version either uri or targetUri is returned
if value.uri then
return string.match(value.uri, "%.d.ts") == nil
elseif value.targetUri then
return string.match(value.targetUri, "%.d.ts") == nil
end
end
local project_types = {
["main.odin"] = "odin run .",
["package.json"] = "pnpm run dev",
["Makefile"] = "make",
["flake.nix"] = "sudo just deploy",
}
local function find_project_type()
for marker, _ in pairs(project_types) do
if vim.fn.glob(marker) ~= "" then
return marker
end
end
return nil
end
local function compile_project()
local marker = find_project_type()
if not marker then
vim.notify("No recognized project type found", vim.log.levels.WARN)
return
end
local cmd = project_types[marker]
-- Create a new terminal buffer and run the command
vim.cmd("botright new") -- Create new window at bottom
vim.cmd("terminal " .. cmd)
-- Enter normal mode and hide the buffer number
vim.cmd("setlocal nonumber")
vim.cmd("setlocal norelativenumber")
vim.cmd("startinsert")
end
local function root_markers_with_field(root_files, new_names, field, fname)
local path = vim.fn.fnamemodify(fname, ":h")
local found = vim.fs.find(new_names, { path = path, upward = true })
for _, f in ipairs(found or {}) do
-- Match the given `field`.
for line in io.lines(f) do
if line:find(field) then
root_files[#root_files + 1] = vim.fs.basename(f)
break
end
end
end
return root_files
end
local function insert_package_json(root_files, field, fname)
return root_markers_with_field(root_files, { "package.json", "package.json5" }, field, fname)
end
return {
compile_project = compile_project,
filter = filter,
filterReactDTS = filterReactDTS,
root_pattern = root_pattern,
insert_package_json = insert_package_json,
root_markers_with_field = root_markers_with_field,
}

View file

@ -1,49 +0,0 @@
return {
"saghen/blink.cmp",
dependencies = { "rafamadriz/friendly-snippets" },
version = "1.*",
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
keymap = {
preset = "enter",
["<Tab>"] = { "select_next", "fallback" },
["<S-Tab>"] = { "select_prev", "fallback" },
["<C-k>"] = { "show_documentation", "hide_documentation" },
},
appearance = {
nerd_font_variant = "mono",
},
completion = {
documentation = {
auto_show = false,
},
list = {
selection = {
preselect = false,
auto_insert = true,
},
},
},
signature = {
enabled = true,
},
sources = {
default = { "lsp", "path", "snippets", "buffer" },
per_filetype = {
sql = { "dadbod" },
mysql = { "dadbod" },
plsql = { "dadbod" },
codecompanion = { "codecompanion" },
},
providers = {
dadbod = { module = "vim_dadbod_completion.blink" },
},
},
fuzzy = { implementation = "prefer_rust_with_warning" },
cmdline = {
completion = { menu = { auto_show = true } },
},
},
opts_extend = { "sources.default" },
}

View file

@ -1,26 +0,0 @@
return {
"olimorris/codecompanion.nvim",
config = function()
require("codecompanion").setup({
strategies = {
chat = {
adapter = "anthropic",
},
inline = {
adapter = "anthropic",
},
},
})
vim.cmd([[cab cc CodeCompanion]])
end,
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
keys = {
{ "<leader>cc", "<cmd>CodeCompanionChat Toggle<cr>", desc = "Open companion chat", mode = "n" },
{ "<leader>ca", "<cmd>CodeCompanionActions<cr>", desc = "Open companion actions", mode = "n" },
{ "ga", "<cmd>CodeCompanionChat Add<cr>", desc = "Add selection", mode = "v" },
},
}

View file

@ -1,28 +0,0 @@
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
typescriptreact = { "biome-check", "prettierd", stop_after_first = true },
astro = { "prettierd" },
typescript = { "biome-check", "prettierd", stop_after_first = true },
javascript = { "biome-check", "prettierd", stop_after_first = true },
javascriptreact = { "biome-check", "prettierd", stop_after_first = true },
html = { "prettierd" },
htmlangular = { "prettierd" },
css = { "biome-check", "prettierd", stop_after_first = true },
yaml = { "prettierd" },
markdown = { "prettierd" },
json = { "biome-check", "prettierd", stop_after_first = true },
lua = { "stylua" },
go = { "goimports" },
gomod = { "goimports" },
gowork = { "goimports" },
gotmpl = { "goimports" },
},
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 500,
lsp_format = "fallback",
},
},
}

View file

@ -1,3 +0,0 @@
return {
"tpope/vim-dispatch",
}

View file

@ -1,25 +0,0 @@
return {
"folke/flash.nvim",
event = "VeryLazy",
opts = {},
config = function()
vim.api.nvim_create_autocmd("BufReadPost", {
pattern = "quickfix",
callback = function()
vim.keymap.set("n", "<CR>", "<CR>", { buffer = true })
end,
})
end,
keys = {
{
"<CR>",
mode = { "n", "x", "o" },
function()
if vim.bo.filetype ~= "qf" then
require("flash").jump()
end
end,
desc = "Flash",
},
},
}

View file

@ -1,24 +0,0 @@
return {
"trevorhauter/gitportal.nvim",
opts = {
always_include_current_line = true,
switch_branch_or_commit_upon_ingestion = "ask_first",
},
keys = {
{
"<leader>gll",
"<cmd>GitPortal<cr>",
desc = "Browse file at git remote",
},
{
"<leader>gly",
"<cmd>GitPortal copy_link_to_clipboard<cr>",
desc = "Yank git link to clipboard",
},
{
"<leader>glo",
"<cmd>GitPortal open_link<cr>",
desc = "Browse file at git remote",
},
},
}

View file

@ -1,4 +0,0 @@
return {
"romainl/vim-cool",
"tpope/vim-sleuth",
}

View file

@ -1,78 +0,0 @@
local palette = require("dnsc.palette")
local modus_vivendi_tinted = {
normal = {
a = { bg = palette.magenta, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.magenta },
c = { bg = palette.bg_secondary, fg = palette.magenta },
},
insert = {
a = { bg = palette.cyan_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.cyan_bright },
c = { bg = palette.bg_secondary, fg = palette.cyan_bright },
},
visual = {
a = { bg = palette.blue_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.blue_bright },
c = { bg = palette.bg_secondary, fg = palette.blue_bright },
},
replace = {
a = { bg = palette.red_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.red_bright },
c = { bg = palette.bg_secondary, fg = palette.red_bright },
},
command = {
a = { bg = palette.green_bright, fg = palette.bg, gui = "bold" },
b = { bg = palette.bg_secondary, fg = palette.green_bright },
c = { bg = palette.bg_secondary, fg = palette.green_bright },
},
inactive = {
a = { bg = palette.bg_secondary, fg = palette.fg_dim },
b = { bg = palette.bg_secondary, fg = palette.fg_dim },
c = { bg = palette.bg_secondary, fg = palette.fg_dim },
},
}
return {
"nvim-lualine/lualine.nvim",
opts = {
options = {
theme = modus_vivendi_tinted,
icons_enabled = false,
-- globalstatus = true
component_separators = { left = "|", right = "|" },
section_separators = { left = "", right = "" },
},
winbar = {},
sections = {
lualine_a = {
{
"mode",
fmt = function(str)
return str:sub(1, 1)
end,
},
},
lualine_b = {
{
"filename",
file_status = true,
newfile_status = false,
path = 1,
shorting_target = 120,
symbols = {
modified = "[+]", -- Text to show when the file is modified.
readonly = "[-]", -- Text to show when the file is non-modifiable or readonly.
unnamed = "[No Name]", -- Text to show for unnamed buffers.
newfile = "[New]", -- Text to show for newly created file before first write
},
},
"encoding",
},
lualine_c = {},
lualine_x = {},
lualine_y = { "branch", "diff", "diagnostics" },
lualine_z = { "progress" },
},
},
}

View file

@ -1,7 +0,0 @@
return {
"jghauser/follow-md-links.nvim",
ft = { "markdown" },
config = function()
vim.keymap.set("n", "<bs>", ":edit #<cr>", { silent = true })
end,
}

View file

@ -1,4 +0,0 @@
return {
"echasnovski/mini.pairs",
opts = {},
}

View file

@ -1,6 +0,0 @@
return {
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
opts = {},
}

View file

@ -1,19 +0,0 @@
return {
"stevearc/oil.nvim",
opts = {
keymaps = {
["q"] = "actions.close",
},
columns = {
"icon",
"permissions",
"size",
"mtime",
},
},
-- stylua: ignore
keys = {
{ "<leader>n", "<cmd>Oil<cr>", desc = "Open file browser", mode = "n" },
}
,
}

View file

@ -1,3 +0,0 @@
return {
'b0o/schemastore.nvim'
}

View file

@ -1,217 +0,0 @@
---@module 'snacks'
local filter_lsp_definitions = function(item)
if item.file:match("/react/ts5.0/") or item.file:match("react.d.ts") then
return false
end
return true
end
return {
"folke/snacks.nvim",
priority = 1000,
lazy = false,
opts = {
bigfile = { enabled = true },
bufdelete = { enabled = true },
git = { enabled = true },
-- TODO: Integrate GH and see how that works out
-- gh = {
-- enabled = true
-- }
indent = {
enabled = true,
},
input = { enabled = true },
lazygit = {
enabled = true,
},
notifier = { enabled = true },
picker = {
enabled = true,
prompt = "λ ",
},
statuscolumn = { enabled = true },
zen = { enabled = true },
},
keys = {
-- Git
{
"<leader>gg",
function()
Snacks.lazygit()
end,
desc = "Lazygit",
},
{
"<leader>gb",
function()
Snacks.git.blame_line()
end,
desc = "Show git blame for current line",
},
-- Zen Mode
{
"<leader>z",
function()
Snacks.zen()
end,
desc = "Toggle Zen Mode",
},
-- Picker
{
"<leader>.",
function()
Snacks.picker.files({ hidden = true })
end,
desc = "Files",
},
{
"<leader>a",
function()
Snacks.picker.files({ hidden = true, ignored = true })
end,
desc = "All files",
},
{
"<leader><leader>",
function()
Snacks.picker.git_files()
end,
desc = "Git files",
},
-- Find
{
"<leader>fr",
function()
Snacks.picker.recent()
end,
desc = "Recent",
},
{
"<leader>fp",
function()
Snacks.picker.projects()
end,
desc = "Projects",
},
{
"<leader>bb",
function()
Snacks.picker.buffers()
end,
desc = "List buffers",
},
{
"<leader>bd",
function()
Snacks.bufdelete()
end,
desc = "Buffers",
},
{
"<leader>bD",
function()
Snacks.bufdelete.all()
end,
desc = "Buffers",
},
{
"<leader>bo",
function()
Snacks.bufdelete.other()
end,
desc = "Buffers",
},
-- Search
{
"<leader>ss",
function()
Snacks.picker.grep()
end,
desc = "Grep",
},
{
"<leader>sw",
function()
Snacks.picker.grep_word()
end,
desc = "Visual selection or word",
mode = { "n", "x" },
},
{
"<leader>su",
function()
Snacks.picker.undo()
end,
desc = "Undo History",
},
-- Diagnostics
{
"<leader>td",
function()
Snacks.picker.diagnostics_buffer()
end,
desc = "Buffer Diagnostics",
},
{
"<leader>ta",
function()
Snacks.picker.diagnostics()
end,
desc = "Diagnostics",
},
-- LSP
{
"gd",
function()
Snacks.picker.lsp_definitions({ filter = { filter = filter_lsp_definitions } })
end,
desc = "Goto Definition",
},
{
"gD",
function()
Snacks.picker.lsp_declarations()
end,
desc = "Goto Declaration",
},
{
"grr",
function()
Snacks.picker.lsp_references()
end,
nowait = true,
desc = "References",
},
{
"gI",
function()
Snacks.picker.lsp_implementations()
end,
desc = "Goto Implementation",
},
{
"gy",
function()
Snacks.picker.lsp_type_definitions()
end,
desc = "Goto T[y]pe Definition",
},
{
"<leader>on",
function()
Snacks.notifier.show_history()
end,
desc = "Open notification history",
},
{
"<leader>oh",
function()
Snacks.picker.highlights()
end,
desc = "List highlights",
},
},
}

View file

@ -1,13 +0,0 @@
return {
"gbprod/substitute.nvim",
config = function()
local sub = require("substitute")
sub.setup()
vim.keymap.set("n", "s", sub.operator, { noremap = true })
vim.keymap.set("n", "ss", sub.line, { noremap = true })
vim.keymap.set("n", "S", sub.eol, { noremap = true })
vim.keymap.set("x", "s", sub.visual, { noremap = true })
end,
}

View file

@ -1,100 +0,0 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
opts = {
ensure_installed = {
"angular",
"bash",
"c",
"css",
"diff",
"html",
"javascript",
"jsdoc",
"json",
"jsonc",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"odin",
"go",
"goctl",
"gowork",
"gomod",
"gosum",
"gotmpl",
"printf",
"python",
"query",
"regex",
"toml",
"tsx",
"typescript",
"vim",
"vimdoc",
"xml",
"yaml",
},
auto_install = true,
sync_install = false,
ignore_install = {},
modules = {},
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<c-space>",
node_incremental = "<c-space>",
scope_incremental = "<c-s>",
node_decremental = "<M-space>",
},
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]m"] = "@function.outer",
["]]"] = "@class.outer",
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[["] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer",
},
},
swap = {
enable = true,
swap_next = {
["<leader>a"] = "@parameter.inner",
},
swap_previous = {
["<leader>A"] = "@parameter.inner",
},
},
},
},
}

View file

@ -1,153 +0,0 @@
local utils = require("dnsc.utils")
return {
"folke/which-key.nvim",
event = "VeryLazy",
config = function()
local wk = require("which-key")
---@class wk.Opts
local opts = {
icons = { mappings = false },
win = { border = "rounded" },
}
wk.setup(opts)
wk.add({
{ "<leader>o", group = "+open", mode = "n" },
{
"<leader>od",
"<cmd>vsplit | lua vim.lsp.buf.definition()<cr>",
desc = "Go to definition in other window",
mode = "n",
},
{ "<leader>b", group = "+buffer", mode = "n" },
{
"<leader>bn",
"<Cmd>bn<CR>",
desc = "Move to next buffer",
mode = "n",
},
{
"<leader>bp",
"<Cmd>bp<CR>",
desc = "Move to previous buffer",
mode = "n",
},
{
"<leader>bk",
"<Cmd>bn<CR>",
desc = "Kill buffer and window",
mode = "n",
},
{ "<leader>c", group = "+code", mode = "n" },
{
"<leader>cr",
function()
utils.compile_project()
end,
desc = "Compile project",
mode = "n",
},
{ "<leader>f", group = "+file", mode = "n" },
{
"<leader>fn",
"<cmd>enew<cr>",
desc = "Create a new file",
mode = "n",
},
{
"<leader>fs",
"<cmd>w<cr>",
desc = "Save currently opened file",
mode = "n",
},
{ "<leader>qq", "<cmd>qa!<cr>", desc = "Leave neovim", mode = "n" },
{ "<leader>s", group = "+search", mode = "n" },
{ "<leader>g", group = "+git", mode = "n" },
{ "<leader>t", group = "+diagnostics", mode = "n" },
{ "<leader>ta", "<cmd>TodoQuickFix<cr>", desc = "Show all todo comments", mode = "n" },
{ "<leader>w", group = "+window", mode = "n" },
{
"<leader>w+",
":vertical resize +4<CR>",
desc = "Increase window size",
mode = "n",
},
{
"<leader>w-",
":vertical resize -4<CR>",
desc = "Decrease window size",
mode = "n",
},
{
"<leader>wx",
"<C-W>q",
desc = "Close active window",
mode = "n",
},
{
"<leader>wx",
":bd<CR>",
desc = "Kill active window and buffer",
mode = "n",
},
{
"<leader>wh",
"<C-W>h",
desc = "Move to window on left",
mode = "n",
},
{
"<leader>wj",
"<C-W>j",
desc = "Move to window on bottom",
mode = "n",
},
{
"<leader>wk",
"<C-W>k",
desc = "Move to window on top",
mode = "n",
},
{
"<leader>wl",
"<C-W>l",
desc = "Move to window on right",
mode = "n",
},
{
"<leader>ws",
"<cmd>sp<cr>",
desc = "Split windows horizontally",
mode = "n",
},
{
"<leader>wv",
"<cmd>vsp<cr>",
desc = "Split windows vertically",
mode = "n",
},
{
"<leader>wd",
"<cmd>close<cr>",
desc = "Delete window only",
mode = "n",
},
{ "<leader>x", group = "+config", mode = "n" },
{
"<leader>xn",
"<cmd>set number relativenumber<cr>",
desc = "Show relative numbers",
mode = "n",
},
{ "<leader>xr", "<cmd>source $MYVIMRC<cr>", desc = "Reload config", mode = "n" },
})
end,
}

View file

@ -1,9 +0,0 @@
column_width = 120
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
call_parentheses = "Always"
collapse_simple_statement = "Never"
[sort_requires]
enabled = false

View file

@ -1,9 +0,0 @@
{ config, ... }:
{
xdg.configFile."nvim" = {
# mkOutOfStoreSymlink needs an absolute path, otherwise it does not work: https://github.com/nix-community/home-manager/issues/676#issuecomment-1595795685
# TODO: At least make the location of the config folder dynamic so that it works on other machines
source = config.lib.file.mkOutOfStoreSymlink /home/deck/dev/nix-config/modules/nvim/config;
};
}

View file

@ -1,25 +0,0 @@
{
pkgs,
config,
lib,
...
}:
{
xdg.configFile."nvim" = {
# mkOutOfStoreSymlink needs an absolute path, otherwise it does not work: https://github.com/nix-community/home-manager/issues/676#issuecomment-1595795685
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/nix-config/modules/nvim/config";
};
home.packages = lib.mkAfter (
with pkgs;
[
# Some devtools not included in project
# flakes
stylua
lua-language-server
nil
tree-sitter
]
);
}

View file

@ -1,12 +0,0 @@
{
services.openssh = {
enable = true;
settings = {
X11Forwarding = false;
PermitRootLogin = "no";
PasswordAuthentication = false;
};
openFirewall = true;
};
}

View file

@ -1,7 +0,0 @@
{ config, ... }:
{
xdg.configFile."raycast-scripts" = {
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/nix-config/modules/raycast/scripts";
};
}

View file

@ -1,18 +0,0 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Add to Inbox
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
# @raycast.argument1 { "type": "text", "placeholder": "Placeholder" }
# Documentation:
# @raycast.description Adds a task to my org inbox
# @raycast.author dnsc
# @raycast.authorURL https://raycast.com/dnsc
emacsclient -e "(dnsc/add-to-inbox \"* TODO $1\n\")"
echo "Added new task to inbox"

View file

@ -1,20 +0,0 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Emacs Client
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
# Documentation:
# @raycast.description Opens new emacsclient frame
# @raycast.author dnsc
# @raycast.authorURL https://raycast.com/dnsc
emacsclient -a "" -c
gsleep 3s
client_window=$(aerospace list-windows --workspace focused | gcut -d " " -f1)
aerospace focus --window-id $client_window

View file

@ -1,16 +0,0 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Open Agenda
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
# Documentation:
# @raycast.description Opens org agenda.
# @raycast.author dnsc
# @raycast.authorURL https://raycast.com/dnsc
emacsclient -r --eval "(dnsc/open-agenda-only-window)"

View file

@ -1,40 +0,0 @@
{
config,
...
}:
{
# Root SSH
programs.ssh = {
extraConfig = ''
Host dnsc-storage
AddKeysToAgent yes
Hostname u295965.your-storagebox.de
User u295965
IdentityFile /root/.ssh/id_ed25519
IdentitiesOnly yes
Port 23
'';
};
services.restic.backups = {
"dnsc-storage" = {
initialize = true;
passwordFile = config.age.secrets."restic/password".path;
repository = "sftp:dnsc-storage:restic/dnsc-server";
createWrapper = true;
paths = [
"/main/share"
"/data/actual-server"
];
pruneOpts = [
"--keep-last 3"
];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
RandomizedDelaySec = "5h";
};
};
};
}

View file

@ -1,45 +0,0 @@
{ ... }:
{
# Samba
services.samba = {
enable = true;
openFirewall = true;
settings = {
global = {
"workgroup" = "WORKGROUP";
"security" = "user";
#"use sendfile" = "yes";
#"max protocol" = "smb2";
# note: localhost is the ipv6 localhost ::1
"hosts allow" = "192.168.178. 127.0.0.1 localhost";
"hosts deny" = "0.0.0.0/0";
"guest account" = "nobody";
"map to guest" = "bad user";
};
"share" = {
"path" = "/main/share";
"browseable" = "yes";
"writeable" = "yes";
"read only" = "no";
"guest ok" = "yes";
"force user" = "dennis";
"force group" = "users";
};
};
};
services.samba-wsdd = {
enable = true;
openFirewall = true;
};
services.avahi = {
publish.enable = true;
publish.userServices = true;
nssmdns4 = true;
enable = true;
openFirewall = true;
};
}

View file

@ -1,43 +0,0 @@
{ config, ... }:
{
programs.ssh = {
enable = true;
enableDefaultConfig = false;
matchBlocks = {
"*" = {
addKeysToAgent = "yes";
};
"dnsc-machine" = {
hostname = "192.168.178.250";
user = "dennis";
identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519";
identitiesOnly = true;
};
"dnsc-server" = {
hostname = "192.168.178.69";
user = "dennis";
identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519";
identitiesOnly = true;
};
"dnsc-vps-sm" = {
hostname = "91.99.21.186";
user = "dennis";
identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519";
identitiesOnly = true;
};
"dnsc-storage" = {
hostname = "u295965.your-storagebox.de";
user = "u295965";
identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519";
identitiesOnly = true;
port = 23;
};
"dnsc-storage-sftp" = {
hostname = "u295965.your-storagebox.de";
user = "u295965";
identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519";
port = 22;
};
};
};
}

View file

@ -1,9 +0,0 @@
{
programs.gamemode.enable = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
};
}

View file

@ -1,25 +0,0 @@
{
services.syncthing = {
enable = true;
group = "users";
guiAddress = "0.0.0.0:8384";
user = "dennis";
configDir = "/home/dennis/.config/syncthing";
overrideDevices = true;
overrideFolders = true;
settings = {
devices = {
"dnsc-air" = { id = "RYFO5XN-RRZZQI3-4W5DPHO-C7OKL5N-ZUQUBEI-ZKSWUHM-2BMTFRY-MDC7MA3"; };
"dnsc-phone" = { id = "NGHODAF-W646NPR-R5IEL2R-QLULKB6-I4APGMB-5PIM6B6-5HZCLAV-HRTSEQI"; };
};
folders = {
"notes" = {
path = "/home/dennis/notes";
devices = [ "dnsc-air" "dnsc-phone" ];
};
};
};
};
systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true";
}

7
modules/systems.nix Normal file
View file

@ -0,0 +1,7 @@
{
# Currently using ARM on MacOS and x86 on Linux
systems = [
"aarch64-darwin"
"x86_64-linux"
];
}

View file

@ -1,79 +0,0 @@
{ pkgs, ... }:
{
programs.tmux = {
enable = true;
package = pkgs.tmux;
baseIndex = 1;
clock24 = true;
disableConfirmationPrompt = true;
mouse = true;
newSession = true;
prefix = "C-b";
shell = "${pkgs.fish}/bin/fish";
terminal = "screen-256color";
keyMode = "vi";
escapeTime = 0;
plugins = with pkgs; [
{
plugin = tmuxPlugins.resurrect;
extraConfig = ''
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-capture-pane-contents 'on'
'';
}
{
plugin = tmuxPlugins.continuum;
extraConfig = ''
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
set -g @continuum-save-interval '10'
'';
}
];
extraConfig = ''
set -g status-position top
set -g status-style bg=#1d202f,fg=white
set -g status-left ""
set -g status-right "#[bg=default,fg=magenta]>> #S << #[bg=default,fg=white]#H "
set-window-option -g window-status-style 'fg=magenta,bg=#1d202f'
set-window-option -g window-status-format ' #I #[fg=white]#W #[fg=cyan]#F '
set-window-option -g window-status-current-style "fg=black,bg=magenta"
set-window-option -g window-status-current-format " #I #W #F "
set -g pane-border-style fg=#807c9f
set -g pane-active-border-style fg=magenta
set -g message-style "fg=black,bg=red,bold"
unbind %
bind "|" split-window -h
unbind '"'
bind - split-window -l 15 -v
bind r source-file "~/.config/tmux/tmux.conf"
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
bind ? list-keys -a
unbind s
bind s display-popup -h 50% -w 80% -E sessionizer
unbind g
bind g display-popup -h 90% -w 95% -E lazygit
unbind C-x
bind C-x kill-session
unbind v
bind v choose-tree -Zw "join-pane -t '%%'"
'';
};
}

View file

@ -1,58 +0,0 @@
{ pkgs, ... }:
{
programs.tmux = {
enable = true;
package = pkgs.tmux;
baseIndex = 1;
clock24 = true;
disableConfirmationPrompt = true;
mouse = true;
newSession = true;
prefix = "C-a";
terminal = "screen-256color";
keyMode = "vi";
escapeTime = 0;
extraConfig = ''
set -g status-position bottom
set -g status-style bg=#1d202f,fg=white
set -g status-left ""
set -g status-right "#[bg=default,fg=magenta]>> #S << #[bg=default,fg=white]#H "
set-window-option -g window-status-style 'fg=magenta,bg=#1d202f'
set-window-option -g window-status-format ' #I #[fg=white]#W #[fg=cyan]#F '
set-window-option -g window-status-current-style "fg=black,bg=magenta"
set-window-option -g window-status-current-format " #I #W #F "
set -g pane-border-style fg=#807c9f
set -g pane-active-border-style fg=magenta
set -g message-style "fg=black,bg=red,bold"
unbind %
bind "|" split-window -h
unbind '"'
bind - split-window -l 15 -v
bind r source-file "~/.config/tmux/tmux.conf"
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
bind ? list-keys -a
unbind s
bind s display-popup -h 50% -w 80% -E sessionizer
unbind C-x
bind C-x kill-session
unbind v
bind v choose-tree -Zw "join-pane -t '%%'"
'';
};
}

View file

@ -1,11 +0,0 @@
name: dnsc-io
root: ~/dev/dnsc-io
windows:
- dev:
layout: main-horizontal
panes:
- nvim +"lua Snacks.picker.files({ hidden = true })"
- run:
layout: main-vertical
panes:
- "pnpm dev"

View file

@ -1,7 +0,0 @@
name: main
root: ~/
windows:
- default:
layout: main-vertical
panes:
- clear

View file

@ -1,7 +0,0 @@
name: nix-config
root: ~/dev/nix-config/
windows:
- code:
layout: main-horizontal
panes:
- nvim +"lua Snacks.picker.files({ hidden = true })"

View file

@ -1,11 +0,0 @@
name: notes
root: ~/dev/notes
windows:
- code:
layout: main-horizontal
panes:
- nvim +"lua Snacks.picker.files({ hidden = true })"
- run:
layout: even-vertical
panes:
- clear

View file

@ -1,11 +0,0 @@
name: proglog
root: ~/dev/proglog
windows:
- dev:
layout: main-horizontal
panes:
- nvim +"lua Snacks.picker.files({ hidden = true })"
- run:
layout: main-vertical
panes:
- echo ">> Run proglog tasks here"

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