Compare commits
4 commits
3ad9e0f87a
...
b66f1ecc1b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b66f1ecc1b | ||
|
|
a83f726779 | ||
|
|
28633e37bd | ||
|
|
68e96ca739 |
|
|
@ -6,6 +6,14 @@
|
||||||
|
|
||||||
networking.hostName = "hebesu";
|
networking.hostName = "hebesu";
|
||||||
services.tzupdate.enable = true;
|
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 = {
|
services.xserver = {
|
||||||
videoDrivers = ["modesetting"];
|
videoDrivers = ["modesetting"];
|
||||||
deviceSection = ''
|
deviceSection = ''
|
||||||
|
|
@ -18,4 +26,15 @@
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = ["wheel" "podman"];
|
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
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ _load history
|
||||||
_load aliases
|
_load aliases
|
||||||
# set xdg env vars to keep home directory clean
|
# set xdg env vars to keep home directory clean
|
||||||
_load xdg
|
_load xdg
|
||||||
_load show
|
_load func
|
||||||
|
|
||||||
if _exists fzf; then
|
if _exists fzf; then
|
||||||
export FZF_DEFAULT_OPTS="--bind=ctrl-u:page-up,ctrl-d:page-down"
|
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")"
|
printf "\e]0;%s | %s | %s\a" "$(dirs +0)" "$@" "$(date +"%H:%M:%S")"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
_exists starship && eval "$(starship init bash)"
|
|
||||||
# set window title after running command
|
# set window title after running command
|
||||||
trap "$(trap -p DEBUG | awk -F"'" '{print $2 ";"}')_set_win_title \"\${BASH_COMMAND}\"" DEBUG
|
trap "$(trap -p DEBUG | awk -F"'" '{print $2 ";"}')_set_win_title \"\${BASH_COMMAND}\"" DEBUG
|
||||||
|
_exists starship && eval "$(starship init bash)"
|
||||||
else
|
else
|
||||||
# [username pwd] green $ reset
|
# [username pwd] green $ reset
|
||||||
PS1="[\u \W] \[\e[32;1m\]\$\[\e[0m\] "
|
PS1="[\u \W] \[\e[32;1m\]\$\[\e[0m\] "
|
||||||
|
|
|
||||||
|
|
@ -40,3 +40,21 @@ function rl() {
|
||||||
done
|
done
|
||||||
[[ -e "$l" ]] && echo "$l" || echo "~nonexistent~"
|
[[ -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"
|
||||||
|
}
|
||||||
|
|
@ -10,6 +10,7 @@ in {
|
||||||
./kde
|
./kde
|
||||||
./tmux
|
./tmux
|
||||||
./nvim
|
./nvim
|
||||||
|
./starship
|
||||||
];
|
];
|
||||||
|
|
||||||
fonts.fontconfig.enable = false;
|
fonts.fontconfig.enable = false;
|
||||||
|
|
@ -33,6 +34,5 @@ in {
|
||||||
xdg.configFile.python.source = ./python;
|
xdg.configFile.python.source = ./python;
|
||||||
xdg.configFile.qt5ct.source = ./qt5ct;
|
xdg.configFile.qt5ct.source = ./qt5ct;
|
||||||
xdg.configFile.readline.source = ./readline;
|
xdg.configFile.readline.source = ./readline;
|
||||||
xdg.configFile."starship.toml".source = ./starship.toml;
|
|
||||||
xdg.configFile.sx.source = ln "sx";
|
xdg.configFile.sx.source = ln "sx";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
basedpyright
|
basedpyright
|
||||||
clang-tools
|
clang-tools
|
||||||
|
nixd
|
||||||
];
|
];
|
||||||
withRuby = false;
|
withRuby = false;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -14,3 +14,4 @@ lspconfig.clangd.setup({
|
||||||
capabilities=capabilities
|
capabilities=capabilities
|
||||||
})
|
})
|
||||||
lspconfig.basedpyright.setup{}
|
lspconfig.basedpyright.setup{}
|
||||||
|
lspconfig.nixd.setup{}
|
||||||
|
|
|
||||||
|
|
@ -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 = "*"
|
|
||||||
62
user/config/starship/default.nix
Normal file
62
user/config/starship/default.nix
Normal 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)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue