212 lines
4.8 KiB
Nix
212 lines
4.8 KiB
Nix
{ lib, config, pkgs, ... }:
|
|
|
|
with lib;
|
|
{
|
|
imports = [
|
|
../development/helix.nix
|
|
];
|
|
|
|
options.terminal = {
|
|
nixUpdateLocation = mkOption {
|
|
type = lib.types.nullOr lib.types.str;
|
|
default = null;
|
|
};
|
|
flakeUpdateLocation = mkOption {
|
|
type = lib.types.nullOr lib.types.str;
|
|
default = null;
|
|
};
|
|
homeUpdateLocation = mkOption {
|
|
type = lib.types.nullOr lib.types.str;
|
|
default = null;
|
|
};
|
|
};
|
|
|
|
config = {
|
|
home.packages = with pkgs;[
|
|
blesh
|
|
(nerdfonts.override { fonts = [ "SpaceMono" ]; })
|
|
];
|
|
|
|
programs = {
|
|
bash = {
|
|
enable = true;
|
|
bashrcExtra = ''
|
|
source $(blesh-share)/ble.sh
|
|
bleopt canvas_winch_action=redraw-prev
|
|
'';
|
|
};
|
|
|
|
git = {
|
|
enable = true;
|
|
delta.enable = true;
|
|
extraConfig = {
|
|
credential = {
|
|
helper = [ "cache --timeout 21600" "${pkgs.git-credential-manager}/bin/git-credential-manager" "${pkgs.git-credential-oauth}/bin/git-credential-oauth" ];
|
|
credentialStore = "secretservice";
|
|
};
|
|
"credential \"https://dev.azure.com\"" = {
|
|
useHttpPath = true;
|
|
};
|
|
"credential \"https://git.worble.xyz\"" = {
|
|
provider = "generic";
|
|
};
|
|
# stealing from https://blog.gitbutler.com/how-git-core-devs-configure-git/
|
|
column = {
|
|
ui = "auto";
|
|
};
|
|
branch = {
|
|
sort = "-committerdate";
|
|
};
|
|
tag = {
|
|
sort = "version:refname";
|
|
};
|
|
diff = {
|
|
algorithm = "histogram";
|
|
colorMoved = "plain";
|
|
mnemonicPrefix = true;
|
|
renames = true;
|
|
};
|
|
push = {
|
|
followTags = true;
|
|
};
|
|
fetch = {
|
|
prune = true;
|
|
pruneTags = true;
|
|
all = true;
|
|
};
|
|
rebase = {
|
|
autoSquash = true;
|
|
autoStash = true;
|
|
updateRefs = true;
|
|
};
|
|
};
|
|
};
|
|
|
|
gitui = {
|
|
enable = true;
|
|
};
|
|
|
|
starship.enable = true;
|
|
|
|
atuin.enable = true;
|
|
|
|
zellij = {
|
|
enable = true;
|
|
enableBashIntegration = true;
|
|
settings = {
|
|
theme = "dracula";
|
|
};
|
|
};
|
|
|
|
direnv = {
|
|
enable = true;
|
|
enableBashIntegration = true;
|
|
nix-direnv.enable = true;
|
|
};
|
|
|
|
helix = {
|
|
enable = true;
|
|
defaultEditor = true;
|
|
settings = {
|
|
theme = "dracula";
|
|
};
|
|
};
|
|
|
|
bat = {
|
|
enable = true;
|
|
};
|
|
|
|
eza = {
|
|
enable = true;
|
|
enableBashIntegration = true;
|
|
git = true;
|
|
extraOptions = [
|
|
"--color=auto"
|
|
"--icons=always"
|
|
"--group-directories-first"
|
|
"--header"
|
|
];
|
|
};
|
|
|
|
yazi = {
|
|
enable = true;
|
|
settings = {
|
|
manager = {
|
|
sort_by = "natural";
|
|
show_hidden = true;
|
|
};
|
|
};
|
|
};
|
|
|
|
bottom = {
|
|
enable = true;
|
|
};
|
|
|
|
fd = {
|
|
enable = true;
|
|
};
|
|
|
|
ripgrep = {
|
|
enable = true;
|
|
};
|
|
|
|
topgrade = with config.terminal;{
|
|
enable = true;
|
|
settings = mkMerge [{
|
|
misc = {
|
|
assume_yes = true;
|
|
};
|
|
}
|
|
(mkIf (nixUpdateLocation != null) {
|
|
linux = {
|
|
nix_arguments = "--flake ${nixUpdateLocation}";
|
|
};
|
|
})
|
|
(mkIf (homeUpdateLocation != null) {
|
|
linux = {
|
|
home_manager_arguments = [ "--flake" homeUpdateLocation ];
|
|
};
|
|
})
|
|
(mkIf (flakeUpdateLocation != null) {
|
|
pre_commands = {
|
|
nix-flake-update = "${(pkgs.writeShellScriptBin "nix-flake-update" ''
|
|
git -C ${flakeUpdateLocation} pull --quiet
|
|
sudo nix flake update --flake ${flakeUpdateLocation}
|
|
git -C ${flakeUpdateLocation} diff-index --quiet HEAD flake.lock || git -C ${flakeUpdateLocation} commit --quiet flake.lock -m "update flake.lock"
|
|
'')}/bin/nix-flake-update";
|
|
};
|
|
})];
|
|
};
|
|
|
|
alacritty = {
|
|
enable = true;
|
|
package = pkgs.alacritty;
|
|
settings = {
|
|
font = {
|
|
normal = {
|
|
family = "SpaceMono Nerd Font";
|
|
style = "Regular";
|
|
};
|
|
size = 14;
|
|
};
|
|
};
|
|
};
|
|
|
|
# eh not feeling it
|
|
# ghostty = {
|
|
# enable = true;
|
|
# enableBashIntegration = true;
|
|
# settings = {
|
|
# "font-family" = "SpaceMono Nerd Font";
|
|
# "font-size" = 14;
|
|
# theme = "Dracula";
|
|
# };
|
|
# };
|
|
|
|
yt-dlp = {
|
|
enable = true;
|
|
};
|
|
};
|
|
};
|
|
}
|