nix-configurations/home/features/cli/#fish.nix#

69 lines
1.8 KiB
Plaintext
Raw Normal View History

2023-06-18 04:00:57 +00:00
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.features.cli.fish;
in {
options.features.cli.fish.enable = mkEnableOption "enable fish shell";
config = mkIf cfg.enable {
programs.fish = {
enable = true;
plugins = [{
name = "foreign-env";
src = pkgs.fetchFromGitHub {
owner = "oh-my-fish";
repo = "plugin-foreign-env";
rev = "dddd9213272a0ab848d474d0cbde12ad034e65bc";
sha256 = "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs";
};
}];
loginShellInit = ''
set -x WEBKIT_DISABLE_COMPOSITING_MODE 1
set -x EDITOR emacsclient
set -x VISUAL emacsclient
set -x XDG_DATA_HOME $HOME/.local/share
set -x FZF_ALT_C_COMMAND fd --type d --exclude .git --follow --hidden
set -x FZF_DEFAULT_COMMAND fd --type f --exclude .git --follow --hidden
set -x FZF_CTRL_T_COMMAND "$FZF_DEFAULT_COMMAND"
if test (tty) = "/dev/tty1"
exec Hyprland &> /dev/null
end
'';
shellAbbrs = {
ls = "exa";
grep = "rg";
ps = "procs";
n = "nix";
nd = "nix develop -c $SHELL";
ns = "nix shell";
nsn = "nix shell nixpkgs#";
nb = "nix build";
nbn = "nix build nixpkgs#";
nf = "nix flake";
nrs = "sudo nixos-rebuild switch --flake .#$HOSTNAME";
snr = "sudo nixos-rebuild --flake .";
snrs = "sudo nixos-rebuild --flake . switch";
hm = "home-manager --flake .";
hms = "home-manager --flake . switch";
tsu = "sudo tailscale up";
tsd = "sudo tailscale down";
vi = "nvim";
vim = "nvim";
wgd = "sudo systemctl stop wg-quick-wg0.service";
wgu = "sudo systemctl start wg-quick-wg0.service";
};
};
};
}