flake: clean up modules

This commit is contained in:
Infinidoge 2024-10-22 11:34:51 -04:00
parent 28f18c9a99
commit 8cd8b3a3f9
Signed by: Infinidoge
SSH key fingerprint: SHA256:oAMyvotlNFraMmZmr+p6AxnNfW/GioTs1pOn3V4tQ7A
64 changed files with 258 additions and 273 deletions

View file

@ -1,9 +0,0 @@
{ ... }: {
imports = [
./bash.nix
./fish.nix
./ion.nix
./nushell.nix
./zsh.nix
];
}

View file

@ -1,15 +1,10 @@
{ config, pkgs, lib, ... }: {
imports = [ ./common.nix ];
programs = {
bash = {
enable = true;
enableVteIntegration = true;
initExtra = ''
source <(${lib.getExe config.programs.kitty.package} + complete setup bash)
'';
};
starship.enableBashIntegration = true;
{ config, lib, ... }:
{
programs.bash = {
enable = true;
enableVteIntegration = true;
initExtra = ''
source <(${lib.getExe config.programs.kitty.package} + complete setup bash)
'';
};
}

View file

@ -1,4 +1,5 @@
{ ... }: {
{ ... }:
{
programs.nix-index = {
enable = true;
enableBashIntegration = false;

View file

@ -1,17 +1,12 @@
{ config, lib, pkgs, ... }: {
imports = [ ./common.nix ];
programs = {
fish = {
enable = true;
functions = { };
shellAbbrs = { };
interactiveShellInit = ''
kitty + complete setup fish | source
set -U fish_greeting
'';
};
starship.enableFishIntegration = lib.mkIf config.programs.starship.enable true;
{ config, lib, ... }:
{
programs.fish = {
enable = true;
functions = { };
shellAbbrs = { };
interactiveShellInit = ''
kitty + complete setup fish | source
set -U fish_greeting
'';
};
}

View file

@ -1,11 +1,6 @@
{ config, pkgs, ... }: {
imports = [ ./common.nix ];
programs = {
ion = {
enable = true;
};
starship.enableIonIntegration = true;
{ ... }:
{
programs.ion = {
enable = true;
};
}

View file

@ -1,4 +1,5 @@
{ ... }: {
{ ... }:
{
programs.nushell = {
enable = true;
extraConfig = ''

View file

@ -1,118 +1,113 @@
{ config, lib, pkgs, main, ... }: {
imports = [ ./common.nix ];
{ config, main, pkgs, ... }:
{
programs.zsh = rec {
enable = true;
programs = {
zsh = rec {
enable = true;
enableCompletion = true;
enableVteIntegration = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
enableCompletion = true;
enableVteIntegration = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
# defaultKeymap = "emacs";
# defaultKeymap = "emacs";
initExtraFirst = ''
[[ $TERM == "tramp" ]] && unsetopt zle && PS1='$ ' && return
'';
initExtraFirst = ''
[[ $TERM == "tramp" ]] && unsetopt zle && PS1='$ ' && return
'';
initExtra = ''
${pkgs.kitty}/bin/kitty + complete setup zsh | source /dev/stdin
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin
initExtra = ''
${pkgs.kitty}/bin/kitty + complete setup zsh | source /dev/stdin
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin
functions -c precmd precmd_any_nix_shell
functions -c precmd precmd_any_nix_shell
precmd() {
precmd_any_nix_shell
precmd() {
precmd_any_nix_shell
if [[ -s ~/TODO.txt && ! -v __TODO_PRINTED ]] then
export __TODO_PRINTED=1
if [[ "$(cat ~/TODO.txt)" != "" ]] then
echo TODO:
\cat ~/TODO.txt
fi
if [[ -s ~/TODO.txt && ! -v __TODO_PRINTED ]] then
export __TODO_PRINTED=1
if [[ "$(cat ~/TODO.txt)" != "" ]] then
echo TODO:
\cat ~/TODO.txt
fi
}
fi
}
if [[ "$(basename "$(readlink "/proc/$PPID/exe")")" == ".kitty-wrapped" ]]; then
PATH=$(echo "$PATH" | sed 's/\/nix\/store\/[a-zA-Z._0-9+-]\+\/bin:\?//g' | sed 's/:$//')
if [[ "$(basename "$(readlink "/proc/$PPID/exe")")" == ".kitty-wrapped" ]]; then
PATH=$(echo "$PATH" | sed 's/\/nix\/store\/[a-zA-Z._0-9+-]\+\/bin:\?//g' | sed 's/:$//')
fi
j() {
if [[ $# -eq 0 ]] then
\builtin cd -- "$(fd -H -t d | fzf --filepath-word)"
else
\builtin cd -- "$(fd -H -t d | fzf --filepath-word -1 -q "$*")"
fi
}
alias "jh"="cd ~ && j"
alias "gj"="gcd && j"
mktmpunzip() {
dir=$(mktemp -t -d unzip.XXX)
if ! file=$(realpath -e "$1"); then
echo "error: file does not exist"
return 1
fi
shift 1
unzip "$file" "$@" -d "$dir"
\builtin cd $dir
mv $file .
}
mktmpclone() {
location="$1"
if [ "$2" != "" ]; then
dirspec="$2.XXX"
shift 2
else
dirspec="clone.XXX"
shift 1
fi
if ! dir=$(mktemp -t -d "$dirspec"); then
echo "error: couldn't create temp directory"
return 1
fi
j() {
if [[ $# -eq 0 ]] then
\builtin cd -- "$(fd -H -t d | fzf --filepath-word)"
else
\builtin cd -- "$(fd -H -t d | fzf --filepath-word -1 -q "$*")"
fi
}
git clone "$location" "$dir" "$@"
\builtin cd "$dir"
}
'';
alias "jh"="cd ~ && j"
alias "gj"="gcd && j"
dotDir = ".config/zsh";
mktmpunzip() {
dir=$(mktemp -t -d unzip.XXX)
if ! file=$(realpath -e "$1"); then
echo "error: file does not exist"
return 1
fi
shift 1
unzip "$file" "$@" -d "$dir"
\builtin cd $dir
mv $file .
}
history.path = "$HOME/${dotDir}/.zsh_history";
mktmpclone() {
location="$1"
if [ "$2" != "" ]; then
dirspec="$2.XXX"
shift 2
else
dirspec="clone.XXX"
shift 1
fi
if ! dir=$(mktemp -t -d "$dirspec"); then
echo "error: couldn't create temp directory"
return 1
fi
git clone "$location" "$dir" "$@"
\builtin cd "$dir"
}
'';
dotDir = ".config/zsh";
history.path = "$HOME/${dotDir}/.zsh_history";
shellAliases = main.environment.shellAliases // config.home.shellAliases // {
lsdiskw = "while true; do clear; lsdisk; sleep 1; done";
};
oh-my-zsh = {
enable = true;
plugins = [
# Display
"colorize"
"colored-man-pages"
# zsh modifications
"zsh-interactive-cd"
"sudo"
# Aliases
"alias-finder"
# Applications
## Python
"pip"
## Git
"gitignore"
## Vim
"fancy-ctrl-z"
];
};
shellAliases = main.environment.shellAliases // config.home.shellAliases // {
lsdiskw = "while true; do clear; lsdisk; sleep 1; done";
};
starship.enableZshIntegration = lib.mkIf config.programs.starship.enable true;
oh-my-zsh = {
enable = true;
plugins = [
# Display
"colorize"
"colored-man-pages"
# zsh modifications
"zsh-interactive-cd"
"sudo"
# Aliases
"alias-finder"
# Applications
## Python
"pip"
## Git
"gitignore"
## Vim
"fancy-ctrl-z"
];
};
};
}