Add fish shell support and related configs

Introduce a `shell` variable in host variables and enable the Fish
package.
Make Bash configuration conditional on the selected shell and add Fish
integration for programs such as fzf, starship, kitty, zoxide, and eza.
Provide a full Fish module with aliases, functions, and plugin
placeholders.
Update Stylix to configure Fish, Starship, Fzf, Bat, Anki, Btop, Kitty,
and
Vesktop themes. Remove the large Emoji module and simplify a few Dconf
settings. All changes collectively enable and style the Fish shell
across
the system.
This commit is contained in:
2026-05-24 14:51:43 +02:00
parent 2eb24167e5
commit 077d8f07e7
23 changed files with 560 additions and 1918 deletions
+4
View File
@@ -15,6 +15,10 @@
gitUsername = "GarandPLG";
gitEmail = "garandplg@garandplg.com";
# User shell
# Availabe options: "fish", "bash"
shell = "fish";
# Hyprland Settings
# Examples:
# extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1";
+4
View File
@@ -15,6 +15,10 @@
gitUsername = "GarandPLG";
gitEmail = "garandplg@garandplg.com";
# User shell
# Availabe options: "fish", "bash"
shell = "fish";
# Hyprland Settings
# Examples:
# extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1";
+4
View File
@@ -15,6 +15,10 @@
gitUsername = "GarandPLG";
gitEmail = "my@email.com";
# User shell
# Availabe options: "fish", "bash"
shell = "fish";
# Hyprland Settings
# Examples:
# extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1";
+1
View File
@@ -5,6 +5,7 @@ _: {
enable = true;
withUWSM = false;
};
fish.enable = true;
dconf.enable = true;
seahorse.enable = true;
fuse.userAllowOther = true;
+7 -2
View File
@@ -7,7 +7,7 @@
system,
...
}: let
inherit (import ../../hosts/${host}/variables.nix) gitUsername;
inherit (import ../../hosts/${host}/variables.nix) gitUsername shell;
in {
imports = [inputs.home-manager.nixosModules.home-manager];
home-manager = {
@@ -33,6 +33,7 @@ in {
username = "${username}";
homeDirectory = "/home/${username}";
stateVersion = "25.11";
shell.enableFishIntegration = true;
};
};
};
@@ -53,7 +54,11 @@ in {
"gamemode"
"lpadmin"
];
shell = pkgs.bash;
shell = with pkgs; (
if shell == "fish"
then fish
else bash
);
ignoreShellProgramCheck = true;
linger = true;
};
+7 -2
View File
@@ -1,6 +1,11 @@
_: {
{host, ...}: let
inherit (import ../../../hosts/${host}/variables.nix) shell;
in {
programs.bash = {
enable = true;
enable =
if shell == "bash"
then true
else false;
enableCompletion = true;
# initExtra = ''
# fastfetch
+1
View File
@@ -16,6 +16,7 @@
batgrep
];
};
home.sessionVariables = {
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
MANROFFOPT = "-c";
+1 -1
View File
@@ -3,6 +3,7 @@ _: {
./bash
./chromium
./fastfetch
./fish
./hyprland
./kitty
./librewolf
@@ -16,7 +17,6 @@ _: {
./btop.nix
./cava.nix
./easyeffects.nix
./emoji.nix
./eza.nix
./fzf.nix
./git.nix
File diff suppressed because it is too large Load Diff
+1
View File
@@ -3,6 +3,7 @@
programs.eza = {
enable = true;
icons = "auto";
enableFishIntegration = true;
enableBashIntegration = true;
git = true;
+140
View File
@@ -0,0 +1,140 @@
{
username,
host,
...
}: {
programs.fish.shellAliases = {
# GarandOS aliases
pullos = "git -C /home/${username}/garandos pull";
upd = "nh os switch -H ${host} -d always";
upg = "nh os switch -H ${host} --update -d always";
upf = "sudo nix flake update --flake /home/${username}/garandos";
upf-undo = "git -C /home/${username}/garandos restore /home/${username}/garandos/flake.lock";
upd-bt = "nh os boot -H ${host} -d always";
upd-ts = "nh os test -H ${host} -d always";
upd-bd = "nh os build -H ${host} -d always";
tui = "garandos-tui";
ncg = "nh clean all --optimise";
# Development aliases
## Django
srvenv = "source .venv/bin/activate";
"..srvenv" = "source ../.venv/bin/activate";
uv-add = "uv add -r requirements.txt";
pm = "uv run manage.py";
pm-rs = "uv run manage.py runserver";
pm-mg = "uv run manage.py migrate";
pm-mm = "uv run manage.py makemigrations";
pm-sq = "uv run manage.py sqlmigrate";
f8 = "uv run flake8 .";
## JavaScript/TypeScript
bbr = "bun --bun run";
## Git
"ga." = "git add .";
mkgidf = "git add . --intent-to-add . && git diff > git-diff.txt";
# Development aliases for nix flake
nd = "nix develop";
nb = "nix build .";
nr = "nix run .";
nbr = "nix build . && nix run .";
nbd = "nix build .#develop";
nrd = "nix run .#develop";
nbrd = "nix build .#develop && nix run .#develop";
# Development aliases for docker
dcu = "docker compose up -d";
dcd = "docker compose down";
dcb = "docker compose build";
dcub = "docker compose up -d --build";
# System aliases
# flush-codium = "sudo killall codium && sudo rm -rf ~/.config/VSCodium/Cache && sudo rm -rf ~/.config/VSCodium/CachedData";
kys = "systemctl poweroff";
jezus = "systemctl reboot";
ookla = "speedtest";
hypr-cli = "hyprctl clients";
# Navigation aliases
".." = "cd ..";
"..." = "cd ../..";
"...." = "cd ../../..";
"....." = "cd ../../../..";
# Modifies commands
cat = "bat";
cp = "cp -i";
mv = "mv -i";
rm = "trash -v";
mkdir = "mkdir -p";
ps = "ps auxf";
ping = "ping -c 10";
less = "less -R";
cls = "clear";
multitail = "multitail --no-repeat -c";
freshclam = "sudo freshclam";
# Alias"s for multiple directory listing commands
la = "eza -alh --icons"; # show hidden files
ls = "eza -aF --icons --color=always"; # add colors and file type extensions
lx = "eza -lh --icons --sort=extension"; # sort by extension
lk = "eza -lh --icons --sort=size --reverse"; # sort by size
lc = "eza -lh --icons --sort=changed"; # sort by change time
lu = "eza -lh --icons --sort=accessed"; # sort by access time
lr = "eza -lh --icons --recurse"; # recursive ls
lt = "eza -lh --icons --sort=modified"; # sort by date
lm = "eza -alh --icons | more"; # pipe through "more"
lw = "eza -xh --icons"; # wide listing format
ll = "eza -lh --icons"; # long listing format
labc = "eza -lah --icons --sort=name"; # alphabetical sort
lf = "eza -lh --icons | grep -v '^d'"; # files only (przybliżenie)
ldir = "eza -lh --icons --only-dirs"; # directories only
lla = "eza -alh --icons"; # List and Hidden Files
las = "eza -a --icons"; # Hidden Files
lls = "eza -lh --icons"; # List
# chmod commands
mx = "chmod a+x";
"000" = "chmod -R 000";
"644" = "chmod -R 644";
"666" = "chmod -R 666";
"755" = "chmod -R 755";
"777" = "chmod -R 777";
# Search command line history
h = "history | grep ";
# Search running processes
p = "ps aux | grep ";
topcpu = "/bin/ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10";
# Search files in the current folder
f = "find . | grep ";
# Alias"s to show disk space and space used in a folder
diskspace = "du -S | sort -n -r |more";
folders = "du -h --max-depth=1";
folderssort = "find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn";
tree = "tree -CAhF --dirsfirst";
treed = "tree -CAFd";
mountedinfo = "df -hT";
# fix kitty ssh connection
kssh = "kitty +kitten ssh";
docker-clean = "docker container prune -f ; docker image prune -f ; docker network prune -f ; docker volume prune -f";
# Remove a directory and all files
rmd = "/bin/rm --recursive --force --verbose ";
# Fun aliases
pasjans = "ttysolitaire -p 10 --no-background-color";
fc = "fortune | cowsay";
# Network aliases
kssh-server = "kssh hp-t640-homeserver";
kssh-server-ts = "kssh hp-t640-homeserver-tailscale";
ssh-server = "ssh hp-t640-homeserver";
ssh-server-ts = "ssh hp-t640-homeserver-tailscale";
};
}
+38
View File
@@ -0,0 +1,38 @@
{
pkgs,
host,
...
}: let
inherit (import ../../../hosts/${host}/variables.nix) shell;
in {
programs = {
fish = {
enable =
if shell == "fish"
then true
else false;
package = pkgs.fish;
generateCompletions = true;
interactiveShellInit = ''
set fish_greeting
# fastfetch
'';
};
nix-your-shell = {
enable = true;
package = pkgs.nix-your-shell;
enableFishIntegration = true;
nix-output-monitor = {
enable = true;
package = pkgs.nix-output-monitor;
};
};
};
imports = [
./aliases.nix
./functions.nix
./plugins.nix
];
}
+236
View File
@@ -0,0 +1,236 @@
_: {
programs.fish.functions = {
# Count files, links and directories in the current folder
countfiles = {
body = ''
for t in files links directories
# $t[1] pierwszy znak (f, l, d)
echo (find . -type $t[1] | wc -l) $t
end
'';
description = "Count files, links and directories in the current folder";
};
# Tail all text logs in /var/log
logs = {
body = ''
sudo find /var/log -type f -exec file {} \; \
| grep 'text' \
| cut -d' ' -f1 \
| sed -e 's/:$//g' \
| grep -v '[0-9]$' \
| xargs tail -f
'';
description = "Tail all text logs in /var/log";
};
# Quick directory creation and navigation
mkcd = {
body = ''
mkdir -p $argv[1]; and cd $argv[1]
'';
description = "Create a directory and cd into it";
};
# Extract various archive formats
extract = {
body = ''
for archive in $argv
if test -f $archive
switch $archive
case *.tar.bz2
tar xvjf $archive
case *.tar.gz
tar xvzf $archive
case *.bz2
bunzip2 $archive
case *.rar
unrar x $archive
case *.gz
gunzip $archive
case *.tar
tar xvf $archive
case *.tbz2
tar xvjf $archive
case *.tgz
tar xvzf $archive
case *.zip
unzip $archive
case *.Z
uncompress $archive
case *.7z
7z x $archive
case '*'
echo "don't know how to extract '$archive'..."
end
else
echo "'$archive' is not a valid file!"
end
end
'';
description = "Extract various archive formats";
};
# Find files quickly
ff = {
body = ''
if test -n "$argv[1]"
find . -type f -name "*$argv[1]*"
else
echo "Usage: ff <pattern>"
end
'';
description = "Find files matching a pattern";
};
# Find directories quickly
fd = {
body = ''
if test -n "$argv[1]"
find . -type d -name "*$argv[1]*"
else
echo "Usage: fd <pattern>"
end
'';
description = "Find directories matching a pattern";
};
# IP address lookup
whatismyip = {
body = ''
# Internal IP
if command -v ip >/dev/null
echo -n "Internal IP: "
ip addr show wlan0 | grep "inet " | awk '{print $2}' | cut -d/ -f1
else
echo -n "Internal IP: "
ifconfig wlan0 | grep "inet " | awk '{print $2}'
end
# External IP
echo -n "External IP: "
curl -4 ifconfig.me
'';
description = "Show internal and external IP addresses";
};
# Search for text in all files in the current folder
ftext = {
body = ''
if test -n "$argv[1]"
grep -iIHrn --color=always "$argv[1]" . | less -r
else
echo "Usage: ftext <search term>"
end
'';
description = "Search text in files, showing matches with highlighting";
};
# Copy file with a progress bar
cpp = {
body = ''
set -e
# Use strace to monitor cp progress
strace -q -ewrite cp -- $argv[1] $argv[2] 2>&1 |
awk '
{
count += $NF
if (count % 10 == 0) {
percent = count / total_size * 100
printf "%3d%% [", percent
for (i=0;i<=percent;i++) printf "="
printf ">"
for (i=percent;i<100;i++) printf " "
printf "]\r"
}
}
END { print "" }' total_size="$(stat -c "%s" $argv[1])" count=0
'';
description = "Copy a file with a visual progress bar";
};
# Copy and go to the directory
cpg = {
body = ''
cp $argv[1] $argv[2]
if test -d $argv[2]
cd $argv[2]
end
'';
description = "Copy a file and cd into the destination directory if it's a directory";
};
# Move and go to the directory
mvg = {
body = ''
mv $argv[1] $argv[2]
if test -d $argv[2]
cd $argv[2]
end
'';
description = "Move a file and cd into the destination directory if it's a directory";
};
# Create and go to the directory
mkdirg = {
body = ''
mkdir -p $argv[1]; and cd $argv[1]
'';
description = "Create a directory and cd into it";
};
# Go up N directories (e.g. up 4)
up = {
body = ''
set limit $argv[1]
if test -z "$limit"
set limit 1
end
set path (pwd)
for i in (seq $limit)
set path (dirname $path)
end
cd $path
'';
description = "Go up N directories";
};
# cd with automatic ls after each cd
cd = {
body = ''
builtin cd $argv
if test $status -eq 0
ls
end
'';
description = "cd with automatic ls";
};
# Return the last two components of the working directory
pwdtail = {
body = ''
pwd | awk -F/ '{nlast = NF - 1; print $nlast "/" $NF}'
'';
description = "Show the last two components of the current path";
};
# Download video via ffmpeg
ffmpeg_dl = {
body = ''
if count $argv != 3
echo "Usage: ffmpeg_dl <url> <name> <fs_path>"
return 1
end
set url $argv[1]
set name $argv[2]
set fs_path $argv[3]
mkdir -p $fs_path
set output "$fs_path/$name.mp4"
ffmpeg -i $url -c copy $output
'';
description = "Download a video using ffmpeg to a given location";
};
};
}
+25
View File
@@ -0,0 +1,25 @@
{pkgs, ...}: {
programs.fish.plugins = [
# {
# name = "z";
# src = pkgs.fetchFromGitHub {
# owner = "jethrokuan";
# repo = "z";
# rev = "ddeb28a7b6a1f0ec6dae40c636e5ca4908ad160a";
# sha256 = "0c5i7sdrsp0q3vbziqzdyqn4fmp235ax4mn4zslrswvn8g3fvdyh";
# };
# }
# # oh-my-fish plugins are stored in their own repositories, which
# # makes them simple to import into home-manager.
# {
# name = "fasd";
# src = pkgs.fetchFromGitHub {
# owner = "oh-my-fish";
# repo = "plugin-fasd";
# rev = "38a5b6b6011106092009549e52249c6d6f501fba";
# sha256 = "06v37hqy5yrv5a6ssd1p3cjd9y3hnp19d3ab7dag56fs1qmgyhbs";
# };
# }
];
}
+2 -18
View File
@@ -1,24 +1,8 @@
# Fzf is a general-purpose command-line fuzzy finder.
{
config,
lib,
...
}: let
accent = "#" + config.lib.stylix.colors.base0D;
foreground = "#" + config.lib.stylix.colors.base05;
muted = "#" + config.lib.stylix.colors.base03;
in {
_: {
programs.fzf = {
enable = true;
enableFishIntegration = true;
enableBashIntegration = true;
colors = lib.mkForce {
"fg+" = accent;
"bg+" = "-1";
"fg" = foreground;
"bg" = "-1";
"prompt" = muted;
"pointer" = accent;
};
defaultOptions = [
"--margin=1"
"--layout=reverse"
+3 -4
View File
@@ -1,6 +1,5 @@
{
host,
config,
pkgs,
...
}: let
@@ -64,8 +63,8 @@ in {
gaps_out = 8;
border_size = 2;
resize_on_border = true;
"col.active_border" = "rgb(${config.lib.stylix.colors.base08}) rgb(${config.lib.stylix.colors.base0C}) 45deg";
"col.inactive_border" = "rgb(${config.lib.stylix.colors.base01})";
# "col.active_border" = "rgb(${config.lib.stylix.colors.base08}) rgb(${config.lib.stylix.colors.base0C}) 45deg";
# "col.inactive_border" = "rgb(${config.lib.stylix.colors.base01})";
};
misc = {
@@ -107,7 +106,7 @@ in {
enabled = true;
range = 4;
render_power = 3;
color = "rgba(1a1a1aee)";
# color = "rgba(1a1a1aee)";
};
};
+1
View File
@@ -2,6 +2,7 @@
programs.kitty = {
enable = true;
package = pkgs.kitty;
shellIntegration.enableFishIntegration = true;
};
imports = [
+4 -9
View File
@@ -1,12 +1,7 @@
{
config,
lib,
...
}: let
accent = "#${config.lib.stylix.colors.base0D}";
in {
{lib, ...}: {
programs.starship = {
enable = true;
enableFishIntegration = true;
settings = {
add_newline = true;
format = lib.concatStrings [
@@ -44,8 +39,8 @@ in {
};
character = {
success_symbol = "[](${accent})";
error_symbol = "[](red)";
success_symbol = "";
error_symbol = "";
};
nix_shell = {
+58 -2
View File
@@ -1,14 +1,70 @@
{host, ...}: {
stylix.targets = {
librewolf.profileNames = ["${host}"];
hyprland.enable = false;
hyprland = {
enable = true;
colors.enable = true;
hyprpaper.enable = true;
image.enable = true;
};
vscode.enable = false;
zed.enable = false;
vesktop.enable = false;
vesktop = {
enable = true;
colors.enable = true;
fonts.enable = true;
};
noctalia-shell.enable = true;
qt = {
enable = true;
platform = "qtct";
};
fish = {
enable = true;
colors.enable = true;
inputs.enable = true;
};
starship = {
enable = true;
colors.enable = true;
};
fzf = {
enable = true;
colors.enable = true;
};
bat = {
enable = true;
colors.enable = true;
};
anki = {
enable = true;
colors.enable = true;
};
btop = {
enable = true;
colors.enable = true;
opacity.enable = true;
};
kitty = {
enable = true;
colors.enable = true;
fonts.enable = true;
inputs.enable = true;
opacity.enable = true;
variant256Colors = true;
};
};
}
+1 -3
View File
@@ -1,6 +1,5 @@
{username, ...}: {
home.file = {
".config/swappy/config".text = ''
home.file.".config/swappy/config".text = ''
[Default]
save_dir=/home/${username}/Pictures/Screenshots
save_filename_format=swappy-%Y%m%d-%H%M%S.png
@@ -12,5 +11,4 @@
early_exit=true
fill_shape=false
'';
};
}
+1 -3
View File
@@ -1,8 +1,6 @@
_: {
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
dconf.settings."org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
}
+1
View File
@@ -19,5 +19,6 @@ _: {
"deputy"
"biome"
"opencode"
"fish"
];
}
+2 -3
View File
@@ -1,11 +1,10 @@
_: {
programs = {
zoxide = {
programs.zoxide = {
enable = true;
enableFishIntegration = true;
enableBashIntegration = true;
options = [
"--cmd cd"
];
};
};
}