flake: migrate users/profiles -> users/modules

This commit is contained in:
Infinidoge 2023-09-08 21:59:56 -04:00
parent 85fb3f8251
commit e50310eb80
36 changed files with 46 additions and 79 deletions

View file

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

View file

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

View file

@ -0,0 +1,3 @@
{ ... }: {
programs.command-not-found.enable = true;
}

View file

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

View file

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

View file

@ -0,0 +1,12 @@
{ ... }: {
programs.nushell = {
enable = true;
configFile.text = ''
source ~/.cache/starship/init.nu
'';
envFile.text = ''
mkdir ~/.cache/starship
starship init nu | save ~/.cache/starship/init.nu
'';
};
}

View file

@ -0,0 +1,74 @@
{ config, lib, pkgs, main, ... }: {
imports = [ ./common.nix ];
programs = {
zsh = rec {
enable = true;
enableCompletion = true;
enableVteIntegration = true;
enableAutosuggestions = true;
syntaxHighlighting.enable = true;
# defaultKeymap = "emacs";
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
functions -c precmd precmd_any_nix_shell
precmd() {
precmd_any_nix_shell
if [[ -e ~/TODO.txt && ! -v __TODO_PRINTED ]] then
export __TODO_PRINTED=1
echo TODO:
\cat ~/TODO.txt
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/:$//')
fi
'';
dotDir = ".config/zsh";
history.path = "$HOME/${dotDir}/.zsh_history";
shellAliases = main.environment.shellAliases // config.home.shellAliases;
oh-my-zsh = {
enable = true;
plugins = [
# Display
"colorize"
"colored-man-pages"
# zsh modifications
"zsh-interactive-cd"
"command-not-found"
"sudo"
# Aliases
"alias-finder"
# Applications
## Python
"pip"
## Git
"gitignore"
## Vim
"fancy-ctrl-z"
];
};
};
starship.enableZshIntegration = lib.mkIf config.programs.starship.enable true;
};
}