diff --git a/dots/.bash_aliases/all b/dots/.bash_aliases/all index dc796d1..0624611 100644 --- a/dots/.bash_aliases/all +++ b/dots/.bash_aliases/all @@ -37,8 +37,10 @@ alias path='echo -e ${PATH//:/\\n}' # Pretty print path variables alias h="history" alias o="xdg-open" alias v="nvim" +alias vf="fzf --bind 'enter:become(nvim {})'" alias g='git' -alias t=' task' +alias k="kubectl" +alias t='task' alias tsh='tasksh' alias z='zathura --fork' alias f='fzf' diff --git a/dots/.bin/git-cb b/dots/.bin/git-cb index 2cac05d..ae03b57 100755 --- a/dots/.bin/git-cb +++ b/dots/.bin/git-cb @@ -1,25 +1,110 @@ #!/usr/bin/env bash +set -euo pipefail -types=( - "feature For new features" - "bugfix For bug fixes" +readonly ALLOWED_MAIN_BRANCHES=("main" "master" "develop") +readonly BRANCH_TYPES=( + "feat For new features" "hotfix For urgent fixes" + "fix For fixes" "release For preparing releases" "chore For non-code tasks" ) -selected=$(printf '%s\n' "${types[@]}" | fzf --prompt="Select branch type: ") || exit 1 -type=${selected%% *} +error() { + echo "Error: $1" >&2 + exit 1 +} -echo "Fetching Jira tickets..." -jira_data=$(jira issue list --assignee=hektor.misplon@rightcrowd.com --order-by=priority --plain --no-headers 2>/dev/null) +warn() { + echo "Warning: $1" >&2 +} -if [[ $? -ne 0 || -z "$jira_data" ]]; then - echo "Warning: Could not fetch Jira tickets or no tickets found." - echo "Proceeding without ticket ID..." - ticket_id="" -else - # Create formatted list for fzf: "TICKET-123 - Issue description" +check_dependencies() { + local missing=() + for cmd in git fzf; do + if ! command -v "$cmd" &> /dev/null; then + missing+=("$cmd") + fi + done + + if [[ ${#missing[@]} -gt 0 ]]; then + error "Missing required commands: ${missing[*]}" + fi +} + +check_git_repo() { + if ! git rev-parse --git-dir &> /dev/null; then + error "Not in a git repository" + fi +} + +check_current_branch() { + local current_branch + current_branch=$(git branch --show-current) + + local is_main_branch=false + for branch in "${ALLOWED_MAIN_BRANCHES[@]}"; do + if [[ "$current_branch" == "$branch" ]]; then + is_main_branch=true + break + fi + done + + if [[ "$is_main_branch" == false ]]; then + warn "Not branching from a main branch (current: $current_branch)" + read -rp "Continue anyway? [y/N] " response + if [[ ! "$response" =~ ^[Yy]$ ]]; then + exit 0 + fi + fi +} + +get_user_email() { + local email + email=$(git config --get user.email 2>/dev/null) + + if [[ -z "$email" ]]; then + error "Git user email not configured. Run: git config user.email 'your@email.com'" + fi + + echo "$email" +} + +select_branch_type() { + local selected + selected=$(printf '%s\n' "${BRANCH_TYPES[@]}" | \ + fzf --prompt="Select branch type: " \ + --height=40% \ + --border \ + --info=inline) || error "Branch type selection cancelled" + + echo "${selected%% *}" +} + +select_jira_ticket() { + local email=$1 + + if ! command -v jira &> /dev/null; then + warn "Jira CLI not found. Proceeding without ticket ID." + return 0 + fi + + echo "Fetching Jira tickets for $email..." >&2 + local jira_data + jira_data=$(jira issue list --assignee="$email" --order-by=priority --plain --no-headers 2>/dev/null) || { + warn "Could not fetch Jira tickets. Proceeding without ticket ID." + return 0 + } + + if [[ -z "$jira_data" ]]; then + warn "No Jira tickets found. Proceeding without ticket ID." + return 0 + fi + + echo "$jira_data" >&2 + echo "" >&2 + + local formatted_tickets formatted_tickets=$(echo "$jira_data" | awk '{ ticket_id = $2 $1 = $2 = "" @@ -32,59 +117,105 @@ else }') if [[ -z "$formatted_tickets" ]]; then - echo "No tickets found. Proceeding without ticket ID..." - ticket_id="" - else - # Let user select a ticket or skip - echo "" - selected_ticket=$(echo -e "SKIP - Create branch without ticket ID\n$formatted_tickets" | \ - fzf --prompt="Select Jira ticket (or skip): " --height=40%) || exit 1 - - if [[ "$selected_ticket" == "SKIP"* ]]; then - ticket_id="" - else - ticket_id=${selected_ticket%% -*} - fi + warn "No tickets to display. Proceeding without ticket ID." + return 0 fi -fi -editor="${EDITOR:-vi}" -tmpfile=$(mktemp) + local selected_ticket + selected_ticket=$(echo -e "SKIP - Create branch without ticket ID\n$formatted_tickets" | \ + fzf --prompt="Select Jira ticket (or skip): " \ + --height=40% \ + --border \ + --info=inline) || error "Ticket selection cancelled" -if [[ -n "$ticket_id" ]]; then - cat > "$tmpfile" << EOF + if [[ "$selected_ticket" != "SKIP"* ]]; then + echo "${selected_ticket%% -*}" + fi +} + +get_branch_description() { + local ticket_id=$1 + local editor="${EDITOR:-vi}" + local tmpfile + tmpfile=$(mktemp) + + trap "rm -f '$tmpfile'" EXIT + + if [[ -n "$ticket_id" ]]; then + cat > "$tmpfile" << EOF # Selected ticket: $ticket_id -# Enter your branch description below in kebab case (e.g. \`my-description\`): +# Enter your branch description below in kebab-case (e.g., my-description): # The ticket ID will be automatically included in the branch name. +# Lines starting with # will be ignored. + EOF -else - cat > "$tmpfile" << 'EOF' -# Enter your branch description below in kebab case (e.g. `my-description`): + else + cat > "$tmpfile" << 'EOF' +# Enter your branch description below in kebab-case (e.g., my-description): +# Lines starting with # will be ignored. + EOF -fi + fi + + "$editor" "$tmpfile" < /dev/tty > /dev/tty -"$editor" "$tmpfile" + local desc + desc=$(grep -v '^#' "$tmpfile" | tr -d '\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') -desc=$(grep -v '^#' "$tmpfile" | tr -d '\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') -rm "$tmpfile" + echo "$desc" +} -if [[ -z "$desc" ]]; then - echo "No description provided." - exit 1 -fi +validate_description() { + local desc=$1 -if [[ ! "$desc" =~ ^[a-z0-9]+(-[a-z0-9]+)*$ ]]; then - echo "Invalid branch description format." - echo "Use lowercase letters, numbers, and hyphens only." - echo "No trailing or consecutive hyphens allowed." - exit 1 -fi + if [[ -z "$desc" ]]; then + error "No description provided" + fi -if [[ -n "$ticket_id" ]]; then - branch="$type/$ticket_id-$desc" -else - branch="$type/$desc" -fi + if [[ ! "$desc" =~ ^[a-z0-9]+(-[a-z0-9]+)*$ ]]; then + error "Invalid branch description format.\nUse lowercase letters, numbers, and hyphens only.\nNo trailing or consecutive hyphens allowed.\nExample: my-feature-description" + fi +} -echo "Creating branch: $branch" -git checkout -b "$branch" +create_branch() { + local type=$1 + local ticket_id=$2 + local desc=$3 + + local branch + if [[ -n "$ticket_id" ]]; then + branch="$type/$ticket_id-$desc" + else + branch="$type/$desc" + fi + + if git show-ref --verify --quiet "refs/heads/$branch"; then + error "Branch '$branch' already exists" + fi + + echo "" + echo "Creating branch: $branch" + git checkout -b "$branch" +} + +main() { + check_dependencies + check_git_repo + check_current_branch + + local email + email=$(get_user_email) + + local type + type=$(select_branch_type) + + echo "About to call select_jira_ticket" >&2 + local ticket_id="" + ticket_id=$(select_jira_ticket "$email") + local desc + desc=$(get_branch_description "$ticket_id") + validate_description "$desc" + create_branch "$type" "$ticket_id" "$desc" +} + +main "$@" diff --git a/dots/.bin/pomo b/dots/.bin/pomo index eb87aa3..393a2e6 100755 --- a/dots/.bin/pomo +++ b/dots/.bin/pomo @@ -14,11 +14,12 @@ from argparse import ArgumentParser from time import sleep from plyer import notification +POMO_PATH = os.path.join(os.getenv("XDG_DATA_HOME", os.path.expanduser("~/.local/share")), "pomo") @atexit.register def clear(): - if os.path.exists('/home/h/.local/share/pomo'): - os.remove('/home/h/.local/share/pomo') + if os.path.exists(POMO_PATH): + os.remove(POMO_PATH) def format_mins_secs(mins, secs): return f"{mins:02d}:{secs:02d}" @@ -30,24 +31,20 @@ def make_countdown(): mins = duration // 60 secs = duration % 60 time_str = format_mins_secs(mins, secs) - os.system(f'echo -n "{time_str}" > /home/h/.local/share/pomo') + os.system(f'echo -n "{time_str}" > {POMO_PATH}') sleep(1) duration -= 1 return countdown def main(args): - prep_duration = args.prep_duration * 60 work_duration = args.work_duration * 60 break_duration = args.break_duration * 60 repeats = args.repeats - prep_countdown = make_countdown() work_countdown = make_countdown() break_countdown = make_countdown() - prep_countdown(prep_duration) - while repeats != 0: notification.notify(title="Get started") work_countdown(work_duration) diff --git a/dots/.config/firefox/setup b/dots/.config/firefox/setup deleted file mode 100755 index 9495b09..0000000 --- a/dots/.config/firefox/setup +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -for i in ~/.mozilla/firefox/*.*default* - do ln -s "$XDG_CONFIG_HOME"/firefox/user.js "$i/user.js" -done diff --git a/dots/.config/firefox/user.js b/dots/.config/firefox/user.js deleted file mode 100644 index 52b8b5f..0000000 --- a/dots/.config/firefox/user.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Note: has to be symlinked to profile directories for your - * firefox release - * - * E.g. - * - * ```sh - * ln -s user.js ~/.mozilla/firefox/*.default-release/user.js - * ``` - * Or check out the `setup` script - * - */ - -// Set default download directory -user_pref("browser.download.dir", "/home/h/dl"); diff --git a/dots/.config/home-manager/flake.lock b/dots/.config/home-manager/flake.lock index 0772058..2c25682 100644 --- a/dots/.config/home-manager/flake.lock +++ b/dots/.config/home-manager/flake.lock @@ -1,5 +1,45 @@ { "nodes": { + "firefox-addons": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "dir": "pkgs/firefox-addons", + "lastModified": 1762315418, + "narHash": "sha256-mLJeHkYvojbq/1vot6IXq85l0sN9KlAPbRzYo4Mnc4g=", + "owner": "rycee", + "repo": "nur-expressions", + "rev": "ccdfe1d5d7da86941ac363b5bf2b5bc88b15def2", + "type": "gitlab" + }, + "original": { + "dir": "pkgs/firefox-addons", + "owner": "rycee", + "repo": "nur-expressions", + "type": "gitlab" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -7,11 +47,11 @@ ] }, "locked": { - "lastModified": 1756991914, - "narHash": "sha256-4ve/3ah5H/SpL2m3qmZ9GU+VinQYp2MN1G7GamimTds=", + "lastModified": 1762351818, + "narHash": "sha256-0ptUDbYwxv1kk/uzEX4+NJjY2e16MaAhtzAOJ6K0TG0=", "owner": "nix-community", "repo": "home-manager", - "rev": "b08f8737776f10920c330657bee8b95834b7a70f", + "rev": "b959c67241cae17fc9e4ee7eaf13dfa8512477ea", "type": "github" }, "original": { @@ -20,13 +60,52 @@ "type": "github" } }, + "nix-secrets": { + "flake": false, + "locked": { + "lastModified": 1762463676, + "narHash": "sha256-PMNLD8PPcei/1SwNph+CVTBw+3SvlN2R/CnTUFJO5O0=", + "ref": "main", + "rev": "183554d159e1d8ea1f1d2d626b6686ebcb37a612", + "shallow": true, + "type": "git", + "url": "ssh://git@github.com/hektor/nix-secrets" + }, + "original": { + "ref": "main", + "shallow": true, + "type": "git", + "url": "ssh://git@github.com/hektor/nix-secrets" + } + }, + "nixgl": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1762090880, + "narHash": "sha256-fbRQzIGPkjZa83MowjbD2ALaJf9y6KMDdJBQMKFeY/8=", + "owner": "nix-community", + "repo": "nixGL", + "rev": "b6105297e6f0cd041670c3e8628394d4ee247ed5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixGL", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1756787288, - "narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=", + "lastModified": 1762111121, + "narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d0fc30899600b9b3466ddb260fd83deb486c32f1", + "rev": "b3d51a0365f6695e7dd5cdf3e180604530ed33b4", "type": "github" }, "original": { @@ -38,8 +117,47 @@ }, "root": { "inputs": { + "firefox-addons": "firefox-addons", "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nix-secrets": "nix-secrets", + "nixgl": "nixgl", + "nixpkgs": "nixpkgs", + "sops-nix": "sops-nix" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1760998189, + "narHash": "sha256-ee2e1/AeGL5X8oy/HXsZQvZnae6XfEVdstGopKucYLY=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "5a7d18b5c55642df5c432aadb757140edfeb70b3", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" } } }, diff --git a/dots/.config/home-manager/flake.nix b/dots/.config/home-manager/flake.nix index 22021d2..e88f66c 100644 --- a/dots/.config/home-manager/flake.nix +++ b/dots/.config/home-manager/flake.nix @@ -1,13 +1,37 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs = { + url = "github:nixos/nixpkgs/nixos-unstable"; + }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - nixgl.url = "github:nix-community/nixGL"; + sops-nix = { + url = "github:Mic92/sops-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-secrets = { + url = "git+ssh://git@github.com/hektor/nix-secrets?shallow=1&ref=main"; + flake = false; + }; + nixgl = { + url = "github:nix-community/nixGL"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + firefox-addons = { + url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { nixpkgs, home-manager, nixgl, ... }: + + outputs = + { + nixpkgs, + home-manager, + nixgl, + ... + }@inputs: let lib = nixpkgs.lib; system = "x86_64-linux"; @@ -16,14 +40,17 @@ overlays = [ nixgl.overlay ]; config.allowUnfree = true; }; - in { + in + { homeConfigurations = { work = home-manager.lib.homeManagerConfiguration { inherit pkgs; extraSpecialArgs = { - inherit nixgl; + inherit inputs; }; - modules = [ ./hosts/work ]; + modules = [ + ./hosts/work + ]; }; }; }; diff --git a/dots/.config/home-manager/hosts/work/default.nix b/dots/.config/home-manager/hosts/work/default.nix index d8678db..1a6f2ec 100644 --- a/dots/.config/home-manager/hosts/work/default.nix +++ b/dots/.config/home-manager/hosts/work/default.nix @@ -1,8 +1,24 @@ -{ pkgs, config, nixgl, ... }: +{ + pkgs, + config, + inputs, + ... +}: { + + imports = [ inputs.sops-nix.homeManagerModules.sops ]; + + sops = { + defaultSopsFile = "${builtins.toString inputs.nix-secrets}/secrets.yaml"; + defaultSopsFormat = "yaml"; + age.keyFile = "/home/hektor/.config/sops/age/keys.txt"; + + secrets."test" = { }; + }; + nixGL = { - packages = nixgl.packages; + packages = inputs.nixgl.packages; defaultWrapper = "mesa"; }; @@ -10,6 +26,15 @@ home.homeDirectory = "/home/hektor"; home.stateVersion = "25.05"; + programs.anki = import ../../modules/anki.nix; + programs.firefox = import ../../modules/firefox.nix { + inherit inputs; + inherit pkgs; + inherit config; + }; + programs.git = import ../../modules/git.nix; + programs.keepassxc = import ../../modules/keepassxc.nix; + programs.neovim = import ../../modules/neovim.nix; home.packages = import ./packages.nix { inherit pkgs; inherit config; diff --git a/dots/.config/home-manager/modules/anki.nix b/dots/.config/home-manager/modules/anki.nix new file mode 100644 index 0000000..7dc2601 --- /dev/null +++ b/dots/.config/home-manager/modules/anki.nix @@ -0,0 +1,3 @@ +{ + enable = true; +} diff --git a/dots/.config/home-manager/modules/bookmarks/jira.nix b/dots/.config/home-manager/modules/bookmarks/jira.nix new file mode 100644 index 0000000..7fa0033 --- /dev/null +++ b/dots/.config/home-manager/modules/bookmarks/jira.nix @@ -0,0 +1,6 @@ +[ + { + name = "kanban - tenant manager"; + url = "https://rightcrowd.atlassian.net/jira/software/c/projects/RPD/boards/1131"; + } +] diff --git a/dots/.config/home-manager/modules/bookmarks/k8s.nix b/dots/.config/home-manager/modules/bookmarks/k8s.nix new file mode 100644 index 0000000..0fdf5ce --- /dev/null +++ b/dots/.config/home-manager/modules/bookmarks/k8s.nix @@ -0,0 +1,181 @@ +[ + { + name = "localdev"; + bookmarks = [ + { + name = "api-test.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "rightcrowd-api"; + url = "https://api-test.h.rightcrowd.cloud"; + } + ]; + } + { + name = "argo-applicationset.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "argocd-applicationset-controller"; + url = "https://argo-applicationset.h.rightcrowd.cloud"; + } + ]; + } + { + name = "argo.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "argocd-server"; + url = "https://argo.h.rightcrowd.cloud"; + } + ]; + } + { + name = "grafana.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "grafana"; + url = "https://grafana.h.rightcrowd.cloud"; + } + ]; + } + { + name = "grpc-wf-test.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "workflow"; + url = "https://grpc-wf-test.h.rightcrowd.cloud"; + } + ]; + } + { + name = "home.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "homepage"; + url = "https://home.h.rightcrowd.cloud"; + } + { + name = "oauth2-proxy-homepage-service"; + url = "https://home.h.rightcrowd.cloud"; + } + ]; + } + { + name = "iam.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "keycloak-service"; + url = "https://iam.h.rightcrowd.cloud"; + } + { + name = "keycloak-service"; + url = "https://iam.h.rightcrowd.cloud"; + } + ]; + } + { + name = "minio.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "console"; + url = "https://minio.h.rightcrowd.cloud"; + } + ]; + } + { + name = "piam-test.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "workflow"; + url = "https://piam-test.h.rightcrowd.cloud"; + } + ]; + } + { + name = "registry.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "registry-docker-registry"; + url = "https://registry.h.rightcrowd.cloud"; + } + ]; + } + { + name = "reporting-test.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "reporting"; + url = "https://reporting-test.h.rightcrowd.cloud"; + } + ]; + } + { + name = "side-login-api.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "side-login-backend-service"; + url = "https://side-login-api.h.rightcrowd.cloud"; + } + ]; + } + { + name = "side-login.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "side-login-frontend-service"; + url = "https://side-login.h.rightcrowd.cloud"; + } + ]; + } + { + name = "tenant-manager.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "tenant-manager-frontend"; + url = "https://tenant-manager.h.rightcrowd.cloud"; + } + { + name = "tenant-manager-backend"; + url = "https://tenant-manager.h.rightcrowd.cloud"; + } + ]; + } + { + name = "vault.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "vault"; + url = "https://vault.h.rightcrowd.cloud"; + } + ]; + } + { + name = "web-tracing.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "alloy"; + url = "https://web-tracing.h.rightcrowd.cloud"; + } + ]; + } + { + name = "wf-test.h.rightcrowd.cloud"; + bookmarks = [ + { + name = "workflow"; + url = "https://wf-test.h.rightcrowd.cloud"; + } + ]; + } + ]; + } + { + name = "dev"; + bookmarks = [ + { + name = "tenman"; + url = ""; + } + ]; + } +] diff --git a/dots/.config/home-manager/modules/bookmarks/repos.nix b/dots/.config/home-manager/modules/bookmarks/repos.nix new file mode 100644 index 0000000..5cd2249 --- /dev/null +++ b/dots/.config/home-manager/modules/bookmarks/repos.nix @@ -0,0 +1,402 @@ +[ + { + name = "agent"; + url = "https://gitlab.com/rightcrowd/agent"; + } + { + name = "ai openapi experiment"; + url = "https://gitlab.com/rightcrowd/ai-openapi-experiment"; + } + { + name = "ai project"; + url = "https://gitlab.com/rightcrowd/ai-project"; + } + { + name = "ai-rule-engine"; + url = "https://gitlab.com/rightcrowd/ai-rule-engine"; + } + { + name = "ai_chatbot_helpdesk"; + url = "https://gitlab.com/rightcrowd/ai_chatbot_helpdesk"; + } + { + name = "airflow"; + url = "https://gitlab.com/rightcrowd/airflow"; + } + { + name = "android-device-library"; + url = "https://gitlab.com/rightcrowd/android-device-library"; + } + { + name = "android-tpm"; + url = "https://gitlab.com/rightcrowd/android-tpm"; + } + { + name = "android-tpm-test"; + url = "https://gitlab.com/rightcrowd/android-tpm-test"; + } + { + name = "architecture design decisions"; + url = "https://gitlab.com/rightcrowd/architecture-design-decisions"; + } + { + name = "backend-core"; + url = "https://gitlab.com/rightcrowd/backend-core"; + } + { + name = "backend-identity-access-management"; + url = "https://gitlab.com/rightcrowd/backend-identity-access-management"; + } + { + name = "backend-pin-management"; + url = "https://gitlab.com/rightcrowd/backend-pin-management"; + } + { + name = "backend-test-container"; + url = "https://gitlab.com/rightcrowd/backend-test-container"; + } + { + name = "bu snaplogic"; + url = "https://gitlab.com/rightcrowd/bu-snaplogic"; + } + { + name = "contractor-portal"; + url = "https://gitlab.com/rightcrowd/contractor-portal"; + } + { + name = "credential service"; + url = "https://gitlab.com/rightcrowd/credential-service"; + } + { + name = "employee app"; + url = "https://gitlab.com/rightcrowd/employee-app"; + } + { + name = "events-service-research"; + url = "https://gitlab.com/rightcrowd/events-service-research"; + } + { + name = "facerecognition"; + url = "https://gitlab.com/rightcrowd/facerecognition"; + } + { + name = "function-keycloak-builtin-objects"; + url = "https://gitlab.com/rightcrowd/function-keycloak-builtin-objects"; + } + { + name = "fw_ble_soc_bl"; + url = "https://gitlab.com/rightcrowd/fw_ble_soc_bl"; + } + { + name = "fw_ble_soc_certification"; + url = "https://gitlab.com/rightcrowd/fw_ble_soc_certification"; + } + { + name = "fw_ble_soc_dw_sniffer"; + url = "https://gitlab.com/rightcrowd/fw_ble_soc_dw_sniffer"; + } + { + name = "fw_ble_soc_dw_tag"; + url = "https://gitlab.com/rightcrowd/fw_ble_soc_dw_tag"; + } + { + name = "fw_ble_soc_dw_ths_master"; + url = "https://gitlab.com/rightcrowd/fw_ble_soc_dw_ths_master"; + } + { + name = "fw_ble_soc_dw_ths_slave"; + url = "https://gitlab.com/rightcrowd/fw_ble_soc_dw_ths_slave"; + } + { + name = "fw_ble_soc_hw_3_0"; + url = "https://gitlab.com/rightcrowd/fw_ble_soc_hw_3_0"; + } + { + name = "fw_ble_soc_prod_test_jig"; + url = "https://gitlab.com/rightcrowd/fw_ble_soc_prod_test_jig"; + } + { + name = "fw_cr"; + url = "https://gitlab.com/rightcrowd/fw_cr"; + } + { + name = "fw_cr_upload"; + url = "https://gitlab.com/rightcrowd/fw_cr_upload"; + } + { + name = "fw_legacy_applet"; + url = "https://gitlab.com/rightcrowd/fw_legacy_applet"; + } + { + name = "fw_nfc_soc"; + url = "https://gitlab.com/rightcrowd/fw_nfc_soc"; + } + { + name = "fw_nrf5_sdk"; + url = "https://gitlab.com/rightcrowd/fw_nrf5_sdk"; + } + { + name = "fw_orion"; + url = "https://gitlab.com/rightcrowd/fw_orion"; + } + { + name = "fw_pr"; + url = "https://gitlab.com/rightcrowd/fw_pr"; + } + { + name = "fw_prod"; + url = "https://gitlab.com/rightcrowd/fw_prod"; + } + { + name = "fw_prod_dekimo"; + url = "https://gitlab.com/rightcrowd/fw_prod_dekimo"; + } + { + name = "fw_prod_test"; + url = "https://gitlab.com/rightcrowd/fw_prod_test"; + } + { + name = "fw_scc"; + url = "https://gitlab.com/rightcrowd/fw_scc"; + } + { + name = "fw_tc"; + url = "https://gitlab.com/rightcrowd/fw_tc"; + } + { + name = "fw_tc_prod_test"; + url = "https://gitlab.com/rightcrowd/fw_tc_prod_test"; + } + { + name = "fw_test_app"; + url = "https://gitlab.com/rightcrowd/fw_test_app"; + } + { + name = "gateway api"; + url = "https://gitlab.com/rightcrowd/gateway-api"; + } + { + name = "gitlab-renovate-runner"; + url = "https://gitlab.com/rightcrowd/gitlab-renovate-runner"; + } + { + name = "hashicorp vault"; + url = "https://gitlab.com/rightcrowd/hashicorp-vault"; + } + { + name = "helm charts"; + url = "https://gitlab.com/rightcrowd/helm-charts"; + } + { + name = "hid mobile credentials poc dump"; + url = "https://gitlab.com/rightcrowd/poc-hid-mobile-credentials-dump"; + } + { + name = "in-cluster-development"; + url = "https://gitlab.com/rightcrowd/in-cluster-development"; + } + { + name = "integrations service"; + url = "https://gitlab.com/rightcrowd/integrations-service"; + } + { + name = "interview-questions"; + url = "https://gitlab.com/rightcrowd/interview-questions"; + } + { + name = "ios-firmware-manager"; + url = "https://gitlab.com/rightcrowd/ios-firmware-manager"; + } + { + name = "ios-gw"; + url = "https://gitlab.com/rightcrowd/ios-gw"; + } + { + name = "ios-kiosk"; + url = "https://gitlab.com/rightcrowd/ios-kiosk"; + } + { + name = "json parser"; + url = "https://gitlab.com/rightcrowd/json-parser"; + } + { + name = "jwt-claims-convention"; + url = "https://gitlab.com/rightcrowd/jwt-claims-convention"; + } + { + name = "k8s secret aggregation operator"; + url = "https://gitlab.com/rightcrowd/k8s-secrets-aggregation-operator"; + } + { + name = "keycloak"; + url = "https://gitlab.com/rightcrowd/keycloak"; + } + { + name = "keycloak-realm-kubernetes-operator"; + url = "https://gitlab.com/rightcrowd/keycloak-realm-kubernetes-operator"; + } + { + name = "keycloak-test-impl"; + url = "https://gitlab.com/rightcrowd/keycloak-test-impl"; + } + { + name = "kube diff"; + url = "https://gitlab.com/rightcrowd/kube-diff"; + } + { + name = "link service"; + url = "https://gitlab.com/rightcrowd/link-service"; + } + { + name = "location service"; + url = "https://gitlab.com/rightcrowd/location-service"; + } + { + name = "mongo-encryption-poc"; + url = "https://gitlab.com/rightcrowd/mongo-encryption-poc"; + } + { + name = "next gen reporting"; + url = "https://gitlab.com/rightcrowd/next-gen-reporting"; + } + { + name = "node.js application template"; + url = "https://gitlab.com/rightcrowd/templates/node.js-application-template"; + } + { + name = "nodejs python microservice poc"; + url = "https://gitlab.com/rightcrowd/nodejs-python-microservice-poc"; + } + { + name = "observability dev kit"; + url = "https://gitlab.com/rightcrowd/observability-dev-kit"; + } + { + name = "open adapter security expert"; + url = "https://gitlab.com/rightcrowd/open-adapter-security-expert"; + } + { + name = "pacs remote adapter andover"; + url = "https://gitlab.com/rightcrowd/pacs-ra-andover"; + } + { + name = "platform apps"; + url = "https://gitlab.com/rightcrowd/platform-apps"; + } + { + name = "platform feature flags"; + url = "https://gitlab.com/rightcrowd/feature-flags"; + } + { + name = "platform infra"; + url = "https://gitlab.com/rightcrowd/platform-infra"; + } + { + name = "platform-dev"; + url = "https://gitlab.com/rightcrowd/platform-dev"; + } + { + name = "platform-onprem"; + url = "https://gitlab.com/rightcrowd/platform-onprem"; + } + { + name = "poc-android-ble-test-app"; + url = "https://gitlab.com/rightcrowd/poc-android-ble-test-app"; + } + { + name = "poc-hw-tools"; + url = "https://gitlab.com/rightcrowd/poc-hw-tools"; + } + { + name = "poc_arduino_sketches"; + url = "https://gitlab.com/rightcrowd/poc_arduino_sketches"; + } + { + name = "poc_gw_rssi_visu"; + url = "https://gitlab.com/rightcrowd/poc_gw_rssi_visu"; + } + { + name = "public api javascript client"; + url = "https://gitlab.com/rightcrowd/public-api-js-client"; + } + { + name = "rightcrowd cloud"; + url = "https://gitlab.com/rightcrowd/RightCrowd-cloud"; + } + { + name = "rightcrowd design system web"; + url = "https://gitlab.com/rightcrowd/rightcrowd-design-system-web"; + } + { + name = "rightcrowd gitlab image builder"; + url = "https://gitlab.com/rightcrowd/rightcrowd-gitlab-image-builder"; + } + { + name = "rightcrowd-lib"; + url = "https://gitlab.com/rightcrowd/lib"; + } + { + name = "rightcrowd-ng-api-design"; + url = "https://gitlab.com/rightcrowd/rightcrowd-ng-api-design"; + } + { + name = "rightface"; + url = "https://gitlab.com/rightcrowd/rightface"; + } + { + name = "side login application"; + url = "https://gitlab.com/rightcrowd/side-login-application"; + } + { + name = "single tenant router"; + url = "https://gitlab.com/rightcrowd/single-tenant-redirector"; + } + { + name = "smartaccess api design"; + url = "https://gitlab.com/rightcrowd/smartaccess-api-design"; + } + { + name = "smartaccess interface"; + url = "https://gitlab.com/rightcrowd/admin-application"; + } + { + name = "smartface"; + url = "https://gitlab.com/rightcrowd/smartface"; + } + { + name = "techshare"; + url = "https://gitlab.com/rightcrowd/techshare"; + } + { + name = "tenant manager"; + url = "https://gitlab.com/rightcrowd/tenant-manager"; + } + { + name = "tenman-k8s-operator-experiment"; + url = "https://gitlab.com/rightcrowd/tenman-k8s-operator-experiment"; + } + { + name = "tenman-k8s-operator-experiment-ts"; + url = "https://gitlab.com/rightcrowd/tenman-k8s-operator-experiment-ts"; + } + { + name = "test-setup"; + url = "https://gitlab.com/rightcrowd/test-setup"; + } + { + name = "trpc-oas-experiment"; + url = "https://gitlab.com/rightcrowd/trpc-oas-experiment"; + } + { + name = "uwb-demo"; + url = "https://gitlab.com/rightcrowd/uwb-demo"; + } + { + name = "web ui components"; + url = "https://gitlab.com/rightcrowd/ui-components"; + } + { + name = "web-pin-management"; + url = "https://gitlab.com/rightcrowd/web-pin-management"; + } +] diff --git a/dots/.config/home-manager/modules/firefox.nix b/dots/.config/home-manager/modules/firefox.nix new file mode 100644 index 0000000..34c0e52 --- /dev/null +++ b/dots/.config/home-manager/modules/firefox.nix @@ -0,0 +1,93 @@ +{ inputs, pkgs, ... }: + +{ + enable = true; + nativeMessagingHosts = with pkgs; [ + tridactyl-native + ]; + policies = { + DefaultDownloadDirectory = "\${home}/dl"; + }; + profiles = { + work = { + settings = { + "signon.rememberSignons" = false; + "findbar.highlightAll" = true; + "extensions.autoDisableScopes" = 0; # Enable extensions by default + }; + extensions = { + packages = with inputs.firefox-addons.packages.${pkgs.system}; [ + duckduckgo-privacy-essentials + istilldontcareaboutcookies + libredirect + keepassxc-browser + react-devtools + sponsorblock + tridactyl + ublock-origin + ]; + }; + bookmarks = { + force = true; + settings = [ + { + toolbar = true; + bookmarks = [ + { + name = "NixOS"; + bookmarks = [ + { + name = "wiki"; + url = "https://wiki.nixos.org/wiki/NixOS_Wiki"; + } + { + name = "packages"; + url = "https://search.nixos.org/packages"; + } + { + name = "options"; + url = "https://search.nixos.org/options"; + } + ]; + } + ]; + } + ]; + }; + }; + }; + policies = { + ExtensionSettings = { + "jid1-ZAdIEUB7XOzOJw@jetpack" = { + default_area = "navbar"; + private_browsing = true; + }; + "idcac-pub@guus.ninja" = { + default_area = "navbar"; + private_browsing = true; + }; + "7esoorv3@alefvanoon.anonaddy.me" = { + default_area = "navbar"; + }; + "keepassxc-browser@keepassxc.org" = { + default_area = "navbar"; + private_browsing = true; + }; + "@react-devtools" = { + default_area = "navbar"; + private_browsing = true; + }; + "sponsorBlocker@ajay.app" = { + default_area = "navbar"; + private_browsing = true; + }; + "tridactyl.vim@cmcaine.co.uk".settings = { + private_browsing = true; + }; + "uBlock0@raymondhill.net".settings = { + default_area = "navbar"; + private_browsing = true; + }; + }; + }; +} diff --git a/dots/.config/home-manager/modules/git.nix b/dots/.config/home-manager/modules/git.nix new file mode 100644 index 0000000..7dc2601 --- /dev/null +++ b/dots/.config/home-manager/modules/git.nix @@ -0,0 +1,3 @@ +{ + enable = true; +} diff --git a/dots/.config/home-manager/modules/keepassxc.nix b/dots/.config/home-manager/modules/keepassxc.nix new file mode 100644 index 0000000..deec1b9 --- /dev/null +++ b/dots/.config/home-manager/modules/keepassxc.nix @@ -0,0 +1,4 @@ +{ + enable = true; + # TODO: https://mynixos.com/home-manager/option/programs.keepassxc.settings +} diff --git a/dots/.config/home-manager/modules/neovim.nix b/dots/.config/home-manager/modules/neovim.nix new file mode 100644 index 0000000..fbd1d69 --- /dev/null +++ b/dots/.config/home-manager/modules/neovim.nix @@ -0,0 +1,7 @@ +{ + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + vimdiffAlias = true; +} diff --git a/dots/.config/kitty/kitty.conf b/dots/.config/kitty/kitty.conf index e2b912f..1e500dc 100644 --- a/dots/.config/kitty/kitty.conf +++ b/dots/.config/kitty/kitty.conf @@ -1,27 +1,167 @@ -# Fonts +#: Fonts {{{ font_family Iosevka Term SS08 -font_size 24.0 +bold_font auto +italic_font auto +bold_italic_font auto +font_size 12.0 +disable_ligatures never + +# }}} + +#: Cursor {{{ -# Cursor cursor_shape block cursor_blink_interval 0 -shell_integration no-cursor -# Performance tuning +#: }}} + +#: Scrollback {{{ + +scrollback_lines 8192 +scrollbar scrolled +scrollback_pager_history_size 1024 + +#: }}} + +#: Mouse {{{ + +mouse_hide_wait 0.0 +paste_actions quote-urls-at-prompt,confirm + +#: }}} + +#: Performance tuning {{{ repaint_delay 8 +input_delay 2 -# Transparency +#: }}} -# dynamic_background_opacity yes -# background_opacity 0.0 +#: Terminal bell {{{ -enable_audio_bell no +enable_audio_bell yes +window_alert_on_bell yes -# Scrollback +#: }}} -scrollback_lines 16384 -scrollback_pager nvimpager +#: Window layout {{{ -include ./themes/zenwritten_light.conf +remember_window_size no +remember_window_position no +enabled_layouts * +hide_window_decorations yes + +#: }}} + +#: Tab bar {{{ + +tab_bar_edge top +tab_bar_style powerline +tab_bar_min_tabs 1 +tab_powerline_style slanted +tab_activity_symbol ! +tab_title_template "{index}{fmt.fg.red}{bell_symbol}{fmt.fg.tab}{activity_symbol}:{tab.last_focused_progress_percent}{title}" + +#: }}} + +#: Advanced {{{ + +notify_on_cmd_finish unfocused + +#: }}} + +#: OS specific tweaks {{{ + +linux_display_server auto +wayland_enable_ime no + +#: }}} + +#: Keyboard shortcuts {{{ + +kitty_mod ctrl+shift +map kitty_mod+c copy_to_clipboard +map kitty_mod+v paste_from_clipboard +map cmd+v +# map kitty_mod+o pass_selection_to_program +# map kitty_mod+o pass_selection_to_program firefox +# map kitty_mod+y new_window less @selection +map kitty_mod+z scroll_to_prompt -1 +map kitty_mod+x scroll_to_prompt 1 +map kitty_mod+h show_scrollback +# map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R +#:: For more details on piping screen and buffer contents to external +#:: programs, see launch . +# map kitty_mod+g show_last_command_output +# map kitty_mod+enter launch --cwd=current +# map cmd+enter +# map ctrl+n launch --location=neighbor +# map ctrl+f launch --location=first +map kitty_mod+n +map cmd+n +map kitty_mod+w +map shift+cmd+d +map kitty_mod+] +map kitty_mod+[ +map kitty_mod+f +map kitty_mod+b +map kitty_mod+` +map kitty_mod+r +map cmd+r +map kitty_mod+1 +map cmd+1 +map kitty_mod+2 +map cmd+2 +map kitty_mod+3 +map cmd+3 +map kitty_mod+4 +map cmd+4 +map kitty_mod+5 +map cmd+5 +map kitty_mod+6 +map cmd+6 +map kitty_mod+7 +map cmd+7 +map kitty_mod+8 +map cmd+8 +map kitty_mod+9 +map cmd+9 +map kitty_mod+0 +map f1 goto_tab 1 +map f2 goto_tab 2 +map f3 goto_tab 3 +map f4 goto_tab 4 +map f5 goto_tab 5 +map f6 goto_tab 6 +map f7 goto_tab 7 +map f8 goto_tab 8 +map kitty_mod+c new_tab +map cmd+t +map kitty_mod+q +map cmd+w +map kitty_mod+. +map kitty_mod+, +map kitty_mod+alt+t +map shift+cmd+i +map kitty_mod+f1 +map kitty_mod+f11 +map ctrl+cmd+f +map kitty_mod+f10 +map opt+cmd+s +map kitty_mod+u kitten unicode_input +map ctrl+cmd+space +map kitty_mod+/ kitty_shell window +map kitty_mod+f5 +map kitty_mod+r load_config_file + +map shift+cmd+/ +map cmd+h +map opt+cmd+ +map cmd+m +map cmd+q + +#: }}} + +include ./themes/zenwritten_dark.conf +include ./nvim.conf diff --git a/dots/.config/kitty/nvim.conf b/dots/.config/kitty/nvim.conf new file mode 100644 index 0000000..03f361c --- /dev/null +++ b/dots/.config/kitty/nvim.conf @@ -0,0 +1,8 @@ +allow_remote_control socket-only +listen_on unix:/tmp/kitty +shell_integration enabled + +action_alias kitty_scrollback_nvim kitten ~/.local/share/nvim/site/pack/paqs/start/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py +map kitty_mod+h kitty_scrollback_nvim +map kitty_mod+g kitty_scrollback_nvim --config ksb_builtin_last_cmd_output +mouse_map ctrl+shift+right press ungrabbed combine : mouse_select_command_output : kitty_scrollback_nvim --config ksb_builtin_last_visited_cmd_output diff --git a/dots/.config/nvim/after/plugin/auto-session.lua b/dots/.config/nvim/after/plugin/auto-session.lua index c55580d..a61eef6 100644 --- a/dots/.config/nvim/after/plugin/auto-session.lua +++ b/dots/.config/nvim/after/plugin/auto-session.lua @@ -1 +1,3 @@ -require("auto-session").setup({}) +require("auto-session").setup({ + auto_session_enabled = vim.env.KITTY_SCROLLBACK_NVIM ~= "true", -- See kitty-scrollback.nvim +}) diff --git a/dots/.config/nvim/after/plugin/conform.lua b/dots/.config/nvim/after/plugin/conform.lua index e8ba607..95af25d 100644 --- a/dots/.config/nvim/after/plugin/conform.lua +++ b/dots/.config/nvim/after/plugin/conform.lua @@ -1,6 +1,6 @@ require("conform").setup({ - format_on_save = { - lsp_fallback = true, + format_after_save = { + lsp_fallback = false, async = false, timeout_ms = 500, }, @@ -16,14 +16,14 @@ require("conform").setup({ lua = { "stylua" }, -- configured in stylua.toml markdown = { "prettierd", "prettier", stop_after_first = true }, nix = { "nixfmt" }, - javascript = { "prettierd", "prettier", stop_after_first = true }, - javascriptreact = { "prettierd", "prettier", stop_after_first = true }, + javascript = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true }, + javascriptreact = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true }, json = { "prettierd", "prettier", stop_after_first = true }, jsonc = { "prettierd", "prettier", stop_after_first = true }, python = { "isort", "black" }, - svelte = { "prettierd", "prettier", stop_after_first = true }, - typescript = { "prettierd", "prettier", stop_after_first = true }, - typescriptreact = { "prettierd", "prettier", stop_after_first = true }, - yaml = { "prettierd", "prettier", stop_after_first = true }, + svelte = { "eslint_d", "prettierd", "prettier", stop_after_first = true }, + typescript = { "eslint_d", "prettierd", "prettier", stop_after_first = true }, + typescriptreact = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true }, + -- yaml = { "prettierd", "prettier", stop_after_first = true }, }, }) diff --git a/dots/.config/nvim/after/plugin/gitsigns.nvim.lua b/dots/.config/nvim/after/plugin/gitsigns.nvim.lua index e0839e1..1c3f297 100644 --- a/dots/.config/nvim/after/plugin/gitsigns.nvim.lua +++ b/dots/.config/nvim/after/plugin/gitsigns.nvim.lua @@ -1,8 +1,12 @@ local gitsigns = require("gitsigns") gitsigns.setup({ - current_line_blame_opts = { delay = 0 }, current_line_blame_formatter = ", - ", + linehl = true, + current_line_blame_opts = { + delay = 0, + virt_text_pos = "right_align", + }, }) vim.api.nvim_create_user_command("Blame", gitsigns.toggle_current_line_blame, { nargs = "?" }) diff --git a/dots/.config/nvim/after/plugin/kitty-scrollback.nvim.lua b/dots/.config/nvim/after/plugin/kitty-scrollback.nvim.lua new file mode 100644 index 0000000..b97d0f9 --- /dev/null +++ b/dots/.config/nvim/after/plugin/kitty-scrollback.nvim.lua @@ -0,0 +1 @@ +require("kitty-scrollback").setup() diff --git a/dots/.config/nvim/after/plugin/lspconfig.lua b/dots/.config/nvim/after/plugin/lspconfig.lua index 7624ba6..489feec 100644 --- a/dots/.config/nvim/after/plugin/lspconfig.lua +++ b/dots/.config/nvim/after/plugin/lspconfig.lua @@ -1,7 +1,5 @@ require("neodev").setup() -- should setup before lspconfig -local lspconfig = require("lspconfig") - -- vim.g.coq_settings = { auto_start = 'shut-up' } -- local capabilities = coq.lsp_ensure_capabilities() @@ -34,7 +32,38 @@ local servers = { }, }, }, - lua_ls = {}, + lua_ls = { + on_init = function(client) + if client.workspace_folders then + local path = client.workspace_folders[1].name + if + path ~= vim.fn.stdpath("config") + and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc")) + then + return + end + end + + client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, { + runtime = { + version = "LuaJIT", + path = { + "lua/?.lua", + "lua/?/init.lua", + }, + }, + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME, + }, + }, + }) + end, + settings = { + Lua = {}, + }, + }, -- marksman = {}, nixd = {}, pyright = {}, @@ -104,9 +133,11 @@ local servers = { for server, config in pairs(servers) do config.capabilities = capabilities - lspconfig[server].setup(config) + vim.lsp.config(server, config) end +vim.lsp.enable(vim.tbl_keys(servers)) + vim.api.nvim_create_autocmd("LspAttach", { callback = function(e) local opts = { buffer = e.bufnr } diff --git a/dots/.config/nvim/after/plugin/nvim-cmp.lua b/dots/.config/nvim/after/plugin/nvim-cmp.lua index ba4ca44..e6b5441 100644 --- a/dots/.config/nvim/after/plugin/nvim-cmp.lua +++ b/dots/.config/nvim/after/plugin/nvim-cmp.lua @@ -63,6 +63,7 @@ cmp.setup({ }), sources = { { name = "copilot", group_index = 2 }, + { name = "zk" }, { name = "nvim_lsp", keyword_length = 8 }, { name = "luasnip", max_item_count = 16 }, { name = "path" }, diff --git a/dots/.config/nvim/after/plugin/taskwiki.vim.lua b/dots/.config/nvim/after/plugin/taskwiki.vim.lua deleted file mode 100644 index 8f64eff..0000000 --- a/dots/.config/nvim/after/plugin/taskwiki.vim.lua +++ /dev/null @@ -1,6 +0,0 @@ -vim.cmd([[ -let g:taskwiki_taskrc_location='/home/h/.config/task/taskrc' -let g:taskwiki_disable_concealcursor=1 -let g:taskwiki_dont_preserve_folds=1 -let g:taskwiki_dont_fold=1 -]]) diff --git a/dots/.config/nvim/after/syntax/pandoc.lua b/dots/.config/nvim/after/syntax/pandoc.lua index 198286b..d8d9f4b 100644 --- a/dots/.config/nvim/after/syntax/pandoc.lua +++ b/dots/.config/nvim/after/syntax/pandoc.lua @@ -14,13 +14,6 @@ syn match Cloze /\({{c\d\+::\)\@<=\(\_[A-Za-z0-9$\ \\\-\*,_`()]*\)\(}}\)\@=/ con hi! link ClozeDelimiter Special hi! link Cloze Special - -" Fix task UUIDs not being highlighted correctly in pandoc lists -syn match pandocUListItem /^>\=\s*[*+-]\s\+-\@!.*$/ nextgroup=pandocUListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocReferenceURL,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape,TaskWikiTaskUuid skipempty display -syn match TaskWikiTaskUuid containedin=TaskWikiTask /\v#([A-Z]:)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/ -syn match TaskWikiTaskUuid containedin=TaskWikiTask /\v#([A-Z]:)?[0-9a-fA-F]{8}$/ -highlight link TaskWikiTaskUuid Comment - ]]) vim.cmd.runtime("syntax/_comment_keywords.lua") diff --git a/dots/.config/nvim/lua/ftdetect.lua b/dots/.config/nvim/lua/ftdetect.lua index 3da7b6b..28856c5 100644 --- a/dots/.config/nvim/lua/ftdetect.lua +++ b/dots/.config/nvim/lua/ftdetect.lua @@ -8,5 +8,6 @@ vim.filetype.add({ [".*/%.ssh/config%.d/.*"] = "sshconfig", ["%.env.*"] = "dotenv", ["%.pl$"] = "prolog", + [".*.containerfile.*"] = "dockerfile", }, }) diff --git a/dots/.config/nvim/lua/paq-setup.lua b/dots/.config/nvim/lua/paq-setup.lua index 273f181..708208d 100644 --- a/dots/.config/nvim/lua/paq-setup.lua +++ b/dots/.config/nvim/lua/paq-setup.lua @@ -42,4 +42,5 @@ require("nixCatsUtils.catPacker").setup({ { "zbirenbaum/copilot.lua" }, { "zbirenbaum/copilot-cmp" }, { "qvalentin/helm-ls.nvim", ft = "helm" }, + { "mikesmithgh/kitty-scrollback.nvim" }, }) diff --git a/dots/.config/nvim/lua/plug.lua b/dots/.config/nvim/lua/plug.lua index a7df64c..401554a 100644 --- a/dots/.config/nvim/lua/plug.lua +++ b/dots/.config/nvim/lua/plug.lua @@ -12,7 +12,6 @@ Plug 'quarto-dev/quarto-vim' Plug 'lervag/vimtex' " Wiki Plug 'lervag/wiki.vim' -Plug 'hektor/taskwiki' " Markdown Plug 'vim-pandoc/vim-pandoc' Plug 'vim-pandoc/vim-pandoc-syntax' diff --git a/dots/.config/nvim/lua/skeleton/init.lua b/dots/.config/nvim/lua/skeleton/init.lua new file mode 100644 index 0000000..fd1e16b --- /dev/null +++ b/dots/.config/nvim/lua/skeleton/init.lua @@ -0,0 +1,11 @@ +local autocmd = vim.api.nvim_create_autocmd + +autocmd("BufNewFile", { + pattern = "shell.nix", + command = "0r ~/.config/nvim/skeletons/shell.nix", +}) + +autocmd("BufNewFile", { + pattern = "flake.nix", + command = "0r ~/.config/nvim/skeletons/flake.nix", +}) diff --git a/dots/.config/nvim/lua/zk/cmp.lua b/dots/.config/nvim/lua/zk/cmp.lua new file mode 100644 index 0000000..e3e234d --- /dev/null +++ b/dots/.config/nvim/lua/zk/cmp.lua @@ -0,0 +1,49 @@ +local cmp = require("cmp") + +local source = {} + +local function get_markdown_files(base) + local items = {} + local pattern = base .. "/**/*.md" + local files = vim.fn.glob(pattern, false, true) + for _, file in ipairs(files) do + local label = file:gsub("^%./", ""):gsub("%.md$", "") + table.insert(items, { label = label }) + end + return items +end + +function source:complete(params, callback) + local cursor_before_line = params.context.cursor_before_line + local cursor_after_line = params.context.cursor_after_line or "" + + local trigger = cursor_before_line:match("%[[^%]]*%]%(([^)]*)$") + + if trigger ~= nil then + local items = get_markdown_files(".") + local next_char = cursor_after_line:sub(1, 1) + + for _, item in ipairs(items) do + if next_char == ")" then + item.insertText = item.label + else + item.insertText = item.label .. ")" + end + end + + callback(items) + else + callback({}) + end +end + +function source:get_trigger_characters() + return { "(" } +end + +function source:is_available() + local ft = vim.bo.filetype + return ft == "markdown" or ft == "pandoc" +end + +cmp.register_source("zk", source) diff --git a/dots/.config/nvim/lua/zk.lua b/dots/.config/nvim/lua/zk/init.lua similarity index 98% rename from dots/.config/nvim/lua/zk.lua rename to dots/.config/nvim/lua/zk/init.lua index dcd366d..bc81058 100644 --- a/dots/.config/nvim/lua/zk.lua +++ b/dots/.config/nvim/lua/zk/init.lua @@ -1,3 +1,5 @@ +require("zk.cmp") + vim.cmd([[ let s:zk_preview_enabled = 0 let s:live_server_job = -1 diff --git a/dots/.config/nvim/skeletons/flake.nix b/dots/.config/nvim/skeletons/flake.nix new file mode 100644 index 0000000..7592bc0 --- /dev/null +++ b/dots/.config/nvim/skeletons/flake.nix @@ -0,0 +1,10 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = + { self, nixpkgs }: + { + }; +} diff --git a/dots/.config/nvim/skeletons/shell.nix b/dots/.config/nvim/skeletons/shell.nix new file mode 100644 index 0000000..b84b531 --- /dev/null +++ b/dots/.config/nvim/skeletons/shell.nix @@ -0,0 +1,6 @@ +{ + pkgs ? import { }, +}: +pkgs.mkShell { + nativeBuildInputs = with pkgs.buildPackages; [ ]; +} diff --git a/dots/.config/nvim/snips/lua.lua b/dots/.config/nvim/snips/lua.lua new file mode 100644 index 0000000..3ff2f54 --- /dev/null +++ b/dots/.config/nvim/snips/lua.lua @@ -0,0 +1,12 @@ +local ls = require("luasnip") +local s = ls.snippet +local t = ls.text_node +local i = ls.insert_node + +return { + s({ trig = "^M.", regTrig = true, snippetType = "autosnippet" }, { + t("local M = {"), + i(1), + t({ "}", "", "", "return M" }), + }), +} diff --git a/dots/.config/nvim/snips/pandoc.lua b/dots/.config/nvim/snips/pandoc.lua index 4bc29bf..aa21805 100644 --- a/dots/.config/nvim/snips/pandoc.lua +++ b/dots/.config/nvim/snips/pandoc.lua @@ -700,10 +700,6 @@ local fmta = require("luasnip.extras.fmt").fmta -- \`\`\` -- endsnippet -- --- snippet task "Task" i --- * [ ] $1 -- pro:$2 --- endsnippet --- -- snippet "(\b)fn(\d+)" "" ir -- `!p snip.rv = snip.basename + "_" + match.group(2).zfill(2)`$1 -- endsnippet diff --git a/dots/.gitconfig b/dots/.gitconfig index 8118538..feff57a 100644 --- a/dots/.gitconfig +++ b/dots/.gitconfig @@ -21,6 +21,8 @@ sv = status --verbose co = checkout cob = checkout -b + pullr = "pull --rebase --autostash" + pushf = "push --force-with-lease" # Note these follow the naming convention of my `.bash_aliases` al = "!git config -l | grep alias | cut -c 7-" alf = "!git config -l | grep alias | cut -c 7- | fzf" diff --git a/dots/.gitignore b/dots/.gitignore index c1b7628..a18f3b8 100644 --- a/dots/.gitignore +++ b/dots/.gitignore @@ -9,6 +9,7 @@ log/ # Node npm-debug.log node_modules +.npm-cache # Python *.pyc @@ -68,6 +69,7 @@ Thumbs.db # Kernel Module Compile Results *.mod* +!*.mod*.* *.cmd .tmp_versions/ modules.order