Files
nixos/home-manager/terminal.nix
2025-02-08 13:47:38 +00:00

209 lines
5.0 KiB
Nix

{ lib, config, pkgs, ... }:
with lib;
{
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" ]; })
];
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
#".gitconfig".source = ./dotfiles/gitconfig;
};
programs = {
bash = {
enable = true;
bashrcExtra = ''
function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
yazi "$@" --cwd-file="$tmp"
if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
builtin cd -- "$cwd"
fi
rm -f -- "$tmp"
}
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-oauth}/bin/git-credential-oauth" "${pkgs.git-credential-manager}/bin/git-credential-manager" ];
credentialStore = "secretservice";
};
"credential \"https://dev.azure.com\"" = {
useHttpPath = true;
};
"credential \"https://git.worble.xyz\"" = {
provider = "generic";
};
};
};
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 = {
# misc = {
# assume_yes = true;
# };
# linux = {
# nix_arguments = if nixUpdateLocation != null then "--flake ${nixUpdateLocation}" else default;
# home_manager_arguments = if homeUpdateLocation != null then "--flake ${homeUpdateLocation}" else "";
# };
# pre_commands = {
# nix-flake-update = if flakeUpdateLocation != null then "sudo nix flake update --flake ${flakeUpdateLocation}" else "";
# };
# };
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 = "sudo nix flake update --flake ${flakeUpdateLocation}";
};
})];
};
alacritty = {
enable = true;
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;
};
};
};
}