added enable options to termina modules.

This commit is contained in:
Gabe Venberg 2024-05-29 15:18:13 -05:00
parent 6f0e167087
commit 3eee4e105d
16 changed files with 358 additions and 298 deletions

View file

@ -4,10 +4,13 @@
lib, lib,
... ...
}: { }: {
programs.btop = { options.user.btop.enable = lib.mkEnableOption "enable btop";
enable = true; config = lib.mkIf config.user.btop.enable {
settings = { programs.btop = {
vim_keys = true; enable = true;
settings = {
vim_keys = true;
};
}; };
}; };
} }

View file

@ -0,0 +1,22 @@
{
config,
pkgs,
lib,
...
}: {
imports=[
./nushell
./zellij
./btop.nix
./direnv.nix
./git.nix
./gpg.nix
./irssi.nix
./pass.nix
./ssh-agent.nix
./starship.nix
./tiny-irc.nix
./voice.nix
./zsh.nix
];
}

View file

@ -4,8 +4,11 @@
lib, lib,
... ...
}: { }: {
options.user.direnv.enable = lib.mkEnableOption "enable direnv";
config= lib.mkIf config.user.direnv.enable{
programs.direnv = { programs.direnv = {
enable = true; enable = true;
nix-direnv.enable = true; nix-direnv.enable = true;
}; };
};
} }

View file

@ -6,6 +6,7 @@
}: { }: {
options = { options = {
user.git = { user.git = {
enable= lib.mkEnableOption "enable git";
workProfile = { workProfile = {
enable = lib.mkEnableOption "git work profile"; enable = lib.mkEnableOption "git work profile";
email = lib.mkOption { email = lib.mkOption {
@ -26,7 +27,7 @@
}; };
}; };
config = { config = lib.mkIf config.user.git.enable {
programs.git = { programs.git = {
enable = true; enable = true;
aliases = { aliases = {

View file

@ -4,11 +4,14 @@
lib, lib,
... ...
}: { }: {
programs.gpg.enable = true; options.user.gpg.enable = lib.mkEnableOption "enable gpg";
config = lib.mkIf config.user.gpg.enable {
programs.gpg.enable = true;
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
enableSshSupport = true; enableSshSupport = true;
pinentryPackage = lib.mkDefault pkgs.pinentry-tty; pinentryPackage = lib.mkDefault pkgs.pinentry-tty;
};
}; };
} }

View file

@ -4,33 +4,36 @@
lib, lib,
... ...
}: { }: {
programs.irssi = { options.user.irssi.enable = lib.mkEnableOption "enable irssi";
enable = true; config = lib.mkIf config.user.irssi.enable {
networks = { programs.irssi = {
liberachat = { enable = true;
nick = "toric"; networks = {
server = { liberachat = {
address = "irc.libera.chat"; nick = "toric";
port = 6697; server = {
autoConnect = true; address = "irc.libera.chat";
ssl = { port = 6697;
enable = true; autoConnect = true;
certificateFile = "${config.home.homeDirectory}/keys/certs/irc.pem"; ssl = {
verify = true; enable = true;
certificateFile = "${config.home.homeDirectory}/keys/certs/irc.pem";
verify = true;
};
};
channels = {
libera.autoJoin = true;
linux.autoJoin = true;
programming.autoJoin = true;
rust.autoJoin = true;
nixos.autoJoin = true;
git.autoJoin = true;
neovim.autoJoin = true;
kernel.autoJoin = true;
hardware.autoJoin = true;
lobsters.autoJoin = true;
gamingonlinux.autoJoin = true;
}; };
};
channels = {
libera.autoJoin = true;
linux.autoJoin = true;
programming.autoJoin = true;
rust.autoJoin = true;
nixos.autoJoin = true;
git.autoJoin = true;
neovim.autoJoin = true;
kernel.autoJoin = true;
hardware.autoJoin = true;
lobsters.autoJoin = true;
gamingonlinux.autoJoin = true;
}; };
}; };
}; };

View file

@ -1,34 +1,42 @@
{ {
config, config,
lib,
pkgs, pkgs,
... ...
}: { }: {
#sessionVariables, sessionPath and shellAliases are not applied to nushell. options.user.nushell.enable = lib.mkEnableOption "enable nushell";
programs.nushell = { config = lib.mkIf config.user.nushell.enable {
enable = true; home.file = {
configFile.source = ./config.nu; ".config/nushell/completions".source = ./completions;
envFile.source = ./env.nu; };
};
home.file = { programs = {
".config/nushell/completions".source = ./completions; #sessionVariables, sessionPath and shellAliases are not applied to nushell.
}; nushell = {
enable = true;
configFile.source = ./config.nu;
envFile.source = ./env.nu;
};
programs.yazi.enableNushellIntegration = true; yazi.enableNushellIntegration = true;
programs.zoxide.enableNushellIntegration = true; zoxide.enableNushellIntegration = true;
programs.starship.enableNushellIntegration = true; starship.enableNushellIntegration = true;
programs.carapace = { eza.enableNushellIntegration = true;
enable = true; carapace = {
enableNushellIntegration = true; enable = true;
}; enableNushellIntegration = true;
programs.direnv.enableNushellIntegration = true; };
services.gpg-agent.enableNushellIntegration = true; direnv.enableNushellIntegration = true;
};
services.pueue = { services = {
enable = true; gpg-agent.enableNushellIntegration = true;
settings = { pueue = {
daemon = { enable = true;
default_parallel_tasks = 5; settings = {
daemon = {
default_parallel_tasks = 5;
};
};
}; };
}; };
}; };

View file

@ -4,14 +4,17 @@
lib, lib,
... ...
}: { }: {
programs.password-store = { options.user.pass.enable = lib.mkEnableOption "enable pass password manager";
enable = true; config = lib.mkIf config.user.pass.enable {
settings = { programs.password-store = {
PASSWORD_STORE_DIR = "$HOME/keys/password-store"; enable = true;
settings = {
PASSWORD_STORE_DIR = "$HOME/keys/password-store";
};
}; };
};
programs.nushell.extraEnv = '' programs.nushell.extraEnv = ''
$env.PASSWORD_STORE_DIR = ($env.HOME | path join "keys" "password-store") $env.PASSWORD_STORE_DIR = ($env.HOME | path join "keys" "password-store")
''; '';
};
} }

View file

@ -4,8 +4,11 @@
lib, lib,
... ...
}: { }: {
services.ssh-agent.enable = true; options.user.ssh-agent.enable = lib.mkEnableOption "enable ssh-agent";
programs.nushell.extraEnv = '' config = lib.mkIf config.user.ssh-agent.enable {
$env.SSH_AUTH_SOCK = $"($env.XDG_RUNTIME_DIR)/ssh-agent" services.ssh-agent.enable = true;
''; programs.nushell.extraEnv = ''
$env.SSH_AUTH_SOCK = $"($env.XDG_RUNTIME_DIR)/ssh-agent"
'';
};
} }

View file

@ -4,106 +4,109 @@
lib, lib,
... ...
}: { }: {
programs.starship = { options.user.starship.enable = lib.mkEnableOption "enable starship prompt";
enable = true; config = lib.mkIf config.user.starship.enable {
settings = { programs.starship = {
format = lib.concatStrings [ enable = true;
"[](color_orange)" settings = {
"$shell" format = lib.concatStrings [
"$username" "[](color_orange)"
"[@](bg:color_orange)" "$shell"
"$hostname" "$username"
"[ ](bg:color_orange)" "[@](bg:color_orange)"
"[](bg:color_yellow fg:color_orange)" "$hostname"
"$directory" "[ ](bg:color_orange)"
"[](fg:color_yellow bg:color_aqua)" "[](bg:color_yellow fg:color_orange)"
"$git_branch" "$directory"
"$git_status" "[](fg:color_yellow bg:color_aqua)"
"[](fg:color_aqua bg:color_blue)" "$git_branch"
"$git_metrics" "$git_status"
"[](fg:color_blue bg:color_bg3)" "[](fg:color_aqua bg:color_blue)"
"$git_commit" "$git_metrics"
"[](fg:color_bg3 bg:color_bg1)" "[](fg:color_blue bg:color_bg3)"
"$time" "$git_commit"
"[ ](fg:color_bg1)" "[](fg:color_bg3 bg:color_bg1)"
"$line_break" "$time"
"$character" "[ ](fg:color_bg1)"
]; "$line_break"
add_newline = false; "$character"
palette = "gruvbox_dark"; ];
palettes.gruvbox_dark = { add_newline = false;
color_fg0 = "#fbf1c7"; palette = "gruvbox_dark";
color_bg1 = "#3c3836"; palettes.gruvbox_dark = {
color_bg3 = "#665c54"; color_fg0 = "#fbf1c7";
color_blue = "#458588"; color_bg1 = "#3c3836";
color_aqua = "#689d6a"; color_bg3 = "#665c54";
color_green = "#98971a"; color_blue = "#458588";
color_orange = "#d65d0e"; color_aqua = "#689d6a";
color_purple = "#b16286"; color_green = "#98971a";
color_red = "#cc241d"; color_orange = "#d65d0e";
color_yellow = "#d79921"; color_purple = "#b16286";
color_red = "#cc241d";
color_yellow = "#d79921";
};
hostname = {
ssh_only = false;
ssh_symbol = "🌐";
format = "[$hostname $ssh_symbol]($style)";
style = "bg:color_orange";
};
shell = {
disabled = false;
bash_indicator = "$";
fish_indicator = "<><";
zsh_indicator = "%";
nu_indicator = ">";
format = "[$indicator ]($style)";
style = "bg:color_orange";
};
fill = {
symbol = " ";
style = "bg:color_bg3";
};
username = {
show_always = true;
style_user = "bg:color_orange fg:color_fg0";
style_root = "bg:color_orange fg:color_fg0";
format = "[$user]($style)";
};
directory = {
style = "fg:color_fg0 bg:color_yellow";
format = "[ $path ]($style)";
fish_style_pwd_dir_length = 3;
truncation_length = 4;
truncation_symbol = "/";
};
git_branch = {
symbol = "";
style = "bg:color_aqua";
format = "[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)";
};
git_status = {
style = "bg:color_aqua";
format = "[[($all_status$ahead_behind )](fg:color_fg0 bg:color_aqua)]($style)";
};
git_metrics = {
disabled = false;
added_style = "bg:color_blue fg:bold green";
deleted_style = "bg:color_blue fg:bold red";
format = "([ +$added ]($added_style))([-$deleted ]($deleted_style))";
};
git_commit = {
only_detached = false;
tag_disabled = false;
format = "[($hash$tag)]($style)";
style = "bg:color_bg3";
};
time = {
disabled = false;
time_format = "%R";
style = "bg:color_bg1";
format = "[[ $time ](fg:color_fg0 bg:color_bg1)]($style)";
};
line_break.disabled = false;
character.disabled = false;
}; };
hostname = {
ssh_only = false;
ssh_symbol = "🌐";
format = "[$hostname $ssh_symbol]($style)";
style = "bg:color_orange";
};
shell = {
disabled = false;
bash_indicator = "$";
fish_indicator = "<><";
zsh_indicator = "%";
nu_indicator = ">";
format = "[$indicator ]($style)";
style = "bg:color_orange";
};
fill = {
symbol = " ";
style = "bg:color_bg3";
};
username = {
show_always = true;
style_user = "bg:color_orange fg:color_fg0";
style_root = "bg:color_orange fg:color_fg0";
format = "[$user]($style)";
};
directory = {
style = "fg:color_fg0 bg:color_yellow";
format = "[ $path ]($style)";
fish_style_pwd_dir_length = 3;
truncation_length = 4;
truncation_symbol = "/";
};
git_branch = {
symbol = "";
style = "bg:color_aqua";
format = "[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)";
};
git_status = {
style = "bg:color_aqua";
format = "[[($all_status$ahead_behind )](fg:color_fg0 bg:color_aqua)]($style)";
};
git_metrics = {
disabled = false;
added_style = "bg:color_blue fg:bold green";
deleted_style = "bg:color_blue fg:bold red";
format = "([ +$added ]($added_style))([-$deleted ]($deleted_style))";
};
git_commit = {
only_detached = false;
tag_disabled = false;
format = "[($hash$tag)]($style)";
style = "bg:color_bg3";
};
time = {
disabled = false;
time_format = "%R";
style = "bg:color_bg1";
format = "[[ $time ](fg:color_fg0 bg:color_bg1)]($style)";
};
line_break.disabled = false;
character.disabled = false;
}; };
}; };
} }

View file

@ -4,6 +4,8 @@
lib, lib,
... ...
}: { }: {
options.user.tiny.enable=lib.mkEnableOption "enable tiny irc client";
config=lib.mkIf config.user.tiny.enable {
programs.tiny = { programs.tiny = {
enable = true; enable = true;
settings = { settings = {
@ -31,9 +33,6 @@
]; ];
sasl = { sasl = {
username = "toric"; username = "toric";
# password = {
# command = "pass show libera";
# };
pem = "${config.home.homeDirectory}/keys/certs/irc.pem"; pem = "${config.home.homeDirectory}/keys/certs/irc.pem";
}; };
} }
@ -47,4 +46,4 @@
}; };
}; };
}; };
} };}

View file

@ -4,21 +4,17 @@
lib, lib,
... ...
}: { }: {
options = { options.user.enable-speech = lib.mkEnableOption "espeak";
user.enable-speech = lib.mkEnableOption "espeak";
};
config = config = lib.mkIf config.user.enable-speech {
lib.mkIf config.user.enable-speech home.shellAliases = {
{ say = "espeak -p 10 -s 150 -a 200";
home.shellAliases = {
say = "espeak -p 10 -s 150 -a 200";
};
home.packages = with pkgs; [
espeak
];
programs.nushell.extraConfig = ''
alias say = espeak -p 10 -s 150 -a 200
'';
}; };
home.packages = with pkgs; [
espeak
];
programs.nushell.extraConfig = ''
alias say = espeak -p 10 -s 150 -a 200
'';
};
} }

View file

@ -1,10 +1,14 @@
{ {
config, config,
lib,
pkgs, pkgs,
... ...
}: { }: {
programs.zellij.enable = true; options.user.zellij.enable = lib.mkEnableOption "enable zellij";
home.file = { config = lib.mkIf config.user.zellij.enable {
".config/zellij/config.kdl".source = ./config.kdl; programs.zellij.enable = true;
home.file = {
".config/zellij/config.kdl".source = ./config.kdl;
};
}; };
} }

View file

@ -4,101 +4,107 @@
lib, lib,
... ...
}: { }: {
programs.starship.enableZshIntegration = true; options.user.zsh.enable = lib.mkEnableOption "enable zsh";
programs.fzf.enableZshIntegration = true; config = lib.mkIf config.user.zsh.enable {
programs.zoxide.enableZshIntegration = true; programs = {
programs.yazi.enableZshIntegration = true; starship.enableZshIntegration = true;
programs.direnv.enableZshIntegration = true; fzf.enableZshIntegration = true;
programs.kitty.shellIntegration.enableZshIntegration = true; zoxide.enableZshIntegration = true;
services.gpg-agent.enableZshIntegration = true; yazi.enableZshIntegration = true;
programs.carapace.enableZshIntegration = false; eza.enableZshIntegration = true;
home.packages = with pkgs; [ direnv.enableZshIntegration = true;
curl kitty.shellIntegration.enableZshIntegration = true;
]; carapace.enableZshIntegration = false;
programs.zsh = { zsh = {
enable = true; enable = true;
enableCompletion = true; enableCompletion = true;
initExtra = lib.mkMerge [ initExtra = lib.mkMerge [
'' ''
#have the menu highlight while we cycle through options #have the menu highlight while we cycle through options
zstyle ':completion:*' menu select zstyle ':completion:*' menu select
#case insensitive completion #case insensitive completion
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
#allow completion from midword #allow completion from midword
setopt COMPLETE_IN_WORD setopt COMPLETE_IN_WORD
#move cursor to end of word after completing #move cursor to end of word after completing
setopt ALWAYS_TO_END setopt ALWAYS_TO_END
#complete aliases as well #complete aliases as well
setopt COMPLETE_ALIASES setopt COMPLETE_ALIASES
#select first item when you press tab the first time. #select first item when you press tab the first time.
setopt MENU_COMPLETE setopt MENU_COMPLETE
#case insensitive globbing #case insensitive globbing
setopt NO_CASE_GLOB setopt NO_CASE_GLOB
#sort globs that expand to numbers by number rather than alphabeticly #sort globs that expand to numbers by number rather than alphabeticly
setopt NUMERIC_GLOB_SORT setopt NUMERIC_GLOB_SORT
#allows for some neat globbing. #allows for some neat globbing.
setopt EXTENDED_GLOB setopt EXTENDED_GLOB
#allow backspacing beyond the point you entered insert mode: #allow backspacing beyond the point you entered insert mode:
bindkey -v '^?' backward-delete-char bindkey -v '^?' backward-delete-char
bindkey "^W" backward-kill-word bindkey "^W" backward-kill-word
#cheat.sh is a wonderful tool, the less typing needed the better. #cheat.sh is a wonderful tool, the less typing needed the better.
cheat(){ cheat(){
for i in $*; do; for i in $*; do;
curl cheat.sh/$i curl cheat.sh/$i
done done
} }
'' ''
(lib.mkIf (!config.programs.starship.enable) '' (lib.mkIf (!config.programs.starship.enable) ''
autoload -U promptinit autoload -U promptinit
promptinit promptinit
autoload -U colors autoload -U colors
colors colors
#stuff to show git things. #stuff to show git things.
autoload -Uz vcs_info autoload -Uz vcs_info
setopt prompt_subst setopt prompt_subst
precmd_vcs() {vcs_info} precmd_vcs() {vcs_info}
#when not in a repo, show full path to current directory. when in one, show path from base direcory of the repo. #when not in a repo, show full path to current directory. when in one, show path from base direcory of the repo.
zstyle ':vcs_info:*' nvcsformats '%~' zstyle ':vcs_info:*' nvcsformats '%~'
zstyle ':vcs_info:*' formats '%r/%S %F{green}[%b]%f' zstyle ':vcs_info:*' formats '%r/%S %F{green}[%b]%f'
zstyle ':vcs_info:*' actionformats '%r/%S %F{green}[%b] %F{red}<%a>%f' zstyle ':vcs_info:*' actionformats '%r/%S %F{green}[%b] %F{red}<%a>%f'
#the precmd function, called just before printing the prompt. #the precmd function, called just before printing the prompt.
function precmd() { function precmd() {
precmd_vcs precmd_vcs
} }
#Make the right prompt blank, just to be sure. #Make the right prompt blank, just to be sure.
RPROMPT="" RPROMPT=""
#on the top line, show a whole bunch of info. botton line should be as minimal as possilbe (just a single char to input next to...) #on the top line, show a whole bunch of info. botton line should be as minimal as possilbe (just a single char to input next to...)
PROMPT=$'%F{cyan}[%n@%m]%f%F{red}%f$${vcs_info_msg_0_} %F{white}[%D %T]%f\n»' PROMPT=$'%F{cyan}[%n@%m]%f%F{red}%f$${vcs_info_msg_0_} %F{white}[%D %T]%f\n»'
'') '')
];
autocd = true;
autosuggestion.enable = true;
defaultKeymap = "viins";
history = {
ignoreAllDups = true;
extended = true;
};
shellAliases = {
ll = "ls -lh";
la = "ls -lha";
please = "sudo $(fc -ln -1)";
pyactivate = "source ./.venv/bin/activate";
};
syntaxHighlighting = {
enable = true;
highlighters = [
"main"
"brackets"
"pattern"
"regexp"
"root"
"line"
];
};
};
};
services.gpg-agent.enableZshIntegration = true;
home.packages = with pkgs; [
curl
]; ];
autocd = true;
autosuggestion.enable = true;
defaultKeymap = "viins";
history = {
ignoreAllDups = true;
extended = true;
};
shellAliases = {
ll = "ls -lh";
la = "ls -lha";
please = "sudo $(fc -ln -1)";
pyactivate = "source ./.venv/bin/activate";
};
syntaxHighlighting = {
enable = true;
highlighters = [
"main"
"brackets"
"pattern"
"regexp"
"root"
"line"
];
};
}; };
} }

View file

@ -5,16 +5,18 @@
... ...
}: { }: {
imports = [ imports = [
../../modules/home-manager/terminal/zsh.nix ../../modules/home-manager/terminal
../../modules/home-manager/terminal/git.nix
../../modules/home-manager/terminal/zellij
../../modules/home-manager/terminal/ssh-agent.nix
../../modules/home-manager/terminal/direnv.nix
../../modules/home-manager/terminal/btop.nix
../../modules/home-manager/nvim ../../modules/home-manager/nvim
]; ];
user.nvim.enable = true; user = {
btop.enable = true;
direnv.enable = true;
git.enable = true;
ssh-agent.enable = true;
zsh.enable = true;
nvim.enable = true;
};
home.packages = with pkgs; [ home.packages = with pkgs; [
sshfs sshfs
@ -44,6 +46,7 @@
programs = { programs = {
yazi.enable = true; yazi.enable = true;
fzf.enable = true; fzf.enable = true;
eza.enable = true;
ripgrep.enable = true; ripgrep.enable = true;
bat.enable = true; bat.enable = true;
man.enable = true; man.enable = true;

View file

@ -11,9 +11,14 @@
../../modules/home-manager/terminal/tiny-irc.nix ../../modules/home-manager/terminal/tiny-irc.nix
]; ];
user.nvim = { user = {
enable-lsp = true; nushell.enable = true;
enable-treesitter = true; starship.enable = true;
tiny.enable = true;
nvim = {
enable-lsp = true;
enable-treesitter = true;
};
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -22,11 +27,6 @@
hyperfine hyperfine
]; ];
home.sessionVariables = {
PIPENV_VENV_IN_PROJECT = 1;
POETRY_VIRTUALENVS_IN_PROJECT = 1;
};
programs = { programs = {
zoxide.enable = true; zoxide.enable = true;
tealdeer.enable = true; tealdeer.enable = true;