Add fish module to nix
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
# ============
|
# ============
|
||||||
# Basics, etc…
|
# Basics, etc…
|
||||||
# ============
|
# ============
|
||||||
@@ -8,10 +9,8 @@ set -g -x ALTERNATE_EDITOR "vim"
|
|||||||
set -g -x TERMINAL "kitty"
|
set -g -x TERMINAL "kitty"
|
||||||
|
|
||||||
# Setup PATH
|
# Setup PATH
|
||||||
ensure_path ~/.dotfiles/bin
|
fish_add_path --path ~/.dotfiles/bin ~/.local/bin ~/bin
|
||||||
ensure_path ~/.local/bin
|
fish_add_path ~/.emacs.d/bin
|
||||||
ensure_path ~/bin
|
|
||||||
ensure_path ~/.emacs.d/bin
|
|
||||||
|
|
||||||
# Disable Fish greeting banner
|
# Disable Fish greeting banner
|
||||||
set --universal fish_greeting
|
set --universal fish_greeting
|
||||||
@@ -42,8 +41,3 @@ if test "$TERM" = "dumb"
|
|||||||
function fish_greeting; end
|
function fish_greeting; end
|
||||||
function fish_title; end
|
function fish_title; end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Starship prompt
|
|
||||||
if which starship &> /dev/null
|
|
||||||
starship init fish | source
|
|
||||||
end
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
function ensure_path --description "Ensures directories are in $PATH"
|
|
||||||
for pathdir in $argv
|
|
||||||
if not set -l index (contains -i $pathdir $PATH)
|
|
||||||
set -g -x PATH $pathdir $PATH
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -11,16 +11,14 @@
|
|||||||
targets.genericLinux.enable = pkgs.stdenv.isLinux;
|
targets.genericLinux.enable = pkgs.stdenv.isLinux;
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# Defined in Xonsh overlay
|
|
||||||
xonsh_with_plugins
|
xonsh_with_plugins
|
||||||
# Jump to directories
|
|
||||||
zoxide
|
|
||||||
# Better cat
|
# Better cat
|
||||||
bat
|
bat
|
||||||
# Better find
|
# Better find
|
||||||
fd
|
fd
|
||||||
# Better df
|
# Better df
|
||||||
duf
|
duf
|
||||||
|
# Better top
|
||||||
htop
|
htop
|
||||||
fzf
|
fzf
|
||||||
ncdu
|
ncdu
|
||||||
@@ -34,6 +32,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
|
./modules/fish
|
||||||
./modules/git.nix
|
./modules/git.nix
|
||||||
./modules/direnv.nix
|
./modules/direnv.nix
|
||||||
./modules/emacs.nix
|
./modules/emacs.nix
|
||||||
|
|||||||
45
nix/modules/fish/default.nix
Normal file
45
nix/modules/fish/default.nix
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.zoxide = {
|
||||||
|
enable = true;
|
||||||
|
enableFishIntegration = true;
|
||||||
|
options = ["--cmd j"];
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.fish = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
shellInit = ''
|
||||||
|
set --universal fish_greeting
|
||||||
|
set -g -x EDITOR "emacsclient"
|
||||||
|
set -g -x ALTERNATE_EDITOR "vim"
|
||||||
|
set -g -x TERMINAL "kitty"
|
||||||
|
set -g -x MANPAGER less -x
|
||||||
|
|
||||||
|
fish_add_path --path ~/.dotfiles/bin ~/.local/bin ~/bin
|
||||||
|
|
||||||
|
# TODO - Adjust for nix-managed Doom if I ever do that
|
||||||
|
fish_add_path ~/.emacs.d/bin
|
||||||
|
'';
|
||||||
|
|
||||||
|
shellAliases = {
|
||||||
|
ec = "emacsclient -n --alternate-editor=emacs";
|
||||||
|
pubip = "curl icanhazip.com";
|
||||||
|
src = "source ~/.config/fish/config.fish && clear";
|
||||||
|
redesktop = "kquitapp5 plasmashell && kstart5 plasmashell";
|
||||||
|
pulsefix = "pulseaudio --kill; pulseaudio --start";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# TODO -- port from Xonsh config
|
||||||
|
# $MANPAGER = "less -X"
|
||||||
|
# $LESS = "--ignore-case --QUIET --RAW-CONTROL-CHARS"
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# if $TERM == "xterm-kitty":
|
||||||
|
# # Wrap ssh with environment variable because servers tend to deal poorly with kitty
|
||||||
|
# def xterm_ssh(args):
|
||||||
|
# $TERM="xterm-256color" ssh @(args)
|
||||||
|
#
|
||||||
|
# aliases["ssh"] = xterm_ssh
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user