flake: move packages to packages
dir
This commit is contained in:
parent
b599f7e425
commit
a3edf577dc
14 changed files with 22 additions and 21 deletions
24
packages/shell/aliases.nix
Normal file
24
packages/shell/aliases.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{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";
|
||||
|
||||
cd = "z";
|
||||
}
|
1
packages/shell/config.fish
Normal file
1
packages/shell/config.fish
Normal file
|
@ -0,0 +1 @@
|
|||
set fish_greeting
|
38
packages/shell/default.nix
Normal file
38
packages/shell/default.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
# 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;
|
||||
|
||||
# this was taken from viperml, check out his config for this!
|
||||
custom-fish = pkgs.fish.overrideAttrs (old: {
|
||||
patches = [./fish-on-tmpfs.patch];
|
||||
doCheck = false;
|
||||
postInstall =
|
||||
old.postInstall
|
||||
+ ''
|
||||
echo "source ${fishinit}" >> $out/etc/fish/config.fish
|
||||
'';
|
||||
});
|
||||
in
|
||||
(pkgs.symlinkJoin {
|
||||
name = "fish-wrapped";
|
||||
paths = [custom-fish] ++ packages;
|
||||
buildInputs = [pkgs.makeWrapper];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/fish --set STARSHIP_CONFIG "${toml.generate "starship.toml" starship-config}" \
|
||||
--set SSH_AUTH_SOCK /run/user/1000/ssh-agent \
|
||||
'';
|
||||
})
|
||||
.overrideAttrs (_: {
|
||||
passthru = {
|
||||
shellPath = "/bin/fish";
|
||||
};
|
||||
})
|
10
packages/shell/fish-on-tmpfs.patch
Normal file
10
packages/shell/fish-on-tmpfs.patch
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- a/src/path.cpp
|
||||
+++ b/src/path.cpp
|
||||
@@ -384,7 +384,7 @@ static const base_directory_t &get_data_directory() {
|
||||
}
|
||||
|
||||
static const base_directory_t &get_config_directory() {
|
||||
- static base_directory_t s_dir = make_base_directory(L"XDG_CONFIG_HOME", L"/.config/fish");
|
||||
+ static base_directory_t s_dir = make_base_directory(L"XDG_RUNTIME_DIR", L"/.config/fish");
|
||||
return s_dir;
|
||||
}
|
19
packages/shell/fishinit.nix
Normal file
19
packages/shell/fishinit.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
pkgs,
|
||||
aliasesStr,
|
||||
}:
|
||||
pkgs.writeText "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
|
||||
${pkgs.starship}/bin/starship init fish | source
|
||||
${pkgs.direnv}/bin/direnv hook fish | source
|
||||
${pkgs.pay-respects}/bin/pay-respects fish --alias f --nocnf | source
|
||||
|
||||
|
||||
source ${./config.fish}
|
||||
|
||||
|
||||
${aliasesStr}
|
||||
''
|
65
packages/shell/packages.nix
Normal file
65
packages/shell/packages.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
pkgs:
|
||||
builtins.attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
# better cd
|
||||
zoxide
|
||||
#better ls
|
||||
eza
|
||||
atuin
|
||||
# better cat
|
||||
bat
|
||||
# clipboard
|
||||
# yazi
|
||||
serpl
|
||||
diff-so-fancy
|
||||
tig
|
||||
direnv
|
||||
sesh
|
||||
mprocs
|
||||
curlie
|
||||
entr
|
||||
procs
|
||||
sd
|
||||
# mult
|
||||
glow
|
||||
# dua-cli
|
||||
dust
|
||||
kondo
|
||||
# better grep
|
||||
ripgrep
|
||||
# better dig
|
||||
dogdns
|
||||
# simply the best fetch tool out there
|
||||
microfetch
|
||||
fzf
|
||||
element
|
||||
carapace
|
||||
difftastic
|
||||
hexyl
|
||||
iputils
|
||||
gnumake
|
||||
gping
|
||||
asciinema
|
||||
inetutils
|
||||
scc
|
||||
starship
|
||||
onefetch
|
||||
wget
|
||||
cpufetch
|
||||
yt-dlp
|
||||
tealdeer
|
||||
hyperfine
|
||||
imagemagick
|
||||
ffmpeg-full
|
||||
# catimg
|
||||
timg
|
||||
nmap
|
||||
fd
|
||||
jq
|
||||
rsync
|
||||
figlet
|
||||
unzip
|
||||
zip
|
||||
;
|
||||
}
|
60
packages/shell/starship.nix
Normal file
60
packages/shell/starship.nix
Normal file
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
add_newline = false;
|
||||
command_timeout = 2000;
|
||||
# format = "$hostname$username$directory$shell$nix_shell$git_branch$git_commit$git_state$git_status$jobs$cmd_duration\n$character";
|
||||
scan_timeout = 2;
|
||||
|
||||
character = {
|
||||
error_symbol = "[](bold red)";
|
||||
format = "$symbol [|](bold bright-black) ";
|
||||
success_symbol = "[](bold green)";
|
||||
vicmd_symbol = "[](bold yellow)";
|
||||
};
|
||||
directory = {
|
||||
format = "[ ](bold green) [$path]($style) ";
|
||||
truncation_length = 2;
|
||||
};
|
||||
git_branch = {
|
||||
style = "bold purple";
|
||||
};
|
||||
|
||||
git_commit.commit_hash_length = 7;
|
||||
|
||||
git_status = {
|
||||
ahead = "⇡ ";
|
||||
behind = "⇣ ";
|
||||
conflicted = " ";
|
||||
deleted = "✘ ";
|
||||
diverged = "⇆ ";
|
||||
modified = "!";
|
||||
renamed = "»";
|
||||
staged = "+";
|
||||
stashed = "≡";
|
||||
style = "red";
|
||||
untracked = "?";
|
||||
};
|
||||
|
||||
hostname = {
|
||||
disabled = false;
|
||||
format = "@[$hostname](bold blue) ";
|
||||
ssh_only = true;
|
||||
};
|
||||
|
||||
line_break.disabled = false;
|
||||
|
||||
c.symbol = "[ ](black)";
|
||||
lua.symbol = "[ ](blue) ";
|
||||
|
||||
golang.symbol = "[ ](blue)";
|
||||
nix_shell.symbol = "[ ](blue) ";
|
||||
|
||||
nodejs.symbol = "[ ](yellow)";
|
||||
|
||||
package.symbol = "📦 ";
|
||||
|
||||
python.symbol = "[ ](blue) ";
|
||||
|
||||
rust.symbol = "[ ](red) ";
|
||||
|
||||
username.format = "[$user]($style) in ";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue