feat(home): Starship
This commit is contained in:
parent
279102f413
commit
5ed3ac9754
4 changed files with 186 additions and 128 deletions
|
@ -39,6 +39,7 @@ in
|
|||
rbw = enabled;
|
||||
ripgrep = enabled;
|
||||
ssh = enabled;
|
||||
starship = enabled;
|
||||
systemctl = enabled;
|
||||
};
|
||||
xorg = {
|
||||
|
|
82
modules/home/programs/starship/default.nix
Normal file
82
modules/home/programs/starship/default.nix
Normal file
|
@ -0,0 +1,82 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
mkIf
|
||||
enabled
|
||||
mkForce
|
||||
concatStrings
|
||||
;
|
||||
inherit (lib.${namespace}) mkEnableModule;
|
||||
|
||||
cfg = config.${namespace}.programs.starship;
|
||||
inherit (config.${namespace}) theme;
|
||||
in
|
||||
{
|
||||
options = mkEnableModule "programs.starship";
|
||||
|
||||
imports = [
|
||||
./nerd-font-symbols.nix
|
||||
];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
|
||||
"${theme.colors.base}" = enabled;
|
||||
|
||||
settings = mkIf config.programs.starship.rose-pine.enabled {
|
||||
format = mkForce (concatStrings [
|
||||
"$username "
|
||||
"$directory "
|
||||
"$nix_shell "
|
||||
"$git_branch "
|
||||
"$git_status "
|
||||
"$fill "
|
||||
"$c "
|
||||
"$elixir "
|
||||
"$elm "
|
||||
"$golang "
|
||||
"$haskell "
|
||||
"$java "
|
||||
"$julia "
|
||||
"$nodejs "
|
||||
"$nim "
|
||||
"$rust "
|
||||
"$scala "
|
||||
"$python "
|
||||
"$time "
|
||||
"$line_break "
|
||||
"$character "
|
||||
]);
|
||||
|
||||
character =
|
||||
let
|
||||
vim = "";
|
||||
mkChar = sym: col: "[${sym}](fg:${col}) ";
|
||||
in
|
||||
{
|
||||
success_symbol = mkChar "" "iris";
|
||||
error_symbol = mkChar "" "love";
|
||||
vimcmd_symbol = mkChar vim "rose";
|
||||
vimcmd_replace_one_symbol = mkChar vim "gold";
|
||||
vimcmd_replace_symbol = mkChar vim "gold";
|
||||
vimcmd_visual_symbol = mkChar vim "iris";
|
||||
};
|
||||
|
||||
nix_shell = {
|
||||
format = "[](fg:overlay)[ $symbol $state( \($name\)) ]($style)[](fg:overlay) ";
|
||||
style = "bg:overlay fg:foam";
|
||||
};
|
||||
|
||||
git_branch.style = mkForce "bg:overlay fg:love";
|
||||
git_status.style = mkForce "bg:overlay fg:rose";
|
||||
time.style = mkForce "bg:overlay fg:gold";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
103
modules/home/programs/starship/nerd-font-symbols.nix
Normal file
103
modules/home/programs/starship/nerd-font-symbols.nix
Normal file
|
@ -0,0 +1,103 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkIf mkForce;
|
||||
|
||||
cfg = config.${namespace}.programs.starship;
|
||||
in
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
programs.starship.settings = {
|
||||
aws.symbol = mkForce " ";
|
||||
buf.symbol = mkForce " ";
|
||||
c.symbol = mkForce " ";
|
||||
conda.symbol = mkForce " ";
|
||||
crystal.symbol = mkForce " ";
|
||||
dart.symbol = mkForce " ";
|
||||
directory.read_only = mkForce " ";
|
||||
docker_context.symbol = mkForce " ";
|
||||
elixir.symbol = mkForce " ";
|
||||
elm.symbol = mkForce " ";
|
||||
fennel.symbol = mkForce " ";
|
||||
fossil_branch.symbol = mkForce " ";
|
||||
git_branch.symbol = mkForce " ";
|
||||
git_commit.tag_symbol = mkForce " ";
|
||||
golang.symbol = mkForce " ";
|
||||
guix_shell.symbol = mkForce " ";
|
||||
haskell.symbol = mkForce " ";
|
||||
haxe.symbol = mkForce " ";
|
||||
hg_branch.symbol = mkForce " ";
|
||||
hostname.ssh_symbol = mkForce " ";
|
||||
java.symbol = mkForce " ";
|
||||
julia.symbol = mkForce " ";
|
||||
kotlin.symbol = mkForce " ";
|
||||
lua.symbol = mkForce " ";
|
||||
memory_usage.symbol = mkForce " ";
|
||||
meson.symbol = mkForce " ";
|
||||
nim.symbol = mkForce " ";
|
||||
nix_shell.symbol = mkForce " ";
|
||||
nodejs.symbol = mkForce " ";
|
||||
ocaml.symbol = mkForce " ";
|
||||
os.symbols = {
|
||||
Alpine = mkForce " ";
|
||||
AlmaLinux = mkForce " ";
|
||||
Amazon = mkForce " ";
|
||||
Android = mkForce " ";
|
||||
Arch = mkForce " ";
|
||||
Artix = mkForce " ";
|
||||
CentOS = mkForce " ";
|
||||
Debian = mkForce " ";
|
||||
DragonFly = mkForce " ";
|
||||
Emscripten = mkForce " ";
|
||||
EndeavourOS = mkForce " ";
|
||||
Fedora = mkForce " ";
|
||||
FreeBSD = mkForce " ";
|
||||
Garuda = mkForce " ";
|
||||
Gentoo = mkForce " ";
|
||||
HardenedBSD = mkForce " ";
|
||||
Illumos = mkForce " ";
|
||||
Kali = mkForce " ";
|
||||
Linux = mkForce " ";
|
||||
Mabox = mkForce " ";
|
||||
Macos = mkForce " ";
|
||||
Manjaro = mkForce " ";
|
||||
Mariner = mkForce " ";
|
||||
MidnightBSD = mkForce " ";
|
||||
Mint = mkForce " ";
|
||||
NetBSD = mkForce " ";
|
||||
NixOS = mkForce " ";
|
||||
OpenBSD = mkForce " ";
|
||||
openSUSE = mkForce " ";
|
||||
OracleLinux = mkForce " ";
|
||||
Pop = mkForce " ";
|
||||
Raspbian = mkForce " ";
|
||||
Redhat = mkForce " ";
|
||||
RedHatEnterprise = mkForce " ";
|
||||
RockyLinux = mkForce " ";
|
||||
Redox = mkForce " ";
|
||||
Solus = mkForce " ";
|
||||
SUSE = mkForce " ";
|
||||
Ubuntu = mkForce " ";
|
||||
Unknown = mkForce " ";
|
||||
Void = mkForce " ";
|
||||
Windows = mkForce " ";
|
||||
};
|
||||
package.symbol = mkForce " ";
|
||||
perl.symbol = mkForce " ";
|
||||
php.symbol = mkForce " ";
|
||||
pijul_channel.symbol = mkForce " ";
|
||||
python.symbol = mkForce " ";
|
||||
rlang.symbol = mkForce " ";
|
||||
ruby.symbol = mkForce " ";
|
||||
rust.symbol = mkForce " ";
|
||||
scala.symbol = mkForce " ";
|
||||
swift.symbol = mkForce " ";
|
||||
zig.symbol = mkForce " ";
|
||||
gradle.symbol = mkForce " ";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,128 +0,0 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
|
||||
rose-pine.enable = true;
|
||||
|
||||
settings = lib.mkMerge [
|
||||
# Nerd Font Symbols
|
||||
{
|
||||
aws.symbol = lib.mkForce " ";
|
||||
buf.symbol = lib.mkForce " ";
|
||||
c.symbol = lib.mkForce " ";
|
||||
conda.symbol = lib.mkForce " ";
|
||||
crystal.symbol = lib.mkForce " ";
|
||||
dart.symbol = lib.mkForce " ";
|
||||
directory.read_only = lib.mkForce " ";
|
||||
docker_context.symbol = lib.mkForce " ";
|
||||
elixir.symbol = lib.mkForce " ";
|
||||
elm.symbol = lib.mkForce " ";
|
||||
fennel.symbol = lib.mkForce " ";
|
||||
fossil_branch.symbol = lib.mkForce " ";
|
||||
git_branch.symbol = lib.mkForce " ";
|
||||
git_commit.tag_symbol = lib.mkForce " ";
|
||||
golang.symbol = lib.mkForce " ";
|
||||
guix_shell.symbol = lib.mkForce " ";
|
||||
haskell.symbol = lib.mkForce " ";
|
||||
haxe.symbol = lib.mkForce " ";
|
||||
hg_branch.symbol = lib.mkForce " ";
|
||||
hostname.ssh_symbol = lib.mkForce " ";
|
||||
java.symbol = lib.mkForce " ";
|
||||
julia.symbol = lib.mkForce " ";
|
||||
kotlin.symbol = lib.mkForce " ";
|
||||
lua.symbol = lib.mkForce " ";
|
||||
memory_usage.symbol = lib.mkForce " ";
|
||||
meson.symbol = lib.mkForce " ";
|
||||
nim.symbol = lib.mkForce " ";
|
||||
nix_shell.symbol = lib.mkForce " ";
|
||||
nodejs.symbol = lib.mkForce " ";
|
||||
ocaml.symbol = lib.mkForce " ";
|
||||
os.symbols = {
|
||||
Alpine = lib.mkForce " ";
|
||||
AlmaLinux = lib.mkForce " ";
|
||||
Amazon = lib.mkForce " ";
|
||||
Android = lib.mkForce " ";
|
||||
Arch = lib.mkForce " ";
|
||||
Artix = lib.mkForce " ";
|
||||
CentOS = lib.mkForce " ";
|
||||
Debian = lib.mkForce " ";
|
||||
DragonFly = lib.mkForce " ";
|
||||
Emscripten = lib.mkForce " ";
|
||||
EndeavourOS = lib.mkForce " ";
|
||||
Fedora = lib.mkForce " ";
|
||||
FreeBSD = lib.mkForce " ";
|
||||
Garuda = lib.mkForce " ";
|
||||
Gentoo = lib.mkForce " ";
|
||||
HardenedBSD = lib.mkForce " ";
|
||||
Illumos = lib.mkForce " ";
|
||||
Kali = lib.mkForce " ";
|
||||
Linux = lib.mkForce " ";
|
||||
Mabox = lib.mkForce " ";
|
||||
Macos = lib.mkForce " ";
|
||||
Manjaro = lib.mkForce " ";
|
||||
Mariner = lib.mkForce " ";
|
||||
MidnightBSD = lib.mkForce " ";
|
||||
Mint = lib.mkForce " ";
|
||||
NetBSD = lib.mkForce " ";
|
||||
NixOS = lib.mkForce " ";
|
||||
OpenBSD = lib.mkForce " ";
|
||||
openSUSE = lib.mkForce " ";
|
||||
OracleLinux = lib.mkForce " ";
|
||||
Pop = lib.mkForce " ";
|
||||
Raspbian = lib.mkForce " ";
|
||||
Redhat = lib.mkForce " ";
|
||||
RedHatEnterprise = lib.mkForce " ";
|
||||
RockyLinux = lib.mkForce " ";
|
||||
Redox = lib.mkForce " ";
|
||||
Solus = lib.mkForce " ";
|
||||
SUSE = lib.mkForce " ";
|
||||
Ubuntu = lib.mkForce " ";
|
||||
Unknown = lib.mkForce " ";
|
||||
Void = lib.mkForce " ";
|
||||
Windows = " ";
|
||||
};
|
||||
package.symbol = lib.mkForce " ";
|
||||
perl.symbol = lib.mkForce " ";
|
||||
php.symbol = lib.mkForce " ";
|
||||
pijul_channel.symbol = lib.mkForce " ";
|
||||
python.symbol = lib.mkForce " ";
|
||||
rlang.symbol = lib.mkForce " ";
|
||||
ruby.symbol = lib.mkForce " ";
|
||||
rust.symbol = lib.mkForce " ";
|
||||
scala.symbol = lib.mkForce " ";
|
||||
swift.symbol = lib.mkForce " ";
|
||||
zig.symbol = lib.mkForce " ";
|
||||
gradle.symbol = lib.mkForce " ";
|
||||
}
|
||||
|
||||
{
|
||||
format = lib.mkForce (
|
||||
lib.concatStrings [
|
||||
"$username "
|
||||
"$directory "
|
||||
"$direnv "
|
||||
"$git_branch "
|
||||
"$git_status "
|
||||
"$fill "
|
||||
"$c "
|
||||
"$elixir "
|
||||
"$elm "
|
||||
"$golang "
|
||||
"$haskell "
|
||||
"$java "
|
||||
"$julia "
|
||||
"$nodejs "
|
||||
"$nim "
|
||||
"$rust "
|
||||
"$scala "
|
||||
"$python "
|
||||
"$time "
|
||||
"$line_break "
|
||||
"[](fg:iris) "
|
||||
]
|
||||
);
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue