feat: shpool
This commit is contained in:
@@ -14,6 +14,9 @@ in
|
|||||||
monitor.all.enable = true;
|
monitor.all.enable = true;
|
||||||
shell.all.enable = true;
|
shell.all.enable = true;
|
||||||
vcs.all.enable = true;
|
vcs.all.enable = true;
|
||||||
|
|
||||||
|
shpool.enable = true;
|
||||||
|
tmux.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,26 +75,6 @@ in
|
|||||||
typos
|
typos
|
||||||
# keep-sorted end
|
# keep-sorted end
|
||||||
];
|
];
|
||||||
programs.tmux = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = ''
|
|
||||||
set-option -g mouse on
|
|
||||||
set-option -a terminal-features ",xterm-256color:RGB,focus,clipboard,usstyle"
|
|
||||||
'';
|
|
||||||
plugins = [
|
|
||||||
(pkgs.tmuxPlugins.mkTmuxPlugin {
|
|
||||||
pluginName = "tokyo-night-tmux";
|
|
||||||
rtpFilePath = "tokyo-night.tmux";
|
|
||||||
version = "legacy";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "janoamaral";
|
|
||||||
repo = "tokyo-night-tmux";
|
|
||||||
rev = "16469dfad86846138f594ceec780db27039c06cd";
|
|
||||||
hash = "sha256-EKCgYan0WayXnkSb2fDJxookdBLW0XBKi2hf/YISwJE=";
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
programs.tealdeer = {
|
programs.tealdeer = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableAutoUpdates = true;
|
enableAutoUpdates = true;
|
||||||
|
|||||||
@@ -5,17 +5,26 @@ in
|
|||||||
{
|
{
|
||||||
options.my.cli.shell.starship = {
|
options.my.cli.shell.starship = {
|
||||||
enable = lib.mkEnableOption "starship prompt";
|
enable = lib.mkEnableOption "starship prompt";
|
||||||
};
|
format = lib.mkOption {
|
||||||
|
type = with lib.types; listOf singleLineStr;
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
my.hm = {
|
|
||||||
programs.starship = {
|
|
||||||
enable = true;
|
|
||||||
settings = lib.recursiveUpdate (with builtins; fromTOML (readFile ./starship-preset.toml)) {
|
|
||||||
add_newline = false;
|
|
||||||
nix_shell.disabled = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
my.cli.shell.starship.format = lib.mkOrder 0 [ "$all" ];
|
||||||
|
}
|
||||||
|
(lib.mkIf cfg.enable {
|
||||||
|
my.hm = {
|
||||||
|
programs.starship = {
|
||||||
|
enable = true;
|
||||||
|
settings = lib.recursiveUpdate (with builtins; fromTOML (readFile ./starship-preset.toml)) {
|
||||||
|
add_newline = false;
|
||||||
|
nix_shell.disabled = true;
|
||||||
|
format = lib.concatStringsSep "" cfg.format;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
41
modules/cli/shpool.nix
Normal file
41
modules/cli/shpool.nix
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.my.cli.shpool;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.cli.shpool = {
|
||||||
|
enable = lib.mkEnableOption "shpool";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
my.hm = {
|
||||||
|
services.shpool = {
|
||||||
|
enable = true;
|
||||||
|
systemd = true;
|
||||||
|
settings = {
|
||||||
|
motd = "never";
|
||||||
|
prompt_prefix = "";
|
||||||
|
forward_env = [ "PATH" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# https://github.com/starship/starship/discussions/7260
|
||||||
|
# programs.starship = {
|
||||||
|
# settings = {
|
||||||
|
# custom.shpool = {
|
||||||
|
# description = "Display current shpool session name";
|
||||||
|
# when = ''test -n "$SHPOOL_SESSION_NAME"'';
|
||||||
|
# command = "echo $SHPOOL_SESSION_NAME";
|
||||||
|
# symbol = " ";
|
||||||
|
# style = "fg:#dea584";
|
||||||
|
# format = "[$symbol $output]($style)";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
# my.cli.shell.starship.format = [ "$starship$character" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
53
modules/cli/tmux.nix
Normal file
53
modules/cli/tmux.nix
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.my.cli.tmux;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.cli.tmux = {
|
||||||
|
enable = lib.mkEnableOption "tmux";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
my.hm = {
|
||||||
|
programs.tmux = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = ''
|
||||||
|
set-option -g mouse on
|
||||||
|
set-option -a terminal-features ",xterm-256color:RGB,focus,clipboard,usstyle"
|
||||||
|
'';
|
||||||
|
plugins = [
|
||||||
|
(pkgs.tmuxPlugins.mkTmuxPlugin {
|
||||||
|
pluginName = "tokyo-night-tmux";
|
||||||
|
rtpFilePath = "tokyo-night.tmux";
|
||||||
|
version = "legacy";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "janoamaral";
|
||||||
|
repo = "tokyo-night-tmux";
|
||||||
|
rev = "16469dfad86846138f594ceec780db27039c06cd";
|
||||||
|
hash = "sha256-EKCgYan0WayXnkSb2fDJxookdBLW0XBKi2hf/YISwJE=";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
# https://github.com/starship/starship/discussions/7260
|
||||||
|
# programs.starship = {
|
||||||
|
# settings = {
|
||||||
|
# custom.tmux = {
|
||||||
|
# description = "Display current tmux session name";
|
||||||
|
# when = ''test -n "$TMUX"'';
|
||||||
|
# command = "tmux display-message -p '#S'";
|
||||||
|
# symbol = " ";
|
||||||
|
# style = "bold green";
|
||||||
|
# format = "[$symbol $output]($style)";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
# my.cli.shell.starship.format = [ "$tmux$character" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -60,11 +60,10 @@ in
|
|||||||
programs.starship = {
|
programs.starship = {
|
||||||
settings = {
|
settings = {
|
||||||
custom = {
|
custom = {
|
||||||
|
# Borrowed from https://github.com/jj-vcs/jj/wiki/Starship/b18afc53417848f58333b24d446b8e2522b42bd2#alternative-prompt
|
||||||
jj = {
|
jj = {
|
||||||
ignore_timeout = true;
|
ignore_timeout = true;
|
||||||
description = "The current jj status";
|
description = "The current jj status";
|
||||||
# when = "${lib.getExe pkgs.jj-starship} detect";
|
|
||||||
# command = "${lib.getExe pkgs.jj-starship}";
|
|
||||||
when = true;
|
when = true;
|
||||||
command = ''
|
command = ''
|
||||||
jj log --revisions @ --no-graph --ignore-working-copy --color always --limit 1 --template '
|
jj log --revisions @ --no-graph --ignore-working-copy --color always --limit 1 --template '
|
||||||
|
|||||||
Reference in New Issue
Block a user