Added hetzner server configs
This commit is contained in:
@@ -67,61 +67,61 @@
|
||||
};
|
||||
"fish/functions/extract.fish" = {
|
||||
text = ''
|
||||
function extract
|
||||
if test -f "$argv[1]"
|
||||
set file "$argv[1]"
|
||||
set filename (basename "$file")
|
||||
set dirname (string replace -r '\.tar\.bz2$|\.tar\.gz$|\.tbz2$|\.tgz$|\.tar$|\.bz2$|\.gz$|\.zip$|\.Z$|\.7z$|\.xz$|\.rar$' "" "$filename")
|
||||
mkdir -p "$dirname"
|
||||
switch $file
|
||||
case "*.tar.bz2"
|
||||
tar xjf "$file" -C "$dirname"
|
||||
case "*.tar.gz"
|
||||
tar xzf "$file" -C "$dirname"
|
||||
case "*.tbz2"
|
||||
tar xjf "$file" -C "$dirname"
|
||||
case "*.tgz"
|
||||
tar xzf "$file" -C "$dirname"
|
||||
case "*.tar"
|
||||
tar xf "$file" -C "$dirname"
|
||||
case "*.bz2"
|
||||
bunzip2 -c "$file" >"$dirname/$dirname"
|
||||
case "*.gz"
|
||||
gunzip -c "$file" >"$dirname/$dirname"
|
||||
case "*.zip"
|
||||
unzip "$file" -d "$dirname"
|
||||
case "*.Z"
|
||||
uncompress -c "$file" >"$dirname/$dirname"
|
||||
case "*.7z"
|
||||
7z x "$file" -o"$dirname"
|
||||
case "*.xz"
|
||||
xz -dc "$file" >"$dirname/$dirname"
|
||||
case "*.rar"
|
||||
unrar x "$file" "$dirname"
|
||||
case "*"
|
||||
echo "'$file' cannot be extracted via extract()"
|
||||
end
|
||||
else
|
||||
echo "'$argv[1]' is not a valid file"
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
function extract
|
||||
if test -f "$argv[1]"
|
||||
set file "$argv[1]"
|
||||
set filename (basename "$file")
|
||||
set dirname (string replace -r '\.tar\.bz2$|\.tar\.gz$|\.tbz2$|\.tgz$|\.tar$|\.bz2$|\.gz$|\.zip$|\.Z$|\.7z$|\.xz$|\.rar$' "" "$filename")
|
||||
mkdir -p "$dirname"
|
||||
switch $file
|
||||
case "*.tar.bz2"
|
||||
tar xjf "$file" -C "$dirname"
|
||||
case "*.tar.gz"
|
||||
tar xzf "$file" -C "$dirname"
|
||||
case "*.tbz2"
|
||||
tar xjf "$file" -C "$dirname"
|
||||
case "*.tgz"
|
||||
tar xzf "$file" -C "$dirname"
|
||||
case "*.tar"
|
||||
tar xf "$file" -C "$dirname"
|
||||
case "*.bz2"
|
||||
bunzip2 -c "$file" >"$dirname/$dirname"
|
||||
case "*.gz"
|
||||
gunzip -c "$file" >"$dirname/$dirname"
|
||||
case "*.zip"
|
||||
unzip "$file" -d "$dirname"
|
||||
case "*.Z"
|
||||
uncompress -c "$file" >"$dirname/$dirname"
|
||||
case "*.7z"
|
||||
7z x "$file" -o"$dirname"
|
||||
case "*.xz"
|
||||
xz -dc "$file" >"$dirname/$dirname"
|
||||
case "*.rar"
|
||||
unrar x "$file" "$dirname"
|
||||
case "*"
|
||||
echo "'$file' cannot be extracted via extract()"
|
||||
end
|
||||
else
|
||||
echo "'$argv[1]' is not a valid file"
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
"fish/functions/weather.fish" = {
|
||||
text = ''
|
||||
function weather
|
||||
if test "$argv[1]" = week
|
||||
wthrr -f w $argv[2]
|
||||
else if test -z "$argv[1]"
|
||||
wthrr -f d
|
||||
wthrr -f t
|
||||
else
|
||||
wthrr -f d $argv[1]
|
||||
wthrr -f t $argv[1]
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
function weather
|
||||
if test "$argv[1]" = week
|
||||
wthrr -f w $argv[2]
|
||||
else if test -z "$argv[1]"
|
||||
wthrr -f d
|
||||
wthrr -f t
|
||||
else
|
||||
wthrr -f d $argv[1]
|
||||
wthrr -f t $argv[1]
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
"fish/functions/fcd.fish" = {
|
||||
text = ''
|
||||
function fcd
|
||||
@@ -168,44 +168,44 @@ end
|
||||
};
|
||||
"fish/conf.d/aliases.fish" = {
|
||||
text = ''
|
||||
alias cleanup="sudo nix-collect-garbage --delete-older-than 1d"
|
||||
alias listgen="sudo nix-env -p /nix/var/nix/profiles/system --list-generations"
|
||||
alias nixremove="nix-store --gc"
|
||||
alias bloat="nix path-info -Sh /run/current-system"
|
||||
alias cleanram="sudo sh -c 'sync; echo 3 > /proc/sys/vm/drop_caches'"
|
||||
alias trimall="sudo fstrim -va"
|
||||
alias c="clear"
|
||||
alias add="git add ."
|
||||
alias commit="git commit"
|
||||
alias push="git push"
|
||||
alias pull="git pull"
|
||||
alias diff="git diff --staged"
|
||||
alias gcld="git clone --depth 1"
|
||||
alias koji="meteor"
|
||||
alias gitui="lazygit"
|
||||
alias ls="eza -lah --grid -s modified --smart-group --group-directories-first --icons"
|
||||
alias l="eza -ah --grid -s modified --smart-group --group-directories-first --icons"
|
||||
alias tree="eza --tree --icons --tree"
|
||||
alias cat="${pkgs.bat}/bin/bat --paging=never --theme gruvbox-dark"
|
||||
alias us="systemctl --user"
|
||||
alias rs="sudo systemctl"
|
||||
alias zed="zeditor"
|
||||
alias nl="nl -ba"
|
||||
alias cp="cp -riv"
|
||||
alias mv="mv -iv"
|
||||
alias mkdir="mkdir -pv"
|
||||
alias less="bat -p --theme gruvbox-dark"
|
||||
alias myip="curl ip.severijnse.eu"
|
||||
alias pscpu="ps -eo pid,ppid,cmd,%mem,%cpu,etime --sort=-%cpu | head -n 21"
|
||||
alias psmem="ps -eo pid,ppid,cmd,%mem,%cpu,etime --sort=-%mem | head -n 21"
|
||||
alias weer="weather"
|
||||
alias v="nvim"
|
||||
alias copy="wl-copy"
|
||||
alias send="croc"
|
||||
alias img="loupe"
|
||||
alias cat-md="glow"
|
||||
alias du="dust"
|
||||
alias df="duf"
|
||||
alias cleanup="sudo nix-collect-garbage --delete-older-than 1d"
|
||||
alias listgen="sudo nix-env -p /nix/var/nix/profiles/system --list-generations"
|
||||
alias nixremove="nix-store --gc"
|
||||
alias bloat="nix path-info -Sh /run/current-system"
|
||||
alias cleanram="sudo sh -c 'sync; echo 3 > /proc/sys/vm/drop_caches'"
|
||||
alias trimall="sudo fstrim -va"
|
||||
alias c="clear"
|
||||
alias add="git add ."
|
||||
alias commit="git commit"
|
||||
alias push="git push"
|
||||
alias pull="git pull"
|
||||
alias diff="git diff --staged"
|
||||
alias gcld="git clone --depth 1"
|
||||
alias koji="meteor"
|
||||
alias gitui="lazygit"
|
||||
alias ls="eza -lah --grid -s modified --smart-group --group-directories-first --icons"
|
||||
alias l="eza -ah --grid -s modified --smart-group --group-directories-first --icons"
|
||||
alias tree="eza --tree --icons --tree"
|
||||
alias cat="${pkgs.bat}/bin/bat --paging=never --theme gruvbox-dark"
|
||||
alias us="systemctl --user"
|
||||
alias rs="sudo systemctl"
|
||||
alias zed="zeditor"
|
||||
alias nl="nl -ba"
|
||||
alias cp="cp -riv"
|
||||
alias mv="mv -iv"
|
||||
alias mkdir="mkdir -pv"
|
||||
alias less="bat -p --theme gruvbox-dark"
|
||||
alias myip="curl ip.severijnse.eu"
|
||||
alias pscpu="ps -eo pid,ppid,cmd,%mem,%cpu,etime --sort=-%cpu | head -n 21"
|
||||
alias psmem="ps -eo pid,ppid,cmd,%mem,%cpu,etime --sort=-%mem | head -n 21"
|
||||
alias weer="weather"
|
||||
alias v="nvim"
|
||||
alias copy="wl-copy"
|
||||
alias send="croc"
|
||||
alias img="loupe"
|
||||
alias cat-md="glow"
|
||||
alias du="dust"
|
||||
alias df="duf"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
configFile = "starship/starship.toml";
|
||||
toTOML = (pkgs.formats.toml {}).generate;
|
||||
in
|
||||
{
|
||||
in {
|
||||
environment.sessionVariables = {
|
||||
STARSHIP_CONFIG = "${config.xdg.configHome}/${configFile}";
|
||||
STARSHIP_LOG = "error";
|
||||
};
|
||||
|
||||
users.users.someone.packages = [ pkgs.starship ];
|
||||
users.users.someone.packages = [pkgs.starship];
|
||||
|
||||
xdg.configFile = {
|
||||
"${configFile}".source = toTOML "starship.toml" {
|
||||
|
||||
"$schema" = "https://starship.rs/config-schema.json";
|
||||
|
||||
add_newline = true;
|
||||
@@ -137,7 +137,6 @@ in
|
||||
starship init fish | source
|
||||
'';
|
||||
|
||||
"fish/completions/starship.fish".source =
|
||||
"${pkgs.starship}/share/fish/vendor_completions.d/starship.fish";
|
||||
"fish/completions/starship.fish".source = "${pkgs.starship}/share/fish/vendor_completions.d/starship.fish";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user