Skip to content

Commit

Permalink
home-manager: split shell related into it's own file
Browse files Browse the repository at this point in the history
  • Loading branch information
moni-dz committed Nov 25, 2024
1 parent 4027446 commit e8fe3d6
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 107 deletions.
13 changes: 0 additions & 13 deletions modules/shared/home-manager/config/sh-aliases.nix

This file was deleted.

57 changes: 0 additions & 57 deletions modules/shared/home-manager/config/starship.nix

This file was deleted.

39 changes: 2 additions & 37 deletions modules/shared/home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
- Appendix A. Configuration Options: https://nix-community.gitlab.io/home-manager/options.html
*/
{
imports = [ ./fish.nix ];

home = {
packages = __attrValues {
inherit (pkgs)
Expand All @@ -36,24 +38,6 @@
};

programs = {
dircolors = {
enable = true;
enableFishIntegration = config.programs.fish.enable;

extraConfig = __readFile (
pkgs.fetchurl {
url = "https://raw.githubusercontent.com/trapd00r/LS_COLORS/3d833761506d6396f8331fcd11a32d9e3ad3ee80/LS_COLORS";
hash = "sha256-r70V0JvQ/zlI/uYZ33OGl99qphCXtAgj6+Y3TXbJTLU=";
}
);
};

direnv = {
enable = true;
silent = true;
nix-direnv.enable = true;
};

eza = {
enable = true;
package = pkgs.eza;
Expand Down Expand Up @@ -138,24 +122,5 @@
};

nix-index-database.comma.enable = lib.mkDefault true;

starship = {
enable = true;
settings = import ./config/starship.nix;
};

zoxide = {
enable = true;
enableFishIntegration = config.programs.fish.enable;
};

fish = {
enable = true;
shellAbbrs = import ./config/sh-aliases.nix;

interactiveShellInit = ''
set -U fish_greeting
'';
};
};
}
110 changes: 110 additions & 0 deletions modules/shared/home-manager/fish.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{ config, pkgs, ... }:

{
programs = {
dircolors = {
enable = true;
enableFishIntegration = config.programs.fish.enable;

extraConfig = __readFile (
pkgs.fetchurl {
url = "https://raw.githubusercontent.com/trapd00r/LS_COLORS/3d833761506d6396f8331fcd11a32d9e3ad3ee80/LS_COLORS";
hash = "sha256-r70V0JvQ/zlI/uYZ33OGl99qphCXtAgj6+Y3TXbJTLU=";
}
);
};

direnv = {
enable = true;
silent = true;
nix-direnv.enable = true;
};

fish = {
enable = true;
shellAbbrs = {
ls = "eza";
ll = "eza -l";
la = "eza -a";
lt = "eza --tree";
lla = "eza -la";
mv = "mv -i";
cp = "cp -i";
rm = "rm -i";
vi = "nvim";
vim = "nvim";
vimdiff = "nvim -d";
};

interactiveShellInit = ''
set -U fish_greeting
'';
};

starship = {
enable = true;
settings = {
command_timeout = 3000;
format = "$username$hostname$nix_shell$character";
right_format = "$directory$git_branch$git_commit$git_state$git_status";

character = {
success_symbol = "[♥](bold green)";
error_symbol = "[♥](bold red)";
vimcmd_symbol = "[♡](bold purple)";
vimcmd_replace_symbol = "[♡](bold green)";
vimcmd_replace_one_symbol = "[♡](bold green)";
vimcmd_visual_symbol = "[♡](bold yellow)";
};

username = {
format = "[$user]($style) ";
disabled = false;
show_always = true;
};

hostname = {
ssh_only = true;
ssh_symbol = "";
format = "at [$hostname](bold blue) ";
disabled = false;
};

git_commit.format = ''( [\($hash$tag\)]($style))'';
git_state.format = " [\\($state( $progress_current/$progress_total)\\)]($style)";

git_status = {
ahead = "↑";
behind = "↓";
conflicted = "±";
deleted = "×";
diverged = "↕";
modified = "‼";
renamed = "≡";
stashed = "⌂";
format = ''( [\[$all_status$ahead_behind\]]($style))'';
};

git_branch = {
format = " → [$symbol$branch(:$remote_branch)]($style)";
symbol = "";
};

battery.disabled = true;
line_break.disabled = true;

directory = {
read_only = "(ro)";
format = "[$read_only]($read_only_style) [$path]($style)";
};

nix_shell.format = "[(\\($name\\))]($style) ";
};
};

zoxide = {
enable = true;
enableFishIntegration = config.programs.fish.enable;
};
};
}

0 comments on commit e8fe3d6

Please sign in to comment.