changed home-manager/default to common, added non-starship zsh prompt.

This commit is contained in:
Gabe Venberg 2024-05-07 22:20:11 -05:00
parent 80ac00a7cf
commit f180fc20f1
10 changed files with 64 additions and 24 deletions

View file

@ -89,7 +89,7 @@ inputs.nixpkgs.lib.nixosSystem {
imports = [ imports = [
../../modules/home-manager/terminal ../../modules/home-manager/terminal
../../modules/home-manager/nvim ../../modules/home-manager/nvim
../../modules/home-manager ../../modules/home-manager/common.nix
../../modules/home-manager/email.nix ../../modules/home-manager/email.nix
inputs.nixvim.homeManagerModules.nixvim inputs.nixvim.homeManagerModules.nixvim
]; ];

View file

@ -28,6 +28,7 @@ inputs.home-manager.lib.homeManagerConfiguration {
workProfile.enable = false; workProfile.enable = false;
}; };
}; };
host.isLaptop = true;
targets.genericLinux.enable = true; targets.genericLinux.enable = true;
home.username = "gabe"; home.username = "gabe";
@ -35,7 +36,7 @@ inputs.home-manager.lib.homeManagerConfiguration {
imports = [ imports = [
../modules/home-manager/terminal ../modules/home-manager/terminal
../modules/home-manager/nvim ../modules/home-manager/nvim
../modules/home-manager ../modules/home-manager/common.nix
../modules/home-manager/syncthing.nix ../modules/home-manager/syncthing.nix
../modules/home-manager/beets.nix ../modules/home-manager/beets.nix
../modules/home-manager/mpd/mpd.nix ../modules/home-manager/mpd/mpd.nix

View file

@ -39,7 +39,7 @@ inputs.home-manager.lib.homeManagerConfiguration {
imports = [ imports = [
../modules/home-manager/terminal ../modules/home-manager/terminal
../modules/home-manager/nvim ../modules/home-manager/nvim
../modules/home-manager ../modules/home-manager/common.nix
../modules/home-manager/syncthing.nix ../modules/home-manager/syncthing.nix
../modules/home-manager/email.nix ../modules/home-manager/email.nix
../modules/home-manager/beets.nix ../modules/home-manager/beets.nix

View file

@ -17,7 +17,7 @@ inputs.nixpkgs.lib.nixosSystem {
../../modules/nixos/common.nix ../../modules/nixos/common.nix
../../modules/nixos/printing.nix ../../modules/nixos/printing.nix
../../modules/both/sound.nix ../../modules/both/sound.nix
../../modules/both/networking.nix ../../modules/nixos/networking.nix
../../modules/both/i3 ../../modules/both/i3
({ ({
config, config,
@ -90,7 +90,7 @@ inputs.nixpkgs.lib.nixosSystem {
imports = [ imports = [
../../modules/home-manager/terminal ../../modules/home-manager/terminal
../../modules/home-manager/nvim ../../modules/home-manager/nvim
../../modules/home-manager ../../modules/home-manager/common.nix
inputs.nixvim.homeManagerModules.nixvim inputs.nixvim.homeManagerModules.nixvim
]; ];
}; };

View file

@ -9,7 +9,6 @@
just just
fd fd
sd sd
scc
tre-command tre-command
diskonaut diskonaut
hyperfine hyperfine
@ -47,6 +46,7 @@
./zellij ./zellij
./tiny-irc.nix ./tiny-irc.nix
./ssh-agent.nix ./ssh-agent.nix
./direnv
]; ];
programs = { programs = {
@ -58,9 +58,5 @@
tealdeer.enable = true; tealdeer.enable = true;
btop.enable = true; btop.enable = true;
man.enable = true; man.enable = true;
direnv = {
enable = true;
nix-direnv.enable = true;
};
}; };
} }

View file

@ -0,0 +1,11 @@
{
config,
pgks,
lib,
...
}: {
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}

View file

@ -1,6 +1,7 @@
{ {
config, config,
pkgs, pkgs,
lib,
... ...
}: { }: {
programs.starship.enableZshIntegration = true; programs.starship.enableZshIntegration = true;
@ -14,7 +15,8 @@
programs.zsh = { programs.zsh = {
enable = true; enable = true;
enableCompletion = true; enableCompletion = true;
initExtra = '' 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
@ -27,8 +29,34 @@
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
''
(lib.mkif (!config.programs.starship.enable) ''
autoload -U promptinit
promptinit
autoload -U colors
colors
''; #stuff to show git things.
autoload -Uz vcs_info
setopt prompt_subst
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.
zstyle ':vcs_info:*' nvcsformats '%~'
zstyle ':vcs_info:*' formats '%r/%S %F{green}[%b]%f'
zstyle ':vcs_info:*' actionformats '%r/%S %F{green}[%b] %F{red}<%a>%f'
#the precmd function, called just before printing the prompt.
function precmd() {
precmd_vcs
}
#Make the right prompt blank, just to be sure.
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...)
PROMPT=$'%F{cyan}[%n@%m]%f%F{red}%f$${vcs_info_msg_0_} %F{white}[%D %T]%f\n»'
'')
];
autocd = true; autocd = true;
history = { history = {
ignoreAllDups = true; ignoreAllDups = true;

View file

@ -26,6 +26,10 @@
description = "machine is a virtual machine"; description = "machine is a virtual machine";
default = false; default = false;
}; };
isSever = lib.mkEnableOption {
description = "machine is primarily a server";
default = false;
};
}; };
}; };
} }