add some initial stuff

This commit is contained in:
Lucy Hochkamp 2025-03-15 15:45:30 +01:00
commit 62df62c3aa
No known key found for this signature in database
23 changed files with 2101 additions and 0 deletions

33
modules/cli/fish.nix Normal file
View file

@ -0,0 +1,33 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.xyno.cli.fish;
in
{
options.xyno.cli.fish.enable = lib.mkEnableOption "enable the fish shell with xynos config";
config = lib.mkIf cfg.enable {
programs.bash = {
# auto spawn fish if interactive
interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
environment.systemPackages = with pkgs; [
fishPlugins.grc
grc
];
programs.direnv.enableFishIntegration = true;
programs.fish.interactiveShellInit = ''
set -g fish_key_bindings fish_vi_key_bindings
'';
programs.fish.enable = true;
};
}

252
modules/cli/starship.nix Normal file
View file

@ -0,0 +1,252 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.xyno.cli.starship;
in
{
options.xyno.cli.starship.enable =
lib.mkEnableOption "enable the starship shell prompt with xynos config";
config = lib.mkIf cfg.enable {
programs.starship.enable = true;
programs.starship.settings = {
enable = true;
settings = {
"add_newline" = false;
# "format" = "($direnv$nix_shell$container$fill$git_metrics\n)$cmd_duration$hostname$localip$shlvl$shell$env_var$jobs$username$directory ";
"format" = "$cmd_duration$status$hostname$localip$shlvl$shell$env_var$jobs$username$directory";
"right_format" =
"$nix_shell$git_branch$git_commit$git_state$git_status$package$custom$os$battery$time";
aws.disabled = true;
status.disabled = false;
battery.disabled = true;
"buf" = {
"format" = " [buf](italic) [$symbol $version $buf_version]($style)";
# "symbol" = "■ ";
};
"c" = {
"format" = " [$symbol($version(-$name))]($style)";
# "symbol" = " ";
};
"character" = {
"error_symbol" = "[:](italic purple)";
"format" = "$symbol ";
"success_symbol" = "[:](bold italic bright-yellow)";
"vimcmd_replace_one_symbol" = "r";
"vimcmd_replace_symbol" = "R";
"vimcmd_symbol" = "[>](italic dimmed green)";
"vimcmd_visual_symbol" = "SEL";
};
"cmd_duration" = {
"format" = "[$duration](italic white) ";
};
"conda" = {
"format" = " conda [$symbol$environment]($style)";
# "symbol" = "◯ ";
};
"continuation_prompt" = "[ ](dimmed white)";
"dart" = {
"format" = " dart [$symbol($version )]($style)";
# "symbol" = "◁◅ ";
};
"deno" = {
"format" = " [deno](italic) [ $version](green bold)";
"version_format" = "\${raw}";
};
"directory" = {
"format" = "[$path]($style)[$read_only]($read_only_style)";
"home_symbol" = "~";
"read_only" = " (ro) ";
"repo_root_format" =
"[$before_root_path]($before_repo_root_style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style)";
"repo_root_style" = "bold blue";
"style" = "italic blue";
"truncation_length" = 50;
"truncation_symbol" = "";
"use_os_path_sep" = true;
};
"docker_context" = {
"format" = " docker [$symbol$context]($style)";
# "symbol" = "◧ ";
};
direnv = {
disabled = false;
};
"elixir" = {
"format" = " exs [$symbol $version OTP $otp_version ]($style)";
# "symbol" = "△ ";
};
"elm" = {
"format" = " elm [$symbol($version )]($style)";
# "symbol" = "◩ ";
};
"env_var" = {
"VIMSHELL" = {
"format" = "[$env_value]($style)";
"style" = "green italic";
};
};
"fill" = {
"symbol" = " ";
};
"git_branch" = {
"format" = " [$branch(:$remote_branch)]($style)";
"ignore_branches" = [
"main"
"master"
];
"only_attached" = true;
"style" = "italic bright-blue";
"symbol" = "(bold italic bright-blue)";
# "symbol" = "[△](bold italic bright-blue)";
"truncation_length" = 13;
"truncation_symbol" = "";
};
"git_metrics" = {
"added_style" = "italic dimmed green";
"deleted_style" = "italic dimmed red";
"disabled" = false;
"format" = "([$added]($added_style))([$deleted]($deleted_style))";
"ignore_submodules" = true;
};
"git_status" = {
"ahead" = "[[\${count}](bold white)](italic green)";
"behind" = "[[\${count}](bold white)](italic red)";
"conflicted" = "[](italic bright-magenta)";
"deleted" = "[](italic red)";
"diverged" =
"[ [\${ahead_count}](regular white)[\${behind_count}](regular white)](italic bright-magenta)";
"format" =
"([$ahead_behind$staged$modified$untracked$renamed$deleted$conflicted$stashed]($style))";
"modified" = "[](italic yellow)";
"renamed" = "[](italic bright-blue)";
"staged" = "[[$count](bold white)](italic bright-cyan)";
"stashed" = "[](italic white)";
"style" = "bold italic bright-blue";
"untracked" = "[](italic bright-yellow)";
};
"golang" = {
"format" = " go [$symbol($version )]($style)";
# "symbol" = "∩ ";
};
"haskell" = {
"format" = " hs [$symbol($version )]($style)";
# "symbol" = "❯λ ";
};
"java" = {
"format" = " java [\${symbol}(\${version} )]($style)";
# "symbol" = " ";
};
"jobs" = {
"format" = "[$symbol$number]($style) ";
"style" = "white";
"symbol" = "[](blue italic)";
};
"julia" = {
"format" = " jl [$symbol($version )]($style)";
"symbol" = " ";
};
"localip" = {
"disabled" = false;
"format" = " [$localipv4](bold magenta)";
"ssh_only" = true;
};
"lua" = {
"format" = " [lua](italic) [\${symbol}\${version}]($style)";
"style" = "bold bright-yellow";
"symbol" = " ";
"version_format" = "\${raw}";
};
"memory_usage" = {
"format" = " mem [\${ram}( \${swap})]($style)";
"symbol" = " ";
};
"nim" = {
"format" = " nim [$symbol($version )]($style)";
"symbol" = " ";
};
"nix_shell" = {
"format" = "[$symbol]($style) [$name](italic dimmed white)";
"impure_msg" = "[impure](bold dimmed red)";
"pure_msg" = "[pure](bold dimmed green)";
"style" = "bold italic dimmed blue";
"symbol" = "󱄅";
"unknown_msg" = "[unknown](bold dimmed ellow)";
};
"nodejs" = {
"detect_extensions" = [
];
"detect_files" = [
"package-lock.json"
"yarn.lock"
"pnpm-lock.yaml"
];
"detect_folders" = [
"node_modules"
];
"format" = " [node](italic) [($version)](bold bright-green)";
"version_format" = "\${raw}";
};
"package" = {
"format" = " [pkg](italic dimmed) [$symbol$version]($style)";
"style" = "dimmed yellow italic bold";
# "symbol" = "◨ ";
"version_format" = "\${raw}";
};
"python" = {
"format" = " [py](italic) [\${symbol}\${version}]($style)";
"style" = "bold bright-yellow";
# "symbol" = "[⌉](bold bright-blue)⌊ ";
"version_format" = "\${raw}";
};
"ruby" = {
disabled = true;
"format" = " [rb](italic) [\${symbol}\${version}]($style)";
"style" = "bold red";
# "symbol" = "◆ ";
"version_format" = "\${raw}";
};
"rust" = {
"format" = " [rs](italic) [$symbol$version]($style)";
"style" = "bold red";
# "symbol" = "⊃ ";
"version_format" = "\${raw}";
};
"spack" = {
"format" = " spack [$symbol$environment]($style)";
# "symbol" = "◇ ";
};
"sudo" = {
"disabled" = true;
"format" = "[$symbol]($style)";
"style" = "bold italic bright-purple";
"symbol" = "sudo";
};
"swift" = {
"format" = " [sw](italic) [\${symbol}\${version}]($style)";
"style" = "bold bright-red";
# "symbol" = "◁ ";
"version_format" = "\${raw}";
};
"time" = {
"disabled" = true;
"format" = "[ $time]($style)";
"style" = "italic dimmed white";
"time_format" = "%R";
"utc_time_offset" = "local";
};
"username" = {
"disabled" = false;
"format" = "[$user]($style) ";
"show_always" = false;
"style_root" = "purple bold italic";
"style_user" = "bright-yellow bold italic";
};
};
};
};
}

33
modules/cli/tmux.nix Normal file
View file

@ -0,0 +1,33 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.xyno.cli.tmux;
in
{
options.xyno.cli.tmux.enable = lib.mkEnableOption "enable tmux with xynos config";
config = lib.mkIf cfg.enable {
programs.tmux = {
enable = true;
keyMode = "vi";
clock24 = true;
historyLimit = 10000;
plugins = with pkgs.tmuxPlugins; [
vim-tmux-navigator
];
extraConfig = ''
set -sg escape-time 0 # makes vim esc usable
new-session -s main
bind-key -n C-e send-prefix
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# set-option -g default-terminal "tmux-256color"
# set -as terminal-overrides ',xterm*:Tc:sitm=\E[3m'
'';
};
};
}