feat: add wezterm, fish and starship

This commit is contained in:
Truxnell 2024-03-31 15:02:26 +11:00
parent b0146ca297
commit 20f48dfb27
8 changed files with 189 additions and 27 deletions

View file

@ -15,6 +15,7 @@ tasks:
cmds:
- echo "This will switch your config."
- task: .prompt_to_continue
- git add .
- sudo nixos-rebuild switch --flake "{{.ROOT_DIR}}/#{{.host}}" --impure
preconditions:
- sh: which nix

View file

@ -1,11 +1,23 @@
{ inputs
, config
, lib
, ...
}: {
imports = [
./shell
];
options.myHome.username = lib.mkOption {
type = lib.types.str;
description = "users username";
default = "truxnell";
};
options.myHome.homeDirectory = lib.mkOption {
type = lib.types.str;
description = "homedir";
default = "truxnell";
};
# Home-manager defaults
config = {
home.stateVersion = "23.11";

View file

@ -1,5 +1,7 @@
{ ... }: {
imports = [
# ./fish
./fish
./starship
./wezterm
];
}

View file

@ -4,7 +4,7 @@
, ...
}:
with lib; let
inherit (config.home) username homeDirectory;
inherit (config.myHome) username homeDirectory;
cfg = config.myHome.shell.fish;
in
{
@ -110,14 +110,14 @@ in
programs.nix-index.enable = true;
programs.fish = {
functions = {
agent = {
description = "Start SSH agent";
body = builtins.readFile ./functions/agent.fish;
};
};
};
# programs.fish = {
# functions = {
# agent = {
# description = "Start SSH agent";
# body = builtins.readFile ./functions/agent.fish;
# };
# };
# };
})
];
}

View file

@ -0,0 +1,115 @@
{ lib
, config
, ...
}:
with lib; let
cfg = config.myHome.shell.starship;
in
{
options.myHome.shell.starship = { enable = mkEnableOption "starship"; };
config = mkIf cfg.enable {
programs.starship = {
enable = true;
settings = {
add_newline = false;
command_timeout = 1000;
format = lib.concatStrings [
"$username"
"$hostname"
"$directory"
"$git_branch"
"$git_status"
"$\{custom.direnv\}"
"$fill"
"$python"
"$status"
"$cmd_duration"
"$line_break"
"$character"
];
username = {
style_user = "yellow";
style_root = "red";
format = "[$user]($style)";
show_always = false;
};
hostname = {
ssh_only = true;
format = "[@$hostname]($style) in ";
style = "green";
};
directory = {
truncation_length = 3;
format = "[$path]($style)[$read_only]($read_only_style) ";
style = "blue";
read_only = " ";
truncation_symbol = "../";
truncate_to_repo = true;
fish_style_pwd_dir_length = 1;
};
git_branch = {
format = "on [$symbol$branch]($style) ";
style = "purple";
symbol = " ";
};
git_status = {
format = "([$all_status$ahead_behind]($style) )";
style = "purple";
conflicted = " ";
ahead = " ";
behind = " ";
diverged = "󰆗 ";
up_to_date = " ";
untracked = " ";
stashed = " ";
modified = " ";
staged = " ";
renamed = " ";
deleted = " ";
};
fill = {
symbol = " ";
};
python = {
format = "[\${symbol}\${pyenv_prefix}(\${version} )(\($virtualenv\) )]($style)";
symbol = "🐍 ";
};
status = {
disabled = false;
format = "[$symbol]($style) ";
symbol = " ";
success_symbol = " ";
style = "red";
};
cmd_duration = {
min_time = 2000;
format = "took [$duration]($style) ";
style = "yellow";
};
character = {
success_symbol = "[](green)";
error_symbol = "[](green)";
vicmd_symbol = "[](purple)";
};
custom.direnv = {
format = "[$symbol]($style)";
symbol = " ";
style = "blue";
when = "env | grep -E '^DIRENV_FILE='";
};
};
};
};
}

View file

@ -0,0 +1,24 @@
{ config
, pkgs
, lib
, ...
}:
with lib; let
cfg = config.myHome.shell.wezterm;
in
{
options.myHome.shell.wezterm = {
enable = mkEnableOption "wezterm";
configPath = mkOption {
type = types.str;
};
};
# Temporary make .config/wezterm/wezterm.lua link to the local copy
config = mkIf cfg.enable {
# xdg.configFile."wezterm/wezterm.lua".source = config.lib.file.mkOutOfStoreSymlink cfg.configPath;
programs.wezterm = {
enable = true;
};
};
}

View file

@ -6,6 +6,13 @@ with config;
../modules
];
config = {
myHome.username = "truxnell";
myHome.homeDirectory = "/home/truxnell/";
myHome.shell.starship.enable = true;
myHome.shell.fish.enable = true;
myHome.shell.wezterm.enable = true;
# services.gpg-agent.pinentryPackage = pkgs.pinentry-qt;
systemd.user.sessionVariables = {
EDITOR = "nvim";
@ -29,7 +36,7 @@ with config;
ZDOTDIR = "/home/pinpox/.config/zsh";
};
};
};
}

View file

@ -9,6 +9,7 @@ with config;
steam
spotify
brightnessctl
prusaslicer
bat
dbus