Compare commits
8 commits
16064a898f
...
b5690aaaee
| Author | SHA1 | Date | |
|---|---|---|---|
| b5690aaaee | |||
| eb5e752b44 | |||
| c625920f2c | |||
| ff74e9ec4a | |||
| d038605de9 | |||
| 7f899de0d3 | |||
| 9f001b8c17 | |||
| 69a806e17b |
10 changed files with 105 additions and 30 deletions
|
|
@ -50,6 +50,14 @@ in
|
||||||
my.gaming.enable = true;
|
my.gaming.enable = true;
|
||||||
my.nix-ld.enable = true;
|
my.nix-ld.enable = true;
|
||||||
|
|
||||||
|
systemd.slices."system" = {
|
||||||
|
enable = true;
|
||||||
|
sliceConfig = {
|
||||||
|
# 50% maximum usage accross 8 cores
|
||||||
|
CPUQuota = "${toString (8 * 50)}%";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
|
boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
|
||||||
|
|
||||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ in
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
services.gitlab-runner = {
|
services.gitlab-runner = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.concurrent = 3;
|
settings.concurrent = 8;
|
||||||
services = {
|
services = {
|
||||||
# runner for building in docker via host's nix-daemon
|
# runner for building in docker via host's nix-daemon
|
||||||
# nix store will be readable in runner, might be insecure
|
# nix store will be readable in runner, might be insecure
|
||||||
|
|
|
||||||
|
|
@ -82,19 +82,6 @@
|
||||||
max-jobs = 1;
|
max-jobs = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
system.autoUpgrade = {
|
|
||||||
enable = true;
|
|
||||||
dates = "04:40";
|
|
||||||
operation = "switch";
|
|
||||||
flags = [
|
|
||||||
"--update-input"
|
|
||||||
"nixpkgs"
|
|
||||||
"--no-write-lock-file"
|
|
||||||
"--print-build-logs"
|
|
||||||
];
|
|
||||||
flake = "git+https://git.lelgenio.com/lelgenio/nixos-config#phantom";
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 8745 ];
|
networking.firewall.allowedTCPPorts = [ 8745 ];
|
||||||
|
|
||||||
system.stateVersion = "23.05"; # Never change this
|
system.stateVersion = "23.05"; # Never change this
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
{ factorio-headless, pkgs }:
|
{ factorio-headless, pkgs }:
|
||||||
|
|
||||||
factorio-headless.overrideAttrs (_: rec {
|
factorio-headless.overrideAttrs (_: rec {
|
||||||
version = "2.0.72";
|
version = "2.0.73";
|
||||||
src = pkgs.fetchurl {
|
src = pkgs.fetchurl {
|
||||||
name = "factorio_headless_x64-${version}.tar.xz";
|
name = "factorio_headless_x64-${version}.tar.xz";
|
||||||
url = "https://www.factorio.com/get-download/${version}/headless/linux64";
|
url = "https://www.factorio.com/get-download/${version}/headless/linux64";
|
||||||
hash = "sha256-zzBXNA28nYK9UWGUmuPnuPrZEux8oHuKMVHgQkpVaM0=";
|
hash = "sha256-dSAl+BtewSKZGe3IafnIdz20u1SKkNNw+Fk4I2yFfZo=";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,11 @@
|
||||||
_diffr
|
_diffr
|
||||||
];
|
];
|
||||||
kak-man-pager = [ kak-pager ];
|
kak-man-pager = [ kak-pager ];
|
||||||
|
kubectl-rsh = [
|
||||||
|
bash
|
||||||
|
kubectl
|
||||||
|
rsync
|
||||||
|
];
|
||||||
helix-pager = [
|
helix-pager = [
|
||||||
fish
|
fish
|
||||||
_diffr
|
_diffr
|
||||||
|
|
|
||||||
30
scripts/kubectl-rsh
Executable file
30
scripts/kubectl-rsh
Executable file
|
|
@ -0,0 +1,30 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -exu
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
namespace=''
|
||||||
|
container=''
|
||||||
|
pod=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
# rsync calls us with "-l pod namespace" if we use pod@namespace
|
||||||
|
if [ "X$pod" = "X-l" ]; then
|
||||||
|
pod=$1
|
||||||
|
shift
|
||||||
|
namespace="-n $1"
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
# pod is "pod.container"
|
||||||
|
if [[ "$pod" == *"."* ]]; then
|
||||||
|
container="-c ${pod#*.}"
|
||||||
|
pod="${pod%.*}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# pod is "type#name"
|
||||||
|
if [[ "$pod" == *"#"* ]]; then
|
||||||
|
pod="${pod//#/\/}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec kubectl $namespace exec -i $container $pod -- "$@"
|
||||||
|
|
@ -18,6 +18,13 @@ print_actions_for_entry() {
|
||||||
if test -n "$otp"; then
|
if test -n "$otp"; then
|
||||||
echo "OTP"
|
echo "OTP"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "$entry_content" | \
|
||||||
|
rg '^(\w+): .*$' --replace '$1' | \
|
||||||
|
sed \
|
||||||
|
-e '/login/d' \
|
||||||
|
-e '/user/d' \
|
||||||
|
-e '/email/d'
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
|
@ -29,8 +36,9 @@ main() {
|
||||||
|
|
||||||
test -n "$entry" || exit 0
|
test -n "$entry" || exit 0
|
||||||
|
|
||||||
username=`pass show "$entry" 2>/dev/null | rg -m1 '(login|user|email): (.*)' -r '$2'` || true
|
entry_content="$(pass show "$entry" 2>/dev/null)" || true
|
||||||
password=`pass show "$entry" 2>/dev/null | head -n 1` || true
|
username=`echo "$entry_content" | rg -m1 '(login|user|email): (.*)' -r '$2'` || true
|
||||||
|
password=`echo "$entry_content" | head -n 1` || true
|
||||||
otp=`pass otp "$entry" 2>/dev/null` || true
|
otp=`pass otp "$entry" 2>/dev/null` || true
|
||||||
|
|
||||||
action="$(print_actions_for_entry | wdmenu -p Action)"
|
action="$(print_actions_for_entry | wdmenu -p Action)"
|
||||||
|
|
@ -45,6 +53,10 @@ main() {
|
||||||
printf '%s' "$password" | wl-copy;;
|
printf '%s' "$password" | wl-copy;;
|
||||||
OTP)
|
OTP)
|
||||||
pass otp "$entry" | wl-copy;;
|
pass otp "$entry" | wl-copy;;
|
||||||
|
*)
|
||||||
|
key="$action"
|
||||||
|
printf '%s\n' "$entry_content" | rg -m1 "^$key: (.*)" -r '$1' | wl-copy -n
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,12 @@ in
|
||||||
hash = "sha256-yt6yRiLTuaK4K/QwgkL9gCVGsSa7ndFOHqZvKqIGZ5U=";
|
hash = "sha256-yt6yRiLTuaK4K/QwgkL9gCVGsSa7ndFOHqZvKqIGZ5U=";
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(pkgs.fetchFirefoxAddon {
|
||||||
|
name = "gnome_shell_integration";
|
||||||
|
url = "https://addons.mozilla.org/firefox/downloads/file/4591252/gnome_shell_integration-12.1.xpi";
|
||||||
|
hash = "sha256-gVv8CKKnjKenp9WcVASiBmu6xhcxE8GfHq46a3qDnbU=";
|
||||||
|
})
|
||||||
|
|
||||||
(pkgs.fetchFirefoxAddon {
|
(pkgs.fetchFirefoxAddon {
|
||||||
name = "vimium_ff";
|
name = "vimium_ff";
|
||||||
url = "https://addons.mozilla.org/firefox/downloads/file/4191523/vimium_ff-2.0.6.xpi";
|
url = "https://addons.mozilla.org/firefox/downloads/file/4191523/vimium_ff-2.0.6.xpi";
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,21 @@ function _fish_prompt_git_unpushed_branches
|
||||||
string split ', '
|
string split ', '
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function _fish_prompt_git_remote_deleted -a git_branch
|
||||||
|
set -l git_remote (git config --get "branch.$git_branch.remote" 2> /dev/null)
|
||||||
|
set -l git_merge_ref (git config --get "branch.$git_branch.merge" 2> /dev/null)
|
||||||
|
|
||||||
|
test -n "$git_remote"
|
||||||
|
and test -n "$git_merge_ref"
|
||||||
|
or return 1
|
||||||
|
|
||||||
|
set -l git_remote_ref "refs/remotes/$git_remote/"(string replace -r '^refs/heads/' '' "$git_merge_ref")
|
||||||
|
git show-ref --verify --quiet "$git_remote_ref"
|
||||||
|
and return 1
|
||||||
|
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
function fish_git_prompt
|
function fish_git_prompt
|
||||||
command -qs git
|
command -qs git
|
||||||
or return
|
or return
|
||||||
|
|
@ -81,6 +96,7 @@ function fish_git_prompt
|
||||||
set -l git_branch (git branch --show-current 2> /dev/null);or return
|
set -l git_branch (git branch --show-current 2> /dev/null);or return
|
||||||
set -l git_detach (_fish_prompt_git_detached)
|
set -l git_detach (_fish_prompt_git_detached)
|
||||||
set -l git_remote_branch (git rev-parse --abbrev-ref (git branch --show-current)@{u} 2> /dev/null)
|
set -l git_remote_branch (git rev-parse --abbrev-ref (git branch --show-current)@{u} 2> /dev/null)
|
||||||
|
set -l git_remote_deleted (_fish_prompt_git_remote_deleted "$git_branch"; and echo "1")
|
||||||
set -l git_status_s (timeout 5s git status -s | string collect)
|
set -l git_status_s (timeout 5s git status -s | string collect)
|
||||||
set -l git_log_unpushed (_fish_prompt_git_unpushed_branches)
|
set -l git_log_unpushed (_fish_prompt_git_unpushed_branches)
|
||||||
|
|
||||||
|
|
@ -100,26 +116,33 @@ function fish_git_prompt
|
||||||
_fish_prompt_warn "$git_detach"
|
_fish_prompt_warn "$git_detach"
|
||||||
else if test -n "$git_branch"
|
else if test -n "$git_branch"
|
||||||
_fish_prompt_accent "$git_branch"
|
_fish_prompt_accent "$git_branch"
|
||||||
|
if test -n "$git_remote_deleted"
|
||||||
|
_fish_prompt_warn "X"
|
||||||
|
end
|
||||||
else
|
else
|
||||||
_fish_prompt_warn "init"
|
_fish_prompt_warn "init"
|
||||||
end
|
end
|
||||||
|
|
||||||
# if we have at least one commit
|
# if we have at least one commit
|
||||||
if git rev-parse HEAD -- &>/dev/null
|
if git rev-parse HEAD -- &>/dev/null
|
||||||
# print a "↑" if ahead of origin
|
# Only compare ahead/behind when upstream exists and resolves correctly.
|
||||||
test 0 -ne (git log --oneline "$git_remote_branch"..HEAD -- | wc -l)
|
if test -n "$git_remote_branch"
|
||||||
and set -f _git_sync_ahead '↑'
|
and git rev-parse --verify "$git_remote_branch" &>/dev/null
|
||||||
|
# print a "↑" if ahead of origin
|
||||||
|
test 0 -ne (git log --oneline "$git_remote_branch"..HEAD -- | wc -l)
|
||||||
|
and set -f _git_sync_ahead '↑'
|
||||||
|
|
||||||
# print a "↓" if behind of origin
|
# print a "↓" if behind of origin
|
||||||
test 0 -lt (git log --oneline HEAD.."$git_remote_branch" -- | wc -l)
|
test 0 -lt (git log --oneline HEAD.."$git_remote_branch" -- | wc -l)
|
||||||
and set -l _git_sync_behind '↓'
|
and set -l _git_sync_behind '↓'
|
||||||
|
|
||||||
if set -q _git_sync_ahead _git_sync_behind
|
if set -q _git_sync_ahead _git_sync_behind
|
||||||
_fish_prompt_normal '⇅'
|
_fish_prompt_normal '⇅'
|
||||||
else if set -q _git_sync_ahead
|
else if set -q _git_sync_ahead
|
||||||
_fish_prompt_normal '↑'
|
_fish_prompt_normal '↑'
|
||||||
else if set -q _git_sync_behind
|
else if set -q _git_sync_behind
|
||||||
_fish_prompt_normal '↓'
|
_fish_prompt_normal '↓'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if test -n "$git_log_unpushed"
|
if test -n "$git_log_unpushed"
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,10 @@
|
||||||
docker-compose
|
docker-compose
|
||||||
mariadb
|
mariadb
|
||||||
|
|
||||||
|
kubectl
|
||||||
|
kustomize
|
||||||
|
kubectl-rsh
|
||||||
|
|
||||||
nodePackages.intelephense
|
nodePackages.intelephense
|
||||||
nodePackages.typescript-language-server
|
nodePackages.typescript-language-server
|
||||||
flow # js lsp server
|
flow # js lsp server
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue