feat: add wezterm, fish and starship
This commit is contained in:
parent
b0146ca297
commit
20f48dfb27
8 changed files with 189 additions and 27 deletions
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
# ./fish
|
||||
./fish
|
||||
./starship
|
||||
./wezterm
|
||||
];
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
115
nixos/home/modules/shell/starship/default.nix
Normal file
115
nixos/home/modules/shell/starship/default.nix
Normal 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='";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
24
nixos/home/modules/shell/wezterm/default.nix
Normal file
24
nixos/home/modules/shell/wezterm/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -6,30 +6,37 @@ with config;
|
|||
../modules
|
||||
];
|
||||
|
||||
# services.gpg-agent.pinentryPackage = pkgs.pinentry-qt;
|
||||
systemd.user.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
VISUAL = "nvim";
|
||||
ZDOTDIR = "/home/pinpox/.config/zsh";
|
||||
};
|
||||
config = {
|
||||
myHome.username = "truxnell";
|
||||
myHome.homeDirectory = "/home/truxnell/";
|
||||
myHome.shell.starship.enable = true;
|
||||
myHome.shell.fish.enable = true;
|
||||
myHome.shell.wezterm.enable = true;
|
||||
|
||||
home = {
|
||||
# Install these packages for my user
|
||||
packages = with pkgs; [
|
||||
eza
|
||||
htop
|
||||
unzip
|
||||
];
|
||||
|
||||
sessionVariables = {
|
||||
# Workaround for alacritty (breaks wezterm and other apps!)
|
||||
# LIBGL_ALWAYS_SOFTWARE = "1";
|
||||
# services.gpg-agent.pinentryPackage = pkgs.pinentry-qt;
|
||||
systemd.user.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
VISUAL = "nvim";
|
||||
ZDOTDIR = "/home/pinpox/.config/zsh";
|
||||
};
|
||||
|
||||
home = {
|
||||
# Install these packages for my user
|
||||
packages = with pkgs; [
|
||||
eza
|
||||
htop
|
||||
unzip
|
||||
];
|
||||
|
||||
sessionVariables = {
|
||||
# Workaround for alacritty (breaks wezterm and other apps!)
|
||||
# LIBGL_ALWAYS_SOFTWARE = "1";
|
||||
EDITOR = "nvim";
|
||||
VISUAL = "nvim";
|
||||
ZDOTDIR = "/home/pinpox/.config/zsh";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ with config;
|
|||
steam
|
||||
spotify
|
||||
brightnessctl
|
||||
prusaslicer
|
||||
|
||||
bat
|
||||
dbus
|
||||
|
|
Reference in a new issue