Initial commit of flake-based NixOS config for the whole haus
This commit is contained in:
57
modules/common/shell.nix
Normal file
57
modules/common/shell.nix
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
environment.variables.EDITOR = "nvim";
|
||||
|
||||
users.users.user.shell = pkgs.bash;
|
||||
environment.shells = with pkgs; [bash];
|
||||
programs.bash = {
|
||||
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
|
||||
'';
|
||||
};
|
||||
programs.fish.enable = true;
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
add_newline = true;
|
||||
command_timeout = 1300;
|
||||
scan_timeout = 50;
|
||||
format = ''
|
||||
$all$nix_shell$nodejs$lua$golang$rust$php$git_branch$git_commit$git_state$git_status
|
||||
$username$hostname$directory'';
|
||||
character = {
|
||||
success_symbol = "[](bold green) ";
|
||||
error_symbol = "[✗](bold red) ";
|
||||
};
|
||||
};
|
||||
};
|
||||
#programs.zsh = {
|
||||
# enable = true;
|
||||
# enableCompletion = true;
|
||||
# autosuggestions.enable = true;
|
||||
# syntaxHighlighting.enable = true;
|
||||
#
|
||||
# shellAliases = {
|
||||
# update = "sudo nixos-rebuild switch";
|
||||
# upgrade = "sudo nixos-rebuild switch --upgrade";
|
||||
# proxy-grabber =
|
||||
# "if [ $# -eq 0 ]; then torsocks curl -sL https://cdn.jsdelivr.net/gh/proxifly/free-proxy-list@main/proxies/all/data.txt else countrycode=$(echo $1 | tr '[:lower:]' '[:upper:]') torsocks curl -sL https://cdn.jsdelivr.net/gh/proxifly/free-proxy-list@main/proxies/countries/$countrycode/data.txt fi";
|
||||
# usbdiff =
|
||||
# "lsblk > diff1 && echo 'SLEEPING 5...' && sleep 5 && lsblk > diff2 && diff diff1 diff2 && rm diff1 diff2";
|
||||
# };
|
||||
#
|
||||
# oh-my-zsh = {
|
||||
# enable = true;
|
||||
# plugins = [ "git" ];
|
||||
# theme = "clean";
|
||||
# };
|
||||
#};
|
||||
}
|
||||
Reference in New Issue
Block a user