working fish shell

This commit is contained in:
Charlie Root 2024-11-01 15:54:20 +01:00
commit 8b92b025f3
Signed by: faukah
SSH key fingerprint: SHA256:jpYIt4Vkz1NBTQcks/N9OPTfTFxE6KF2W/rV7hrfrIw
17 changed files with 134 additions and 109 deletions

16
modules/user/default.nix Normal file
View file

@ -0,0 +1,16 @@
{pkgs, ...}: rec {
packages = {
fish = pkgs.callPackage ./shell {};
};
shell = pkgs.mkShell {
name = "bloxx-shell";
buildInputs = [packages.fish];
};
module = {
config = {
environment.systemPackages = [
shell
];
};
};
}

View file

@ -0,0 +1,22 @@
{pkgs, ...}: let
inherit (pkgs.lib) getExe;
in {
ls = "${getExe pkgs.eza} --icons";
la = "${getExe pkgs.eza} --icons -lha --git";
g = "git";
n = "nix";
k = "kak";
c = "clear";
cc = "cd ~ && clear";
mv = "mv -iv";
rm = "${pkgs.trash-cli}/bin/trash";
lg = "${getExe pkgs.lazygit}";
ytopus = "yt-dlp -x --embed-metadata --audio-quality 0 --audio-format opus --embed-metadata --embed-thumbnail";
cat = "${getExe pkgs.bat} --plain";
kys = "shutdown now";
}

View file

View file

@ -0,0 +1,26 @@
# This shell setup was inspired by sioodmy. Check out his setup!
{pkgs, ...}: let
toml = pkgs.formats.toml {};
starship-config = import ./starship.nix;
aliases = import ./aliases.nix {inherit pkgs;};
fishinit = import ./fishinit.nix {inherit pkgs aliasesStr;};
aliasesStr =
pkgs.lib.concatStringsSep "\n"
(pkgs.lib.mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases);
packages = import ./packages.nix pkgs;
in
(pkgs.symlinkJoin {
name = "fish-wrapped";
paths = [pkgs.fish] ++ packages;
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/fish --set STARSHIP_CONFIG "${toml.generate "starship.toml" starship-config}" \
'';
})
.overrideAttrs (_: {
passthru = {
shellPath = "/bin/fish";
};
})

View file

@ -0,0 +1,16 @@
{
pkgs,
aliasesStr,
}:
pkgs.writeShellScriptBin "config.fish" ''
# source ${pkgs.fishPlugins.sponge}/share/zsh-defer/zsh-defer.plugin.zsh
${pkgs.atuin}/bin/atuin init fish | source
${pkgs.zoxide}/bin/zoxide init fish | source
source ${./config.fish}
${aliasesStr}
''

View file

@ -0,0 +1,21 @@
# This shell setup was inspired by sioodmy. Check out his setup!
{pkgs, ...}: let
toml = pkgs.formats.toml {};
starship-config = import ./starship.nix;
aliases = import ./aliases.nix;
fishinit = import ./fishinit.nix {inherit pkgs aliasesStr;};
aliasesStr =
pkgs.lib.concatStringsSep "\n"
(pkgs.lib.mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases);
packages = import ./packages.nix pkgs;
in (pkgs.symlinkJoin {
name = "fish-wrapped";
paths = [pkgs.fish] ++ packages;
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/fish --set STARSHIP_CONFIG "${toml.generate "starship.toml" starship-config}" \
--init-command source ${fishinit}
'';
})

View file

@ -0,0 +1,71 @@
pkgs: (with pkgs; [
# better cd
zoxide
#better ls
eza
# better cat
bat
# clipboard
yazi
serpl
diff-so-fancy
tig
sesh
mprocs
curlie
entr
procs
sd
# mult
glow
gdb
# dua-cli
dust
kondo
# better grep
ripgrep
# better dig
dogdns
# simply the best fetch tool out there
microfetch
fzf
lldb_19
element
carapace
difftastic
hexyl
gitui
iputils
gnumake
gping
asciinema
inetutils
scc
starship
onefetch
wget
cpufetch
yt-dlp
tealdeer
glow
hyperfine
imagemagick
ffmpeg-full
catimg
nmap
wget
fd
jq
rsync
figlet
unzip
zip
])

View file

@ -0,0 +1,2 @@
{
}