Compare commits

...

4 commits

Author SHA1 Message Date
caandt b66f1ecc1b nixd 2024-12-25 14:34:00 -05:00
caandt a83f726779 tmpedit 2024-12-25 14:32:44 -05:00
caandt 28633e37bd hebesu 2024-12-25 14:32:44 -05:00
caandt 68e96ca739 starship config 2024-12-25 14:32:41 -05:00
8 changed files with 104 additions and 49 deletions

View file

@ -6,6 +6,14 @@
networking.hostName = "hebesu";
services.tzupdate.enable = true;
services.power-profiles-daemon.enable = false;
services.auto-cpufreq.enable = true;
services.auto-cpufreq.settings = {
charger = {
governor = "powersave";
turbo = "auto";
};
};
services.xserver = {
videoDrivers = ["modesetting"];
deviceSection = ''
@ -18,4 +26,15 @@
isNormalUser = true;
extraGroups = ["wheel" "podman"];
};
networking.firewall = {
logReversePathDrops = true;
extraCommands = ''
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN
'';
extraStopCommands = ''
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true
'';
};
}

View file

@ -24,7 +24,7 @@ _load history
_load aliases
# set xdg env vars to keep home directory clean
_load xdg
_load show
_load func
if _exists fzf; then
export FZF_DEFAULT_OPTS="--bind=ctrl-u:page-up,ctrl-d:page-down"
@ -51,9 +51,9 @@ if [[ "$TERM" != "linux" ]]; then
printf "\e]0;%s | %s | %s\a" "$(dirs +0)" "$@" "$(date +"%H:%M:%S")"
fi
}
_exists starship && eval "$(starship init bash)"
# set window title after running command
trap "$(trap -p DEBUG | awk -F"'" '{print $2 ";"}')_set_win_title \"\${BASH_COMMAND}\"" DEBUG
_exists starship && eval "$(starship init bash)"
else
# [username pwd] green $ reset
PS1="[\u \W] \[\e[32;1m\]\$\[\e[0m\] "

View file

@ -40,3 +40,21 @@ function rl() {
done
[[ -e "$l" ]] && echo "$l" || echo "~nonexistent~"
}
function tmpedit() {
if [[ "$#" -ne 1 ]]; then
echo "usage: tmpedit <file>" >&2
return 1
fi
local real="$(realpath "$1")"
if [[ ! -f "$real" ]]; then
echo "not found"
return 2
fi
if [[ ! "$real" =~ /nix/store/* ]]; then
echo "not nix"
return 3
fi
cp --remove-destination "$real" "$1"
chmod +w "$1"
$EDITOR "$1"
}

View file

@ -10,6 +10,7 @@ in {
./kde
./tmux
./nvim
./starship
];
fonts.fontconfig.enable = false;
@ -33,6 +34,5 @@ in {
xdg.configFile.python.source = ./python;
xdg.configFile.qt5ct.source = ./qt5ct;
xdg.configFile.readline.source = ./readline;
xdg.configFile."starship.toml".source = ./starship.toml;
xdg.configFile.sx.source = ln "sx";
}

View file

@ -24,6 +24,7 @@
extraPackages = with pkgs; [
basedpyright
clang-tools
nixd
];
withRuby = false;
};

View file

@ -14,3 +14,4 @@ lspconfig.clangd.setup({
capabilities=capabilities
})
lspconfig.basedpyright.setup{}
lspconfig.nixd.setup{}

View file

@ -1,46 +0,0 @@
format = """
[ ](bg:#E34F7C)\
$username\
$directory\
$git_branch\
$git_commit\
$git_state\
$git_metrics\
$git_status\
$cmd_duration\
$line_break\
$jobs\
$shlvl\
$status\
$nix_shell\
$character"""
[status]
disabled = false
symbol = "x"
[character]
success_symbol = '[\$](bold green)'
error_symbol = '[\$](bold red)'
[fill]
symbol = " "
[username]
show_always = true
format = "[$user ]($style inverted)[ ]($style bg:#443f59)"
style_user = "#E34F7C"
style_root = "#4571a2 bg:red"
[directory]
format = "[$path [$read_only]($style bg:red inverted)]($style bg:white inverted)[ ]($style)"
style = "#443f59"
read_only =" "
[shlvl]
disabled = false
symbol = "#"
[nix_shell]
format = "[$symbol]($style) "
symbol = "*"

View file

@ -0,0 +1,62 @@
{config, lib, ...}: {
programs.starship = {
enable = true;
settings = lib.mkDefault {
format = lib.concatStrings [
"$username"
"$hostname"
"$directory"
"([\\[ $git_branch"
"$git_commit"
"$git_state"
"$git_metrics"
"$git_status \\]](bold) )"
"$cmd_duration"
"$line_break"
"$jobs"
"$shlvl"
"$status"
"$nix_shell"
"$character"
];
palettes = {
default = {
c1 = "#e34f7c"; # red
c2 = "#4571a2"; # blue
c3 = "#443f59"; # purple
};
};
palette = "default";
status = {
disabled = false;
symbol = "x";
};
character = {
success_symbol = "[\\$](bold green)";
error_symbol = "[\\$](bold red)";
};
username = {
show_always = true;
format = "[ $user ](c1 inverted)";
};
directory = {
format = "[ $path[$read_only](red bg:c3) ](white bg:c3) ";
read_only = " [ro]";
};
shlvl = {
disabled = false;
symbol = "#";
};
nix_shell = {
format = "[$symbol]($style) ";
symbol = "*";
};
git_branch.format = "[$branch(:$remote_branch)]($style) ";
git_status.format = "(| [$all_status$ahead_behind]($style))";
git_metrics.format = "(| [$added]($added_style)([ $deleted]($deleted_style)) )";
git_metrics.disabled = false;
cmd_duration.format = "[\\[$duration\\]]($style) ";
hostname.format = "[ @$hostname ](bg:c2)";
};
};
}