Skip to content

Commit

Permalink
Use fish shell
Browse files Browse the repository at this point in the history
  • Loading branch information
joinemm committed Oct 26, 2024
1 parent e059a15 commit 08c23eb
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 20 deletions.
5 changes: 1 addition & 4 deletions modules/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,9 @@
};

environment = {
# fix completion for zsh
pathsToLink = [ "/share/zsh" ];
# allow both zsh and bash
shells = [
pkgs.bashInteractive
pkgs.zsh
pkgs.fish
];

# uninstall all default packages that I don't need
Expand Down
15 changes: 14 additions & 1 deletion modules/home/common.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
{ pkgs, ... }:
{ pkgs, inputs, ... }:
{
home.stateVersion = "23.11";
programs.home-manager.enable = true;
nixpkgs.config.allowUnfree = true;
systemd.user.startServices = "sd-switch";

imports = [ inputs.nix-index-database.hmModules.nix-index ];

dconf = {
enable = true;
settings = {
"org/gnome/desktop/interface".color-scheme = "prefer-dark";
};
};

home.sessionVariables = {
TERMINAL = "wezterm";
EDITOR = "nvim";
};

programs = {
# run commands without installing them with `, <cmd>`
nix-index-database.comma.enable = true;
fzf.enable = true;
};

home.packages = with pkgs; [
# development
python3
Expand Down
15 changes: 14 additions & 1 deletion modules/home/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
inputs,
user,
lib,
pkgs,
...
}:
let
Expand Down Expand Up @@ -41,7 +42,6 @@ let
./yazi.nix
./zathura.nix
./zen.nix
./zsh.nix
./fish.nix
]
);
Expand All @@ -65,4 +65,17 @@ in
];
};
};

networking.firewall = rec {
allowedTCPPortRanges = [
{
from = 1714;
to = 1764;
}
];
allowedUDPPortRanges = allowedTCPPortRanges;
};

users.users."${user.name}".shell = pkgs.fish;
programs.fish.enable = true;
}
33 changes: 33 additions & 0 deletions modules/home/fish.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
{
programs.fish = {
enable = true;

shellAbbrs = {
gs = "git status";
gd = "git diff";
ga = "git add";
};

shellAliases = {
ls = "ls --color=auto --hyperlink";
mv = "mv -iv";
rm = "rm -I";
cp = "cp -iv";
ln = "ln -iv";

".." = "cd ..";
"..." = "cd ../..";
"...." = "cd ../../..";

please = "sudo $history[1]";
copy = "xclip -selection clipboard";
dev = "nix develop --impure -c $SHELL";
git-branch-cleanup = "git branch -vv | grep gone | awk '{print $1}' | xargs git branch -D";
};

shellInit = # fish
''
# Start X at login
if status is-login
if test -z "$DISPLAY" -a "$XDG_VTNR" = 1
exec startx -- -keeptty
end
end
'';
};
}
3 changes: 3 additions & 0 deletions modules/home/starship.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
programs.starship = {
enable = true;
enableTransience = true;
settings = {
add_newline = true;
right_format = "$time";
continuation_prompt = "▶▶ ";

battery.disabled = true;
git_metrics.disabled = false;
time.disabled = false;

nix_shell = {
format = "[󱄅 $name](#74b2ff) ";
Expand Down
11 changes: 0 additions & 11 deletions modules/home/zsh.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{ pkgs, inputs, ... }:
{
imports = [ inputs.nix-index-database.hmModules.nix-index ];

programs = {
# run commands without installing them with `, <cmd>`
nix-index-database.comma.enable = true;
fzf.enable = true;
};

programs.zsh = {
enable = true;

Expand All @@ -24,9 +16,6 @@
ln = "ln -iv";
please = "sudo $(fc -ln -1)";
lf = "lfub";
gs = "git status";
gd = "git diff";
ga = "git add";
ssh = "TERM=xterm-256color ssh";
"cd ..." = "cd ../..";
"cd ...." = "cd ../../..";
Expand Down
3 changes: 0 additions & 3 deletions modules/x11.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,4 @@
services.gnome.gnome-keyring.enable = true;

programs.dconf.enable = true;

programs.zsh.enable = true;
users.users."${user.name}".shell = pkgs.zsh;
}

0 comments on commit 08c23eb

Please sign in to comment.