Skip to content

Commit

Permalink
wezterm & starship
Browse files Browse the repository at this point in the history
  • Loading branch information
number5 committed Jun 5, 2024
1 parent 1cc4b05 commit fa3cee3
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 18 deletions.
3 changes: 0 additions & 3 deletions home/modules/apps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
unrar
unzip
vlc
wezterm
xbanish
xclip
xdotool
Expand All @@ -42,8 +41,6 @@
cmake
gh
asdf-vm
nix-prefetch-git
yarn

# Nix
nix-prefetch-git
Expand Down
1 change: 1 addition & 0 deletions home/modules/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
inputs: {
"home" = import ./home.nix inputs;
"wezterm" = import ./wezterm inputs;
"programs/nixpkgs" = import ./programs/nixpkgs inputs;
"mutablerepos" = import ./mutablerepos.nix inputs;

Expand Down
15 changes: 3 additions & 12 deletions home/modules/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,17 @@
in {
_file = ./default.nix;

fonts.fontconfig.enable = true;

systemd.user = {
# sessionVariables = { NIX_PATH = nixPath; };
};

# xsession.windowManager.awesome.enable = true;
imports = [
./starship.nix
];

home = {
# sessionVariables = { NIX_PATH = nixPath; };

packages = let
p = pkgs;
s = self';
in [
p.cachix
p.exercism

p.fira-code

p.lefthook
];

Expand Down
71 changes: 71 additions & 0 deletions home/modules/starship.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{config, ...}: {
home.sessionVariables.STARSHIP_CACHE = "${config.xdg.cacheHome}/starship";

programs.starship = {
enable = true;
settings = {
format = ''
$os$directory$character
'';
right_format = ''
($nix_shell) $git_branch $git_status
'';
scan_timeout = 10;
line_break.disabled = true;

os = {
format = "[](fg:#7DAEA3 bg:none)[$symbol]($style)[](fg:#7DAEA3 bg:#26243C)";
symbols.NixOS = "󰊠 ";
style = "fg:#131313 bg:#7DAEA3";
disabled = false;
};

directory = {
format = "[](fg:#26243C bg:#26243C)[󰉋 ](fg:#D8A657 bg:#26243C)[ $path ](fg:#D8A657 bg:#26243C)[](fg:#26243C bg:none)";
truncation_length = 3;
truncate_to_repo = false;
};

git_branch = {
format = "[](fg:#A9B665 bg:none)[](fg:#131313 bg:#A9B665)[](fg:#A9B665 bg:#A9B665)[$branch ](fg:#131313 bg:#A9B665)[](fg:#A9B665 bg:none)";
};

git_status = {
format = "[](fg:#232526 bg:none)[$all_status $ahead_behind]($style)[](fg:#232526 bg:#232526)[](fg:#67afc1 bg:#232526)[  ](fg:#232526 bg:#67afc1)[](fg:#67afc1 bg:none)";
style = "fg:#D4BE98 bg:#232526";
conflicted = "=";
ahead = "⇡$\{count\}";
behind = "⇣$\{count\}";
diverged = "⇕⇡$\{ahead_count\}⇣$\{behind_count\}";
up_to_date = "";
untracked = "?$\{count\}";
stashed = "";
modified = "!$\{count\}";
staged = "+$\{count\}";
renamed = "»$\{count\}";
deleted = "$\{count\}";
};

character = {
success_symbol = "[ 󱐋 ](bold yellow)";
error_symbol = "[ 󱐋 ](bold red)";
vicmd_symbol = "[  ](bold green)";
};

nix_shell = {
impure_msg = "";
symbol = " ";
heuristic = true;
format = "[($name \\(develop\\)) ]($style)[](fg:#7DAEA3 bg:none)[$symbol](fg:#131313 bg:#7DAEA3)[](fg:#7DAEA3 bg:none)";
};

shlvl = {
format = "[$shlvl]($style) ";
style = "bold cyan";
threshold = 2;
repeat = true;
disabled = false;
};
};
};
}
22 changes: 22 additions & 0 deletions home/modules/wezterm/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
_: {
pkgs,
config,
...
}: {
config = {
home.packages = with pkgs; [
fira-code
wezterm
];

xdg = {
enable = true;
configFile = {
wezterm_lua = {
target = "wezterm/wezterm.lua";
source = ./wezterm.lua;
};
};
};
};
}
31 changes: 31 additions & 0 deletions home/modules/wezterm/wezterm.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- Pull in the wezterm API
local wezterm = require("wezterm")

-- This table will hold the configuration.
local config = {}

-- In newer versions of wezterm, use the config_builder which will
-- help provide clearer error messages
if wezterm.config_builder then
config = wezterm.config_builder()
end

-- config.color_scheme = "Catppuccin Macchiato"
config.color_scheme = "Tokyo Night"
-- config.color_scheme = "Dracula+"

config.font_size = 19.0

config.font = wezterm.font_with_fallback({
"JetBrains Mono",
{ family = "Iosevka Term Slab", stretch = "Expanded", weight = "ExtraLight" },
"Noto Color Emoji",
})

config.scrollback_lines = 200000
config.tab_max_width = 24
config.use_dead_keys = false
config.window_decorations = "RESIZE" -- no title bar
config.window_background_opacity = 0.95
-- and finally, return the configuration to wezterm
return config
5 changes: 2 additions & 3 deletions nixos/modules/fonts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
fonts.fontconfig.enable = true;

environment.systemPackages = with pkgs; [
(nerdfonts.override {fonts = ["JetBrainsMono" "Noto"];})
source-han-mono
source-han-serif
iosevka
sarasa-gothic
roboto-mono
noto-fonts
noto-fonts-cjk
Expand Down

0 comments on commit fa3cee3

Please sign in to comment.