Initial commit

This commit is contained in:
2026-03-31 16:53:11 +02:00
commit d0eba1c834
343 changed files with 34443 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
{
config,
pkgs,
...
}: {
users.users.someone.packages = with pkgs; [
carapace
carapace-bridge
zsh
bash
inshellisense
];
environment.sessionVariables = {
CARAPACE_BRIDGES = "fish,zsh,bash,inshellisense";
CARAPACE_CACHE_DIR = "${config.xdg.cacheHome}/carapace";
};
xdg.configFile."carapace/carapace.toml".text = ''
[integrations.fish]
enabled = true
'';
xdg.configFile."fish/completions/carapace.fish".source = pkgs.runCommand "carapace-fish-init" {} ''
${pkgs.carapace}/bin/carapace _carapace fish > $out
'';
}
+216
View File
@@ -0,0 +1,216 @@
{pkgs, ...}: {
users.users.someone.packages = with pkgs; [
fish
grc
(writeShellScriptBin "hx" ''
${pkgs.helix}/bin/hx "$@"
'')
];
xdg.configFile = {
"fish/config.fish" = {
text = ''
for secret in discordo openrouter github twt gemini context7 exa
if test -f /run/agenix/$secret
set -l val (cat /run/agenix/$secret)
set -l up (string upper $secret)
switch $secret
case discordo
set -gx DISCORDO_TOKEN $val
set -gx OXICORD_TOKEN $val
case openrouter gemini context7 exa
set -gx "$up"_API_KEY $val
case '*'
set -gx "$up"_TOKEN $val
end
end
end
set -gx GNUPGHOME $HOME/.config/gnupg
set -gx NIXPKGS_ALLOW_UNFREE 1
set -gx NIXPKGS_ALLOW_INSECURE 1
set -gx EDITOR nvim
set -gx VISUAL nvim
set -g fish_greeting
# Vi keybindings
fish_vi_key_bindings
# Custom key bindings function (REQUIRED to properly unbind keys)
function fish_user_key_bindings
# Custom bindings
for mode in insert default
bind -M $mode ctrl-backspace backward-kill-word
bind -M $mode ctrl-z undo
bind -M $mode ctrl-b beginning-of-line
bind -M $mode ctrl-e end-of-line
end
bind -M insert \cx\ce edit_command_buffer
bind -M default \cx\ce edit_command_buffer
# History search with prefix (like nushell)
bind -M insert up history-prefix-search-backward
bind -M insert down history-prefix-search-forward
bind -M default up history-prefix-search-backward
bind -M default down history-prefix-search-forward
end
# Cursor shapes per mode
set fish_cursor_default block
set fish_cursor_insert line
set fish_cursor_replace_one underscore
set fish_cursor_visual block
# Syntax colors
set -g fish_color_autosuggestion brblack
set -g fish_color_command blue
set -g fish_color_error red
set -g fish_color_param normal
# Search highlight
set -g fish_color_search_match --background=normal
# Plugin settings
set -Ux fifc_editor nvim
set -U fifc_keybinding \cv
set -g __done_min_cmd_duration 10000
'';
};
"fish/functions/extract.fish" = {
text = ''
function extract
if test -f "$argv[1]"
set file "$argv[1]"
set filename (basename "$file")
set dirname (string replace -r '\.tar\.bz2$|\.tar\.gz$|\.tbz2$|\.tgz$|\.tar$|\.bz2$|\.gz$|\.zip$|\.Z$|\.7z$|\.xz$|\.rar$' "" "$filename")
mkdir -p "$dirname"
switch $file
case "*.tar.bz2"
tar xjf "$file" -C "$dirname"
case "*.tar.gz"
tar xzf "$file" -C "$dirname"
case "*.tbz2"
tar xjf "$file" -C "$dirname"
case "*.tgz"
tar xzf "$file" -C "$dirname"
case "*.tar"
tar xf "$file" -C "$dirname"
case "*.bz2"
bunzip2 -c "$file" >"$dirname/$dirname"
case "*.gz"
gunzip -c "$file" >"$dirname/$dirname"
case "*.zip"
unzip "$file" -d "$dirname"
case "*.Z"
uncompress -c "$file" >"$dirname/$dirname"
case "*.7z"
7z x "$file" -o"$dirname"
case "*.xz"
xz -dc "$file" >"$dirname/$dirname"
case "*.rar"
unrar x "$file" "$dirname"
case "*"
echo "'$file' cannot be extracted via extract()"
end
else
echo "'$argv[1]' is not a valid file"
end
end
'';
};
"fish/functions/weather.fish" = {
text = ''
function weather
if test "$argv[1]" = week
wthrr -f w $argv[2]
else if test -z "$argv[1]"
wthrr -f d
wthrr -f t
else
wthrr -f d $argv[1]
wthrr -f t $argv[1]
end
end
'';
};
"fish/functions/fcd.fish" = {
text = ''
function fcd
set -l dir (fd --type d | sk | string trim)
if test -n "$dir"
z $dir
end
end
'';
};
"fish/functions/installed.fish" = {
text = ''
function installed
nix-store --query --requisites /run/current-system/ | string replace -r '.*?-(.*)' '$1' | sort | uniq | sk
end
'';
};
"fish/functions/installedall.fish" = {
text = ''
function installedall
nix-store --query --requisites /run/current-system/ | sk | wl-copy
end
'';
};
"fish/functions/fm.fish" = {
text = ''
function fm
set -l tmp (mktemp -t "yazi-cwd.XXXXX")
yazi $argv --cwd-file $tmp
set -l cwd (cat $tmp)
if test -n "$cwd" -a "$cwd" != "$PWD"
cd $cwd
end
rm -f $tmp
end
'';
};
"fish/functions/gitgrep.fish" = {
text = ''
function gitgrep
git ls-files | rg $argv
end
'';
};
"fish/conf.d/aliases.fish" = {
text = ''
alias cleanup="sudo nix-collect-garbage --delete-older-than 1d"
alias listgen="sudo nix-env -p /nix/var/nix/profiles/system --list-generations"
alias nixremove="nix-store --gc"
alias bloat="nix path-info -Sh /run/current-system"
alias cleanram="sudo sh -c 'sync; echo 3 > /proc/sys/vm/drop_caches'"
alias trimall="sudo fstrim -va"
alias c="clear"
alias test-build="sudo nixos-rebuild test --flake /etc/nixos#aesthetic"
alias switch-build="sudo nixos-rebuild switch --flake /etc/nixos#aesthetic"
alias add="git add ."
alias commit="git commit"
alias push="git push"
alias pull="git pull"
alias diff="git diff --staged"
alias gcld="git clone --depth 1"
alias koji="meteor"
alias gitui="lazygit"
alias ls="eza -lah --grid -s modified --smart-group --group-directories-first --icons"
alias l="eza -ah --grid -s modified --smart-group --group-directories-first --icons"
alias tree="eza --tree --icons --tree"
alias cat="${pkgs.bat}/bin/bat --paging=never --theme gruvbox-dark"
alias us="systemctl --user"
alias rs="sudo systemctl"
alias zed="zeditor"
alias nl="nl -ba"
alias cp="cp -riv"
alias mv="mv -iv"
alias mkdir="mkdir -pv"
alias less="bat -p --theme gruvbox-dark"
alias myip="curl ip.severijnse.eu"
alias pscpu="ps -eo pid,ppid,cmd,%mem,%cpu,etime --sort=-%cpu | head -n 21"
alias psmem="ps -eo pid,ppid,cmd,%mem,%cpu,etime --sort=-%mem | head -n 21"
alias weer="weather"
alias v="nvim"
alias copy="wl-copy"
alias send="croc"
alias img="loupe"
alias cat-md="glow"
alias du="dust"
alias df="duf"
'';
};
};
}
+143
View File
@@ -0,0 +1,143 @@
{ config, pkgs, ... }:
let
configFile = "starship/starship.toml";
toTOML = (pkgs.formats.toml {}).generate;
in
{
environment.sessionVariables = {
STARSHIP_CONFIG = "${config.xdg.configHome}/${configFile}";
STARSHIP_LOG = "error";
};
users.users.someone.packages = [ pkgs.starship ];
xdg.configFile = {
"${configFile}".source = toTOML "starship.toml" {
"$schema" = "https://starship.rs/config-schema.json";
add_newline = true;
scan_timeout = 5;
command_timeout = 500;
# IMPORTANT: no trailing backslashes
format = "[](color_orange)$os$username[](bg:color_yellow fg:color_orange)$directory[](fg:color_yellow bg:color_aqua)$git_branch$git_status[](fg:color_aqua bg:color_blue)$c$cpp$rust$golang$nodejs$php$java$kotlin$haskell$python[](fg:color_blue bg:color_bg3)$docker_context$conda$pixi[](fg:color_bg3 bg:color_bg1)$time[ ](fg:color_bg1)$line_break$character";
palette = "gruvbox_dark";
palettes.gruvbox_dark = {
color_fg0 = "#fbf1c7";
color_bg1 = "#3c3836";
color_bg3 = "#665c54";
color_blue = "#458588";
color_aqua = "#689d6a";
color_green = "#98971a";
color_orange = "#d65d0e";
color_purple = "#b16286";
color_red = "#cc241d";
color_yellow = "#d79921";
};
os = {
disabled = false;
style = "bg:color_orange fg:color_fg0";
symbols = {
Windows = "󰍲";
Ubuntu = "󰕈";
SUSE = "";
Raspbian = "󰐿";
Mint = "󰣭";
Macos = "󰀵";
Manjaro = "";
Linux = "󰌽";
Gentoo = "󰣨";
Fedora = "󰣛";
Alpine = "";
Amazon = "";
Android = "";
AOSC = "";
Arch = "󰣇";
Artix = "󰣇";
EndeavourOS = "";
CentOS = "";
Debian = "󰣚";
Redhat = "󱄛";
RedHatEnterprise = "󱄛";
Pop = "";
};
};
username = {
show_always = true;
style_user = "bg:color_orange fg:color_fg0";
style_root = "bg:color_orange fg:color_fg0";
format = "[ $user ]($style)";
};
directory = {
style = "fg:color_fg0 bg:color_yellow";
format = "[ $path ]($style)";
truncation_length = 3;
truncation_symbol = "/";
substitutions = {
Documents = "󰈙 ";
Downloads = " ";
Music = "󰝚 ";
Pictures = " ";
Developer = "󰲋 ";
};
};
git_branch = {
symbol = "";
style = "bg:color_aqua";
format = "[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)";
};
git_status = {
style = "bg:color_aqua";
format = "[[($all_status$ahead_behind )](fg:color_fg0 bg:color_aqua)]($style)";
};
nodejs.symbol = "";
c.symbol = " ";
cpp.symbol = " ";
rust.symbol = "";
golang.symbol = "";
php.symbol = "";
java.symbol = "";
kotlin.symbol = "";
haskell.symbol = "";
python.symbol = "";
docker_context.symbol = "";
time = {
disabled = false;
time_format = "%R";
style = "bg:color_bg1";
format = "[[ $time ](fg:color_fg0 bg:color_bg1)]($style)";
};
line_break.disabled = false;
character = {
disabled = false;
success_symbol = "[](bold fg:color_green)";
error_symbol = "[](bold fg:color_red)";
vimcmd_symbol = "[](bold fg:color_green)";
vimcmd_replace_one_symbol = "[](bold fg:color_purple)";
vimcmd_replace_symbol = "[](bold fg:color_purple)";
vimcmd_visual_symbol = "[](bold fg:color_yellow)";
};
};
"fish/conf.d/starship.fish".text = ''
starship init fish | source
'';
"fish/completions/starship.fish".source =
"${pkgs.starship}/share/fish/vendor_completions.d/starship.fish";
};
}