Compare commits
93
Commits
46ad7843ea
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6163eb0396 | ||
|
|
2261e4b792 | ||
|
|
995bdaa973 | ||
|
|
e93d8a43cf | ||
|
|
b4afb529a8 | ||
|
|
4bc670e1e5 | ||
|
|
c1b44e049c | ||
|
|
1aff05b4f2 | ||
|
|
b62212ad0c | ||
|
|
1b3468185b | ||
|
|
72b9eb053d | ||
|
|
a6afe699fb | ||
|
|
1f3c1a7d18 | ||
|
|
9dfa0f5e58 | ||
|
|
8f6e3a58b3 | ||
|
|
1313d962ad | ||
|
|
731b646def | ||
|
|
92eaa865e4 | ||
|
|
fee4090bf6 | ||
|
|
f1184b28da | ||
|
|
a9aa41ff02 | ||
|
|
f8314da86b | ||
|
|
defc576767 | ||
|
|
8474997bc3 | ||
|
|
c16f62fb2a | ||
|
|
ff6e7d5032 | ||
|
|
8fa8cad28c | ||
|
|
3652fe397a | ||
|
|
2da26a2c0c | ||
|
|
203dc0c159 | ||
|
|
b69701dbc2 | ||
|
|
7c45fbe440 | ||
|
|
4322ae8c39 | ||
|
|
7e87b775d0 | ||
|
|
320b61eb37 | ||
|
|
04fcabfe9d | ||
|
|
3064c2db08 | ||
|
|
20d15ab317 | ||
|
|
1ceeca785f | ||
|
|
df77c3ef6f | ||
|
|
64560b37ae | ||
|
|
664487ab9a | ||
|
|
8bae140a4e | ||
|
|
c57a207f60 | ||
|
|
759c6652ba | ||
|
|
7f69390afd | ||
|
|
1b228bb467 | ||
|
|
2b1f075617 | ||
|
|
8893741d36 | ||
|
|
6b845b68fc | ||
|
|
5ef2025673 | ||
|
|
8f529cb491 | ||
|
|
86ec058ac7 | ||
|
|
b50dfa98b7 | ||
|
|
16433b310d | ||
|
|
f8bb273d65 | ||
|
|
239d47a396 | ||
|
|
78c17b9381 | ||
|
|
ac2441493f | ||
|
|
318dc0ef08 | ||
|
|
f6847f6c2a | ||
|
|
8098fe2daf | ||
|
|
102b485fd2 | ||
|
|
13a299f61f | ||
|
|
04c2900d81 | ||
|
|
c2254cc13d | ||
|
|
1c93929ad1 | ||
|
|
be62be1ae6 | ||
|
|
06ee05cf46 | ||
|
|
6d1af69a54 | ||
|
|
a05e98a94c | ||
|
|
d01eef5861 | ||
|
|
cd4b52cdce | ||
|
|
ff528d07ac | ||
|
|
337d1a9014 | ||
|
|
da8ba03f55 | ||
|
|
8046f88d98 | ||
|
|
18b2a09cd8 | ||
|
|
deb489df45 | ||
|
|
e19bae5c29 | ||
|
|
4c4e64cbe7 | ||
|
|
40b326eceb | ||
|
|
9756ab7d0b | ||
|
|
ecbbbd70e9 | ||
|
|
ece8fd9a3a | ||
|
|
08ae538dff | ||
|
|
4dc97abef9 | ||
|
|
ff5394c7b2 | ||
|
|
fbb36aceef | ||
|
|
dfd09539b2 | ||
|
|
a19ed0aec6 | ||
|
|
aa5708a28d | ||
|
|
259ebf85c4 |
No files matched your search
@@ -0,0 +1,14 @@
|
||||
---
|
||||
trigger: always_on
|
||||
description: Consult the graphify knowledge graph at graphify-out/ for codebase and architecture questions.
|
||||
---
|
||||
|
||||
## graphify
|
||||
|
||||
This project has a graphify knowledge graph at graphify-out/.
|
||||
|
||||
Rules:
|
||||
- For codebase or architecture questions, when `graphify-out/graph.json` exists, first run `graphify query "<question>"` (CLI) or `query_graph` (MCP). Use `graphify path "<A>" "<B>"` / `shortest_path` for relationships and `graphify explain "<concept>"` / `get_node` for focused concepts. These return a scoped subgraph, usually much smaller than `GRAPH_REPORT.md` or raw grep output.
|
||||
- If graphify-out/wiki/index.md exists, navigate it instead of reading raw files
|
||||
- Read graphify-out/GRAPH_REPORT.md only for broad architecture review or when query/path/explain do not surface enough context
|
||||
- After modifying code files in this session, run `graphify update .` to keep the graph current (AST-only, no API cost)
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: graphify
|
||||
description: Turn any folder of files into a navigable knowledge graph
|
||||
---
|
||||
|
||||
# Workflow: graphify
|
||||
|
||||
Follow the graphify skill to run the full pipeline.
|
||||
|
||||
If no path argument is given, use `.` (current directory).
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# .githooks/pre-commit - Git pre-commit hook running automated quality checks
|
||||
set -euo pipefail
|
||||
|
||||
# Ensure NixOS user profile binaries are in PATH
|
||||
export PATH="/etc/profiles/per-user/${USER:-kiskaadee}/bin:$HOME/.nix-profile/bin:$PATH"
|
||||
|
||||
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
||||
cd "$REPO_ROOT"
|
||||
|
||||
echo "🚀 [pre-commit] Running automated verification & static analysis suite..."
|
||||
exec "$REPO_ROOT/scripts/test"
|
||||
@@ -7,3 +7,6 @@ result-*
|
||||
|
||||
|
||||
.ruff_cache/
|
||||
|
||||
# Graphify knowledge graph outputs & caches
|
||||
graphify-out/
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
keys:
|
||||
- &laptop age1pln9sxy5j93lklqklfwp3qepx7x4cs4y2w63n9y3ykt68qgra5ysqleesg
|
||||
- &anne age1utkr8d88ezkwwf7aarpgg8ujqa8jmqtrjxvcau7yctjey66sngpqcr8fmx
|
||||
|
||||
creation_rules:
|
||||
- path_regex: anne-secrets\.yaml$
|
||||
key_groups:
|
||||
- pgp: []
|
||||
age:
|
||||
- *laptop
|
||||
- *anne
|
||||
- path_regex: secrets\.yaml$
|
||||
key_groups:
|
||||
- pgp: []
|
||||
age:
|
||||
- *laptop
|
||||
@@ -0,0 +1,28 @@
|
||||
gitea:
|
||||
token: ENC[AES256_GCM,data:aufTXSQAmAcwrTOnHauRnK0eEZSa1/2w6JwMn/yrL6BGCFyzRIeQ/Q==,iv:Q+d2efdCyyOb1fE1RV8QY4/QTMPlsbeWT43arb8VQlg=,tag:AlxJy4G+4v9O3T+fAZeizA==,type:str]
|
||||
github:
|
||||
token: ENC[AES256_GCM,data:z5XgwnOBEe7XNKhENNxUkkaToOfWotruLrZU5G8VQtJLP9/OHP3psA==,iv:cg2T0CfeoiVb7z7wm2uqKohKmwoiIGqHjnoLbeGg9/w=,tag:7sSSsVhbsl/pFMIhIjX0SA==,type:str]
|
||||
sops:
|
||||
age:
|
||||
- enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB1bjZDTDY5SXV2VEg4MVVp
|
||||
U3Y0SFBtZ1hPbDFOdTZMWjZ0QklUOUlJOFg4CktncVJEYjVreEU0Vk0xbzJsMXkx
|
||||
Q29CR083NkVBdkxINTJNS3NITzdxWkUKLS0tIGY3ajlVaUxzanVUZFJRSGhrZGNv
|
||||
TWNQK2F1enpVNXoxcmFWL2tXTWJRRzAK9HVRRGz8MAfNMbZg4M/J61+ahRFm25Mw
|
||||
+27VMOWX2XMQmMsGbR9Et3/8dmWK256yKW+LS/+W/mdK5+wkTmGyKg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
recipient: age1pln9sxy5j93lklqklfwp3qepx7x4cs4y2w63n9y3ykt68qgra5ysqleesg
|
||||
- enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBrSU1uRnNNYWF4SW5aM3pz
|
||||
emkxbzBwZ05XeG1PTk1saVNyeHlCUUROazFNCmlJZEhDaUtITjVYM1N0UU02QzJH
|
||||
M1ZjYUxmNVN3OEUzb1VuVlhJWFd2cm8KLS0tIEc3TVBJUXpqdkk3SVFHL1V1REN3
|
||||
ZGsvZGc5STljOGZOQks4ZFpJV1dqZ2sK6md/OW6F19AEbYdRp44h1ZWAaH3njBNP
|
||||
XFdWOofCIJUoH6oYEHBe7Xc6g9n4R7fGK12bLDTgnhzOEypiYDlfGQ==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
recipient: age1utkr8d88ezkwwf7aarpgg8ujqa8jmqtrjxvcau7yctjey66sngpqcr8fmx
|
||||
lastmodified: "2026-10-21T20:28:26Z"
|
||||
mac: ENC[AES256_GCM,data:Fgr08qaqWx40iT6uprqsFoMcWTibGSvQMVdDbTcaW775F1poZULS1He5/V0HlW0Yu3zJiZgG/4HtoITtyXrF9bW6CtSoRvhZDZ1p7YmF3q+v6WdSR+AoyQui+g8C51C0m6YqQmfbINV/qEUNW0TFsJXJid0dgszV6Z8uO/lKmU8=,iv:QBEV0lvCDgEWsvEQXfQqgVzFKiPRyApT7rbN48zR0/8=,tag:pzc3W6MpvCqC9YRT0iihxA==,type:str]
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.13.3
|
||||
@@ -32,7 +32,7 @@ Is it a compiler, LSP, language runtime, or dev tool?
|
||||
| **`system/hardware.nix`** | Hardware daemons & root services | PipeWire, Docker, Bluetooth (`bluez`), Power management (`tlp`), CUPS printing |
|
||||
| **`system/desktop.nix`** | Display server & greeter | Niri compositor enablement, DMS greeter, greetd, system typography/fonts |
|
||||
| **`home/desktop.nix`** | User graphical applications | Zen Browser, Zed, Obsidian, LibreOffice, GIMP, MPV, grim/slurp, DankSearch |
|
||||
| **`home/dev.nix`** | Toolchains & development | Rust, Python, Node, Go, language servers (pyright, rust-analyzer), Antigravity, sops/age CLI |
|
||||
| **`home/dev.nix`** | Toolchains & development | Rust, uv, Node, Go, language servers (nil, rust-analyzer), Antigravity, sops/age CLI |
|
||||
| **`home/shell.nix`** | Interactive shell & CLI tools | Bash, Tmux, Git, Starship, Delta, Fastfetch, ripgrep, fzf, bat, jq, eza |
|
||||
|
||||
---
|
||||
|
||||
@@ -103,6 +103,17 @@ This ensures `~/.config/niri/dms/binds.kdl` is created with proper user write pe
|
||||
| `Mod+Alt+Right / Left` | Expand / Shrink Column Width (+/- 100px) | Custom (`custom.kdl`) |
|
||||
| `Mod+Alt+Down / Up` | Expand / Shrink Window Height (+/- 100px) | Custom (`custom.kdl`) |
|
||||
|
||||
### Monitor & Workspace Navigation
|
||||
| Shortcut | Action | Source | Precedence Note |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `Mod+\`` | Focus Next Monitor | Custom (`custom.kdl`) | Orientation-agnostic toggle between displays. |
|
||||
| `Mod+Shift+\`` | Move Focused Column to Next Monitor | Custom (`custom.kdl`) | Orientation-agnostic window transfer across displays. |
|
||||
| `Mod+Ctrl+Left / Right` | Focus Monitor Left / Right | DMS IPC (`binds.kdl`) | Directional monitor switching. |
|
||||
| `Mod+Ctrl+Down / Up` | Focus Monitor Down / Up | Custom (`custom.kdl`) | Overrides DMS workspace move to allow vertical monitor switching. |
|
||||
| `Mod+Shift+Ctrl+Arrow / HJKL` | Move Column to Monitor (Directional) | DMS IPC (`binds.kdl`) | Directional window transfer across displays. |
|
||||
| `Mod+Ctrl+Page_Down / Page_Up` | Move Column to Workspace Down / Up | Custom (`custom.kdl`) | Relocated from `Mod+Ctrl+Down/Up` for arrow/page users. |
|
||||
| `Mod+Ctrl+U / Mod+Ctrl+I` | Move Column to Workspace Down / Up | DMS IPC (`binds.kdl`) | Directional workspace column transfer. |
|
||||
|
||||
### Screenshots, Screen Recording & Utilities
|
||||
| Shortcut | Action | Source |
|
||||
| :--- | :--- | :--- |
|
||||
|
||||
@@ -21,7 +21,7 @@ Autonomous agents must **never** execute `nixos-rebuild switch`, `boot`, `test`,
|
||||
Whenever an agent produces an artifact (`UserFacing: true`) or substantial analysis, a copy must be preserved in the Second Brain staging inbox:
|
||||
|
||||
```text
|
||||
/home/kiskaadee/Brain/inbox/<descriptive-name>.md
|
||||
/home/kiskaadee/Brain/00-inbox/<descriptive-name>.md
|
||||
```
|
||||
|
||||
With frontmatter:
|
||||
@@ -36,8 +36,13 @@ created: YYYY-MM-DD
|
||||
|
||||
## 3. Toolchains & Local Binaries
|
||||
|
||||
Antigravity executes in an interactive development environment with access to:
|
||||
- `agy` CLI binary installed via `home/dev.nix`.
|
||||
The workstation uses the community-maintained `github:jacopone/antigravity-nix` flake input, which tracks and bundles the three Antigravity surfaces with regular upstream updates:
|
||||
- `agy` CLI binary (`google-antigravity-cli`) declared in [`home/dev.nix`](file:///home/kiskaadee/Config/home/dev.nix).
|
||||
- Antigravity 2.0 Desktop GUI (`google-antigravity`) declared in [`home/desktop.nix`](file:///home/kiskaadee/Config/home/desktop.nix).
|
||||
- Antigravity IDE (`google-antigravity-ide`) declared in [`home/desktop.nix`](file:///home/kiskaadee/Config/home/desktop.nix).
|
||||
|
||||
Antigravity operates in an interactive development environment with access to:
|
||||
- Installed Antigravity tools and editors.
|
||||
- Python runtime, Ruff, and Pyright.
|
||||
- Git, ripgrep (`rg`), and fd (`find_by_name`).
|
||||
- Nix CLI (`nix flake check`, `nix build`, `nix eval`).
|
||||
@@ -24,11 +24,14 @@ The following language servers are installed globally via `home/dev.nix` and att
|
||||
| :--- | :--- | :--- |
|
||||
| **Nix** | `nil` | `nixfmt-rfc-style` |
|
||||
| **Rust** | `rust-analyzer` | `rustfmt` |
|
||||
| **Python** | `pyright` | `ruff` |
|
||||
| **Python** | `pyright` *(devshell / venv)* | `ruff` *(devshell / venv)* |
|
||||
| **JavaScript / TypeScript** | `typescript-language-server` | `prettier` |
|
||||
| **Go** | `gopls` | `gofmt` |
|
||||
| **Markdown / Documentation** | `marksman` | `prettier` |
|
||||
|
||||
> [!NOTE]
|
||||
> Python language tooling (`pyright`, `ruff`) is resolved dynamically via `direnv` from individual project devshells or virtualenvs rather than global system packages.
|
||||
|
||||
---
|
||||
|
||||
## 3. Essential Keybindings
|
||||
|
||||
+23
-1
@@ -13,8 +13,9 @@ The shell environment is modularized:
|
||||
- `jump.sh`: Directory navigation and quick jumping.
|
||||
- `pdf.sh`: PDF compilation, viewing, and OCR helpers.
|
||||
- `quicklinks.sh`: Shortcuts to primary project directories.
|
||||
- `secrets.sh`: SOPS secret retrieval (`gh-token` clipboard utility, transparent `flarectl` and `hostinger` process wrappers).
|
||||
- `todo.sh`: Lightweight terminal task tracking.
|
||||
- `wayland.sh`: Wayland session environment variables.
|
||||
- `wayland.sh`: Wayland session environment variables and clipboard helpers.
|
||||
|
||||
---
|
||||
|
||||
@@ -36,6 +37,27 @@ The shell environment is modularized:
|
||||
| `gs` | `git status` | Quick working tree status. |
|
||||
| `gd` | `git diff` | Syntax-highlighted git diff via Delta. |
|
||||
| `gl` | `git log --oneline --graph --decorate` | Compact visual commit graph. |
|
||||
| `ght` | `gh-token` | Copy GitHub repo token from SOPS into Wayland clipboard. |
|
||||
|
||||
### Operator CLI Secret Wrappers (`home/shell/secrets.sh`)
|
||||
| Command / Function | Injected Environment Variables | Source Secret Key (`~/Config/secrets.yaml`) |
|
||||
| :--- | :--- | :--- |
|
||||
| `flarectl` | `CF_API_TOKEN`, `CF_ACCOUNT_ID` | `["cloudflare"]["api_token"]`, `["cloudflare"]["account_id"]` |
|
||||
| `hostinger` | `HOSTINGER_API_TOKEN` | `["hostinger"]["api_token"]` |
|
||||
| `gh-token` (`ght`) | *(Copies directly to Wayland clipboard)* | `["system"]["gh_repo_token"]` (from Homelab `Core`) |
|
||||
|
||||
*Note: Environment variables are set exclusively for the child process lifecycle and do not persist in your interactive shell.*
|
||||
|
||||
### Directory Navigation Jumps (`home/shell/jump.sh`)
|
||||
| 2-Letter | Word Alias | Target Directory | Description |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `br` | `brain` | `~/Brain` | Second brain knowledge base. |
|
||||
| `cf` | `conf` / `cfg` | `~/Config` | Declarative NixOS configuration. |
|
||||
| `dc` | `doc` / `docs` | `~/Documents` | Personal documents. |
|
||||
| `dl` | `dl` | `~/Downloads` | Downloads folder. |
|
||||
| `pi` | `pic` / `pict` | `~/Pictures` | Wallpapers, images, screenshots. |
|
||||
| `pj` | `pj` / `prj` | `~/Projects` | Local workspace for project repositories. |
|
||||
| `hl` | `hl` / `homelab` | `~/Homelab` | Local workspace for homelab repositories. |
|
||||
|
||||
---
|
||||
|
||||
|
||||
+82
-24
@@ -1,31 +1,90 @@
|
||||
# 🪟 Tmux Reference & Workflow
|
||||
# 🪟 Terminal Workspaces & Tmux Reference
|
||||
|
||||
This document describes the Tmux terminal multiplexer configuration declared in `home/shell.nix` and `home/config/tmux.conf`.
|
||||
This reference covers the operational controls, keybindings, and workflows for persistent workspaces and terminal multiplexing on the `laptop` workstation.
|
||||
|
||||
---
|
||||
|
||||
## 1. Core Configuration
|
||||
## 1. Terminal Workflows
|
||||
|
||||
- **Prefix Key**: `Ctrl+Space` (`C-Space`, remapped from standard `Ctrl+B`).
|
||||
| Shortcut | Action | Semantics |
|
||||
| :--- | :--- | :--- |
|
||||
| `Mod+Return` | **Alacritty Shell** | Opens a standard shell immediately. Ephemeral, isolated, non-persistent. |
|
||||
| `Mod+T` | **Workspace Selector** | Opens Alacritty running the interactive sessionizer (`ts`). Exiting `fzf` with `Esc` closes the window cleanly. |
|
||||
|
||||
---
|
||||
|
||||
## 2. Sessionizer CLI (`ts`)
|
||||
|
||||
The `ts` utility (`tmux-sessionizer`) connects directly to persistent tmux workspaces:
|
||||
|
||||
```bash
|
||||
# Interactive fuzzy selector (shows session name and path)
|
||||
ts
|
||||
|
||||
# Open a workspace by name (exact or normalized)
|
||||
ts config
|
||||
ts brain
|
||||
ts core
|
||||
ts bitetrack-api
|
||||
|
||||
# Open a workspace by unique substring
|
||||
ts magnet # Resolves to MagNetFlix
|
||||
|
||||
# Open a workspace by direct filesystem path
|
||||
ts ~/Config
|
||||
ts ~/Projects/active/nekoweb
|
||||
```
|
||||
|
||||
### Argument Resolution Order
|
||||
When an argument is provided (`ts <arg>`), it resolves in this exact order:
|
||||
1. **Existing directory**: Canonicalizes path via `realpath`.
|
||||
2. **Exact session name**: Matches normalized session name.
|
||||
3. **Exact directory basename**: Matches directory name.
|
||||
4. **Unique substring**: Matches against names and paths.
|
||||
|
||||
*Ambiguous matches fail safely with an error and candidate list rather than guessing.*
|
||||
|
||||
---
|
||||
|
||||
## 3. Workspace Discovery
|
||||
|
||||
The sessionizer automatically indexes workspaces from:
|
||||
|
||||
- **Explicit Workspaces**:
|
||||
- `~/Config`
|
||||
- `~/Brain`
|
||||
- `~/Homelab/Core`
|
||||
- **Git Repositories**:
|
||||
- Discovered beneath `~/Projects` and `~/Homelab` (depth 4).
|
||||
|
||||
*Any directory passed directly as a path (`ts <path>`) works immediately without needing to be under discovery roots.*
|
||||
|
||||
---
|
||||
|
||||
## 4. Tmux Behavior & Persistence
|
||||
|
||||
- **Outside Tmux**: Running `ts` creates or attaches to the session.
|
||||
- **Inside Tmux**: Running `ts` switches the active client (`switch-client`) without nesting sessions.
|
||||
- **Session State**: New sessions start in the workspace folder. Reconnecting to an existing session preserves your current working directory, open files, and terminal buffers.
|
||||
- **Persistence**: Closing an Alacritty window leaves background jobs and tmux sessions running. Reconnect at any time by pressing `Mod+T` or running `ts <name>`.
|
||||
|
||||
---
|
||||
|
||||
## 5. Tmux Controls & Keybindings
|
||||
|
||||
- **Prefix Key**: `Ctrl+Space` (`C-Space`)
|
||||
- **Terminal Capabilities**: TrueColor (`tmux-256color`) with RGB support and extended keys enabled.
|
||||
- **Mouse Support**: Enabled for scrolling, pane selection, and resizing.
|
||||
- **Base Index**: Windows and panes start at index `1` (matching keyboard row `1..9`).
|
||||
- **Escape Time**: `0ms` (zero delay for responsive escape-key behavior in Vim/Neovim).
|
||||
- **Clipboard**: OSC 52 integration enabled (`set -s set-clipboard on`), syncing clipboard locally and over SSH.
|
||||
|
||||
---
|
||||
|
||||
## 2. Keybindings & Controls
|
||||
|
||||
### Smart Neovim / Tmux Navigation (No Prefix Required)
|
||||
Thanks to `vim-tmux-navigator` integration, you can navigate seamlessly between Vim splits and Tmux panes without pressing the prefix key:
|
||||
Navigate between Neovim splits and Tmux panes seamlessly using `Ctrl+h/j/k/l`:
|
||||
|
||||
| Shortcut | Action |
|
||||
| :--- | :--- |
|
||||
| `Ctrl+h` | Move to left pane / Vim split. |
|
||||
| `Ctrl+j` | Move to down pane / Vim split. |
|
||||
| `Ctrl+k` | Move to up pane / Vim split. |
|
||||
| `Ctrl+l` | Move to right pane / Vim split. |
|
||||
| `Ctrl+h` | Move to left pane / Neovim split. |
|
||||
| `Ctrl+j` | Move to down pane / Neovim split. |
|
||||
| `Ctrl+k` | Move to up pane / Neovim split. |
|
||||
| `Ctrl+l` | Move to right pane / Neovim split. |
|
||||
|
||||
*(Fallback navigation using prefix: `Ctrl+Space h/j/k/l`)*
|
||||
|
||||
@@ -58,15 +117,14 @@ Thanks to `vim-tmux-navigator` integration, you can navigate seamlessly between
|
||||
|
||||
---
|
||||
|
||||
## 3. Persistent Sessions
|
||||
## 6. Verification Commands
|
||||
|
||||
```bash
|
||||
# Attach or create session named "dev":
|
||||
tmux new-session -A -s dev
|
||||
# Validate flake metadata & checks
|
||||
nix flake check
|
||||
|
||||
# List active sessions:
|
||||
tmux ls
|
||||
|
||||
# Detach from active session:
|
||||
Ctrl+Space d
|
||||
# Build laptop configuration without switching
|
||||
nix build .#nixosConfigurations.laptop.config.system.build.toplevel --no-link
|
||||
```
|
||||
|
||||
*(For architectural background, boundary models, and design principles, see `Brain/records/decisions/terminal-workspace-architecture.md`)*.
|
||||
+65
-11
@@ -32,19 +32,73 @@ graph LR
|
||||
end
|
||||
```
|
||||
|
||||
### Roles & Boundaries
|
||||
1. **Workstation (`Config`)**:
|
||||
- Holds **zero** declarative system secrets (`sops-nix` is not imported).
|
||||
- Provides operator CLI packages (`sops`, `age`, `rbw`) in `home/dev.nix`.
|
||||
- Stores the operator's personal age identity in `~/.config/sops/age/keys.txt`.
|
||||
2. **Server (`Core`)**:
|
||||
- Headless consumer running Docker containers, databases, and Traefik.
|
||||
- Decrypts secrets at boot into a secure ramfs (`/run/secrets/`) using `/etc/ssh/ssh_host_ed25519_key`.
|
||||
- Unprivileged SSH sessions cannot edit secrets directly on the server.
|
||||
### Two-Tier Secrets Architecture
|
||||
|
||||
The infrastructure enforces a strict separation between **Operator Secrets** (workstation) and **Runtime Workload Secrets** (server):
|
||||
|
||||
| Attribute | Workstation Operator Secrets (`Config`) | Server Runtime Secrets (`Core`) |
|
||||
| :--- | :--- | :--- |
|
||||
| **Ciphertext File** | `Config/secrets.yaml` | `Core/nixos/secrets.yaml` |
|
||||
| **Scope** | Personal operator tokens (Cloudflare, Hostinger, GitHub) | Service runtime credentials (Traefik, DBs, Docker daemons) |
|
||||
| **Tenancy** | Multi-project across account domains | Scoped strictly to homelab infrastructure workloads |
|
||||
| **Decryption Model** | In-memory on-demand via `sops -d --extract` in shell wrappers | Automated boot-time ramfs mount via `sops-nix` (`/run/secrets/`) |
|
||||
| **Key Identity** | Personal age identity (`~/.config/sops/age/keys.txt`) | Server host SSH key (`/etc/ssh/ssh_host_ed25519_key`) |
|
||||
| **Daemon Overhead** | **Zero** (`sops-nix` module intentionally omitted) | Managed via root systemd units |
|
||||
|
||||
---
|
||||
|
||||
## 2. Operator Workflow: Authoring & Rotating Secrets
|
||||
## 2. Workstation Operator Secrets (`Config/secrets.yaml`)
|
||||
|
||||
Operator CLI tools (such as `flarectl` and `hostinger`) manage cloud infrastructure across multiple projects. To maintain least-privilege for the server, these credentials are kept on the workstation:
|
||||
|
||||
```yaml
|
||||
# Config/secrets.yaml (encrypted with operator age key)
|
||||
cloudflare:
|
||||
api_token: "..."
|
||||
account_id: "..."
|
||||
|
||||
hostinger:
|
||||
api_token: "..."
|
||||
```
|
||||
|
||||
### Process-Scoped In-Memory Decryption
|
||||
Rather than exporting tokens into global interactive shells or writing plaintext config files to disk, shell wrappers in `home/shell/secrets.sh` extract credentials into the child process environment on demand:
|
||||
|
||||
```bash
|
||||
# Example: flarectl wrapper in home/shell/secrets.sh
|
||||
flarectl() {
|
||||
local secrets_file="$HOME/Config/secrets.yaml"
|
||||
if [[ -f "$secrets_file" ]] && command -v sops >/dev/null 2>&1; then
|
||||
CF_API_TOKEN=$(sops -d --extract '["cloudflare"]["api_token"]' "$secrets_file" 2>/dev/null) \
|
||||
CF_ACCOUNT_ID=$(sops -d --extract '["cloudflare"]["account_id"]' "$secrets_file" 2>/dev/null) \
|
||||
command flarectl "$@"
|
||||
else
|
||||
command flarectl "$@"
|
||||
fi
|
||||
}
|
||||
```
|
||||
|
||||
* **Security**: Decryption occurs strictly in RAM (~17ms overhead).
|
||||
* **Isolation**: The environment variables exist only for the life of `flarectl "$@"` and do not persist in the parent interactive shell.
|
||||
|
||||
### Autonomous Agent Secrets (`Config/anne-secrets.yaml`)
|
||||
To prevent autonomous agents from having access to personal operator tokens (Cloudflare, Hostinger, personal GitHub), agent credentials live in dedicated, firewalled secret files:
|
||||
|
||||
```yaml
|
||||
# Config/anne-secrets.yaml (encrypted for both *laptop and *anne)
|
||||
gitea:
|
||||
token: "..."
|
||||
github:
|
||||
token: "..."
|
||||
```
|
||||
|
||||
* **Multi-Recipient Encryption**: Encrypted for both `*laptop` (`keys.txt`) and `*anne` (`anne_keys.txt`).
|
||||
* **Operator Convenience**: The workstation operator can view and edit `anne-secrets.yaml` seamlessly using `sops anne-secrets.yaml` without switching keys.
|
||||
* **Cryptographic Firewall**: When running in an isolated container or subagent environment with only `anne_keys.txt`, the agent physically cannot decrypt `Config/secrets.yaml`.
|
||||
|
||||
---
|
||||
|
||||
## 3. Homelab Server Runtime Secrets (`Core/nixos/secrets.yaml`)
|
||||
|
||||
To rotate or add a secret for homelab services:
|
||||
|
||||
@@ -74,7 +128,7 @@ The server evaluates the new ciphertext, decrypts it into `/run/secrets/`, and r
|
||||
|
||||
---
|
||||
|
||||
## 3. Backing Up & Restoring the Operator Age Key
|
||||
## 4. Backing Up & Restoring the Operator Age Key
|
||||
|
||||
The operator key is your cryptographic identity for managing homelab infrastructure:
|
||||
|
||||
|
||||
Generated
+135
-52
@@ -8,11 +8,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789197223,
|
||||
"narHash": "sha256-MVHEq1J+aE8NaapAot0BXEFP9f+4jXQRus6tFgp2P+0=",
|
||||
"lastModified": 1795331353,
|
||||
"narHash": "sha256-llMfFaxJxf7aMf0NRuKFtmBpDh14q5qnpwiGy/DJsJc=",
|
||||
"owner": "jacopone",
|
||||
"repo": "antigravity-nix",
|
||||
"rev": "0d6f9760ee4d685c6e75faeafb5055b93c4bc4aa",
|
||||
"rev": "c9f1bae6b80d90c92eed93694bdb5291242fe9a4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -24,16 +24,17 @@
|
||||
"dank-greeter": {
|
||||
"inputs": {
|
||||
"dank-qml-common": "dank-qml-common",
|
||||
"dux-qt-base": "dux-qt-base",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789053332,
|
||||
"narHash": "sha256-Z6tV5jX8Ah6RHIHeSnV6kEwJJZ6Ore+FR8F+vr9xjxY=",
|
||||
"lastModified": 1795022150,
|
||||
"narHash": "sha256-EINAcQZPXnTzHJNGqFxTMFSv7eT0wxymdg10Pud131E=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-greeter",
|
||||
"rev": "0175be5c2084e2c5027324403a329e04040cd0bc",
|
||||
"rev": "3e4affaf85f91fd98fdb83a27651d2597963e8ae",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -45,64 +46,65 @@
|
||||
"dank-qml-common": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1788376015,
|
||||
"narHash": "sha256-/tT8rTznLADndTwLBzdgzzgfJH1ZhYQibYo5v/F8U+U=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-qml-common",
|
||||
"rev": "26396ce432d6c71c3f5367438f96f4a8d667e160",
|
||||
"lastModified": 1795021255,
|
||||
"narHash": "sha256-fDhHTvIkU+oDuIvdOhG5RyNZSYuxwM3xscLLdxmLVY4=",
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qml-common",
|
||||
"rev": "e7c185915fe2555c6e6681711054e6b79f546806",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-qml-common",
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qml-common",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"dank-qml-common_2": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1788219423,
|
||||
"narHash": "sha256-U4WBPh+pfM2IRF+IOWWHaw3cWaR1kYtl+Rdp7i9S2OQ=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-qml-common",
|
||||
"rev": "a9ae19facd460a4150da269dafcfb044b0dd9eea",
|
||||
"lastModified": 1795139913,
|
||||
"narHash": "sha256-RYLCGIA8CuAIsmWUA1y8Ml+5bs8yIFNDQqOjeOlBr6A=",
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qml-common",
|
||||
"rev": "e268d71117173d0934dbe773d3e2ed6efe11afda",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-qml-common",
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qml-common",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"dank-qml-common_3": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1788376015,
|
||||
"narHash": "sha256-/tT8rTznLADndTwLBzdgzzgfJH1ZhYQibYo5v/F8U+U=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-qml-common",
|
||||
"rev": "26396ce432d6c71c3f5367438f96f4a8d667e160",
|
||||
"lastModified": 1795211080,
|
||||
"narHash": "sha256-PV5cT7st/9ioV5aHeNP0go7wFfHlKfBYVVRCQ8JkHXg=",
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qml-common",
|
||||
"rev": "12f5e4457e0ca14b6a5f9a283ab581ce28c92855",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-qml-common",
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qml-common",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"dankcalendar": {
|
||||
"inputs": {
|
||||
"dank-qml-common": "dank-qml-common_2",
|
||||
"dux-qt-base": "dux-qt-base_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789138010,
|
||||
"narHash": "sha256-f2moZqMyPxtmii/wWNihZ2Wyo/2krOnGiGuET7PbSqY=",
|
||||
"lastModified": 1795331423,
|
||||
"narHash": "sha256-kwm++EAyRfrgQAJVLR9LeSGiWbk7ehB64mJG17a4/hY=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dankcalendar",
|
||||
"rev": "22c0df043d050149cbaa6990cafacfeadfc3f921",
|
||||
"rev": "62ee9f656831be30dd3b58384758199a8e904637",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -118,11 +120,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1788455393,
|
||||
"narHash": "sha256-C9mVxnPCaA6mtz8H5GwMfBjOdhLRmXrpzcDc7z99iOo=",
|
||||
"lastModified": 1794282582,
|
||||
"narHash": "sha256-gZENm8lqgHN4UIg7pceXZEvYRy4UkbnW5cdsz2l1f3E=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "danksearch",
|
||||
"rev": "984f86e644a93d2a366d960e3c56233260a501de",
|
||||
"rev": "a25a7be5626ef4776a1600b1013583cff5ed71f9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -138,11 +140,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789138077,
|
||||
"narHash": "sha256-q7f+CiEu+YatKTSpaHGEeIj4N8YPI/MeVAq70bmtI3w=",
|
||||
"lastModified": 1794282582,
|
||||
"narHash": "sha256-7bQCy4e5cgj7ToGZmXjI4ksbmjxzK/Vi/ZUUiSuRhT4=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dgop",
|
||||
"rev": "bc726cad136cd81573d96af3e35ed2b767dc490f",
|
||||
"rev": "d91b45a6e1ef52ab3e7791286615759306477647",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -154,17 +156,18 @@
|
||||
"dms": {
|
||||
"inputs": {
|
||||
"dank-qml-common": "dank-qml-common_3",
|
||||
"dux-qt-base": "dux-qt-base_3",
|
||||
"flake-compat": "flake-compat",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789229382,
|
||||
"narHash": "sha256-jm04gSTS4GIYh59pReT/assmaitLIJo1v+yS96a0Xuk=",
|
||||
"lastModified": 1795342511,
|
||||
"narHash": "sha256-9cQ6VogdRRaf40wMBUip/EoufpSLnjNmosrijaYZwus=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "DankMaterialShell",
|
||||
"rev": "6b50696b8acc25e9fc6d12fe88d86060525c97f0",
|
||||
"rev": "a265f0a1af5dcc78ae691487d94710cca82da62d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -173,6 +176,69 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"dux-qt-base": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"dank-greeter",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1794899417,
|
||||
"narHash": "sha256-E5xQiepbIMlywIAFHGt3c4uBGUysNfdmL/mscCspXrs=",
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qt-base",
|
||||
"rev": "8a8c69406e75a797cf400ce151cc735ea2a02af1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qt-base",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"dux-qt-base_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"dankcalendar",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1795139910,
|
||||
"narHash": "sha256-JxBwcoR86CfjT92/xQSbbaHn1OxddwtH/iF+u4fUvRw=",
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qt-base",
|
||||
"rev": "75d4524dc5e678ca4b64a1f862dd7509ca6852b1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qt-base",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"dux-qt-base_3": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"dms",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1795337492,
|
||||
"narHash": "sha256-xGJDFNGgtXujSneISCrN2TxKx2IkTMeFBgTmJIISGfs=",
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qt-base",
|
||||
"rev": "0ea003e30fc92c51943ab7660b58d883708e25c2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qt-base",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@@ -214,11 +280,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789235087,
|
||||
"narHash": "sha256-6hZ6Gy8isRQsWdI4l81Egag/PUIh68nSmFr2maInUNg=",
|
||||
"lastModified": 1795340038,
|
||||
"narHash": "sha256-RtgZbV+4BDtJqMImbiPJri3fmVDbCbrz/B0cuPQUJQY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "fe48612c5321a2cc09b0f563757a9c9733d641f8",
|
||||
"rev": "03885bcd0b477bdecebebc57b213b0f8f0826d51",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -235,11 +301,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1788229478,
|
||||
"narHash": "sha256-G0F2rFORVcFkEvVdE/qWQTnYekIc77YP5/vRF9nZlxU=",
|
||||
"lastModified": 1794715309,
|
||||
"narHash": "sha256-awkBBs5ctFKgEYjpNGpi3t/VqF589n5EWfdinRb2gNI=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "1dc2d1f720ab17fc7981e087346bf54b26d284b1",
|
||||
"rev": "a1293da7dd8e497e08d26173f97e2976b36a31ea",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -248,13 +314,29 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"new-repo": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1792722922,
|
||||
"narHash": "sha256-g+6cdwq2KpzFoKKSCA+rN+fczgHPCr+isuwrGRsR4F4=",
|
||||
"owner": "kiskaadee",
|
||||
"repo": "new-repo",
|
||||
"rev": "e72b46a42e11115d64fa32ac53ddef459cb33d05",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "kiskaadee",
|
||||
"repo": "new-repo",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1789149629,
|
||||
"narHash": "sha256-eQUZVehWLDBbpBR2rq6DnuRee1ULT6Y675RhsYDSjYI=",
|
||||
"rev": "eaad089433ca2bb662274377d33df3d0e51ef28b",
|
||||
"lastModified": 1795234589,
|
||||
"narHash": "sha256-pAEASBc6wof0S58XcSEdZoQ2iFQDkCnZwH+wFLrkd1Q=",
|
||||
"rev": "2786a2a72088ecf32aea5b3ec52099e6a7cff78f",
|
||||
"type": "tarball",
|
||||
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1072397.eaad089433ca/nixexprs.tar.zst"
|
||||
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1125864.2786a2a72088/nixexprs.tar.zst"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
@@ -270,6 +352,7 @@
|
||||
"dgop": "dgop",
|
||||
"dms": "dms",
|
||||
"home-manager": "home-manager",
|
||||
"new-repo": "new-repo",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"zen-browser": "zen-browser"
|
||||
}
|
||||
@@ -297,11 +380,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789239533,
|
||||
"narHash": "sha256-x6LDRbyl+trEnwrFth2SAdDf8x4SM7DWcjmR2JUxtAg=",
|
||||
"lastModified": 1795333741,
|
||||
"narHash": "sha256-xJaT+L8DeMR0TJjAOlrjGqaRG2AjZrjivQfCtiLRtlY=",
|
||||
"owner": "0xc000022070",
|
||||
"repo": "zen-browser-flake",
|
||||
"rev": "b66d03970382d5185e040110b24ecb7a39df0e80",
|
||||
"rev": "81376950ac382a96b965f9d6f8bf60354ad99c2f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -48,15 +48,92 @@
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Antigravity CLI - coding companion and local AI agent helper
|
||||
# Antigravity Suite (CLI, Desktop GUI, IDE) - community flake providing automated updates
|
||||
antigravity = {
|
||||
url = "github:jacopone/antigravity-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# new-repo - Automated repository provisioning CLI across Gitea and GitHub
|
||||
new-repo = {
|
||||
url = "github:kiskaadee/new-repo";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
# --- System Outputs ---
|
||||
outputs = { self, nixpkgs, home-manager, dms, dgop, dank-greeter, dankcalendar, danksearch, zen-browser, antigravity, ... }@inputs: {
|
||||
outputs = { self, nixpkgs, home-manager, dms, dgop, dank-greeter, dankcalendar, danksearch, zen-browser, antigravity, ... }@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
# --- Linting, Formatting & Static Analysis Checks ---
|
||||
# Executed via `nix flake check` or `nix build .#checks.<system>.<check>`
|
||||
checks.${system} = {
|
||||
# Shell script linting via ShellCheck
|
||||
shellcheck = pkgs.runCommand "check-shellcheck" {
|
||||
nativeBuildInputs = [ pkgs.shellcheck ];
|
||||
} ''
|
||||
echo "🐚 [ShellCheck] Checking shell scripts..."
|
||||
find ${self} -type f -name "*.sh" -exec shellcheck -s bash {} +
|
||||
echo "✅ [ShellCheck] All shell scripts passed!"
|
||||
touch $out
|
||||
'';
|
||||
|
||||
# Lua linting via luacheck
|
||||
luacheck = pkgs.runCommand "check-luacheck" {
|
||||
nativeBuildInputs = [ pkgs.luaPackages.luacheck ];
|
||||
} ''
|
||||
echo "🌙 [Lua] Checking Neovim Lua configuration..."
|
||||
luacheck ${self}/home/config/nvim --globals vim
|
||||
echo "✅ [Lua] All Lua files passed!"
|
||||
touch $out
|
||||
'';
|
||||
|
||||
# Python linting via ruff
|
||||
ruff-lint = pkgs.runCommand "check-ruff-lint" {
|
||||
nativeBuildInputs = [ pkgs.ruff ];
|
||||
} ''
|
||||
echo "🐍 [Ruff] Running Python linter (ruff check)..."
|
||||
ruff check --no-cache ${self}
|
||||
echo "✅ [Ruff] All Python files passed linting!"
|
||||
touch $out
|
||||
'';
|
||||
|
||||
# Python formatting check via ruff
|
||||
ruff-format = pkgs.runCommand "check-ruff-format" {
|
||||
nativeBuildInputs = [ pkgs.ruff ];
|
||||
} ''
|
||||
echo "🎨 [Ruff] Checking Python formatting (ruff format)..."
|
||||
ruff format --check ${self}
|
||||
echo "✅ [Ruff] All Python files properly formatted!"
|
||||
touch $out
|
||||
'';
|
||||
|
||||
# Python static type analysis via pyright
|
||||
pyright = pkgs.runCommand "check-pyright" {
|
||||
nativeBuildInputs = [ pkgs.pyright ];
|
||||
} ''
|
||||
echo "🔬 [Pyright] Running Python type analysis..."
|
||||
pyright ${self}
|
||||
echo "✅ [Pyright] All Python type checks passed!"
|
||||
touch $out
|
||||
'';
|
||||
};
|
||||
|
||||
# Declarative dev shell for editing the configuration repository
|
||||
devShells.${system} = {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
shellcheck
|
||||
luaPackages.luacheck
|
||||
ruff
|
||||
pyright
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
# 💻 LAPTOP HOST (Mobile Workstation)
|
||||
laptop = nixpkgs.lib.nixosSystem {
|
||||
@@ -71,6 +148,9 @@
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.backupFileExtension = "backup";
|
||||
# ~/.ssh/config is kept as a user-owned regular file (see the
|
||||
# de-symlink workaround), so HM hits an occupied .backup path.
|
||||
home-manager.overwriteBackup = true;
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
home-manager.users.kiskaadee = {
|
||||
imports = [
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"key": "ctrl+space e",
|
||||
"command": "workbench.action.focusActiveEditorGroup"
|
||||
},
|
||||
{
|
||||
"key": "ctrl+space t",
|
||||
"command": "workbench.action.terminal.focus"
|
||||
},
|
||||
{
|
||||
"key": "ctrl+space c",
|
||||
"command": "antigravity.toggleChatFocus"
|
||||
},
|
||||
{
|
||||
"key": "ctrl+space f",
|
||||
"command": "workbench.view.explorer"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"workbench.colorTheme": "GitHub Dark Colorblind (Beta)",
|
||||
"terminal.integrated.fontFamily": "'FiraCode Nerd Font Mono', 'FiraCode Nerd Font', monospace",
|
||||
"editor.fontFamily": "'FiraCode Nerd Font', monospace",
|
||||
"editor.fontLigatures": true,
|
||||
"vim.useSystemClipboard": true,
|
||||
"vim.hlsearch": true,
|
||||
"terminal.integrated.allowChords": true,
|
||||
"terminal.integrated.commandsToSkipShell": [
|
||||
"workbench.action.focusActiveEditorGroup",
|
||||
"workbench.action.terminal.focus",
|
||||
"antigravity.toggleChatFocus",
|
||||
"workbench.view.explorer"
|
||||
]
|
||||
}
|
||||
@@ -231,6 +231,13 @@ animations {
|
||||
// Window rules let you adjust behavior for individual windows.
|
||||
// Find more information on the wiki:
|
||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
|
||||
|
||||
// Dim unfocused windows slightly for depth and focus awareness
|
||||
window-rule {
|
||||
match is-focused=false
|
||||
opacity 0.95
|
||||
}
|
||||
|
||||
// Work around WezTerm's initial configure bug
|
||||
// by setting an empty default-column-width.
|
||||
window-rule {
|
||||
@@ -281,6 +288,7 @@ window-rule {
|
||||
match app-id=r#"chromium|google-chrome|brave-browser"# title="^Picture in picture$"
|
||||
open-floating true
|
||||
default-floating-position x=20 y=20 relative-to="bottom-right"
|
||||
opacity 1.0
|
||||
}
|
||||
window-rule {
|
||||
match app-id="zoom"
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
|
||||
binds {
|
||||
// === Core Application Launchers ===
|
||||
Mod+Return hotkey-overlay-title="Alacritty Terminal" { spawn "alacritty"; }
|
||||
Mod+B hotkey-overlay-title="Firefox Browser" { spawn "firefox"; }
|
||||
Mod+O hotkey-overlay-title="Obsidian Notes" { spawn "flatpak" "run" "md.obsidian.Obsidian"; }
|
||||
Mod+Return hotkey-overlay-title="Alacritty Terminal (Shell)" { spawn "alacritty"; }
|
||||
Mod+T hotkey-overlay-title="Workspace Terminal (Sessionizer)" { spawn "alacritty" "-e" "tmux-sessionizer"; }
|
||||
Mod+B hotkey-overlay-title="Firefox Browser" { spawn "firefox"; }
|
||||
Mod+O hotkey-overlay-title="Obsidian Notes" { spawn "flatpak" "run" "md.obsidian.Obsidian"; }
|
||||
|
||||
// === Active Window Management ===
|
||||
// Force kill active window process via Niri IPC (JSON parsed)
|
||||
@@ -43,6 +44,16 @@ binds {
|
||||
Mod+Alt+M hotkey-overlay-title="Cast: Target Focused Monitor" { set-dynamic-cast-monitor; }
|
||||
Mod+Alt+C hotkey-overlay-title="Cast: Clear Target" { clear-dynamic-cast-target; }
|
||||
|
||||
// === Monitor Navigation (Orientation-Agnostic & Directional) ===
|
||||
Mod+grave hotkey-overlay-title="Focus Next Monitor" { focus-monitor-next; }
|
||||
Mod+Shift+grave hotkey-overlay-title="Move Column to Next Monitor" { move-column-to-monitor-next; }
|
||||
Mod+Ctrl+Down hotkey-overlay-title="Focus Monitor Down" { focus-monitor-down; }
|
||||
Mod+Ctrl+Up hotkey-overlay-title="Focus Monitor Up" { focus-monitor-up; }
|
||||
|
||||
// === Workspace Movement Relocation ===
|
||||
Mod+Ctrl+Page_Down hotkey-overlay-title="Move Column to Workspace Down" { move-column-to-workspace-down; }
|
||||
Mod+Ctrl+Page_Up hotkey-overlay-title="Move Column to Workspace Up" { move-column-to-workspace-up; }
|
||||
|
||||
// === Config Management ===
|
||||
Mod+Ctrl+Shift+R hotkey-overlay-title="Reload Niri Config" {
|
||||
spawn "bash" "-c" "niri msg action load-config-file && notify-send -a 'Niri' 'Configuration' 'Niri config reloaded successfully'";
|
||||
|
||||
@@ -44,6 +44,14 @@ if vim.lsp.config then
|
||||
root_markers = { '.git' },
|
||||
})
|
||||
vim.lsp.enable('kdl_lsp')
|
||||
|
||||
-- HTML LSP: vscode-html-language-server
|
||||
vim.lsp.config('html', {})
|
||||
vim.lsp.enable('html')
|
||||
|
||||
-- XML LSP: LemMinX
|
||||
vim.lsp.config('lemminx', {})
|
||||
vim.lsp.enable('lemminx')
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -111,6 +111,11 @@
|
||||
"binary": {
|
||||
"path_lookup": true
|
||||
}
|
||||
},
|
||||
"vscode-html-language-server": {
|
||||
"binary": {
|
||||
"path_lookup": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"languages": {
|
||||
|
||||
@@ -17,9 +17,17 @@ in
|
||||
# Modern Web Browser
|
||||
inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default
|
||||
|
||||
# AI Assistants & Desktop GUI
|
||||
inputs.antigravity.packages.${pkgs.stdenv.hostPlatform.system}.google-antigravity
|
||||
inputs.antigravity.packages.${pkgs.stdenv.hostPlatform.system}.google-antigravity-ide
|
||||
opencode-desktop
|
||||
|
||||
# Graphical Applications & Editors
|
||||
anydesk
|
||||
zed-editor
|
||||
obsidian
|
||||
kdePackages.okular
|
||||
inkscape
|
||||
libreoffice
|
||||
nautilus
|
||||
yazi
|
||||
@@ -27,6 +35,8 @@ in
|
||||
gimp
|
||||
imagemagick
|
||||
eyed3
|
||||
ffmpeg
|
||||
mkvtoolnix
|
||||
|
||||
# Wayland Clipboard, Screenshot & Screen Capture Utilities
|
||||
wl-clipboard
|
||||
@@ -57,6 +67,29 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
# Visual Studio Code declarative configuration
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
vscodevim.vim
|
||||
];
|
||||
};
|
||||
argvSettings = {
|
||||
"enable-crash-reporter" = true;
|
||||
"password-store" = "gnome-libsecret";
|
||||
};
|
||||
};
|
||||
|
||||
# GTK & Icon Theme Configuration
|
||||
gtk = {
|
||||
enable = true;
|
||||
iconTheme = {
|
||||
name = "Adwaita";
|
||||
package = pkgs.adwaita-icon-theme;
|
||||
};
|
||||
};
|
||||
|
||||
# Declarative configuration files for Zed editor
|
||||
home.file.".config/zed/settings.json".source = ./config/zed/settings.json;
|
||||
home.file.".config/zed/themes".source = ./config/zed/themes;
|
||||
@@ -65,6 +98,10 @@ in
|
||||
home.file.".config/niri/config.kdl".source = ./config/niri/config.kdl;
|
||||
home.file.".config/niri/custom.kdl".source = ./config/niri/custom.kdl;
|
||||
|
||||
# Declarative configuration files for Antigravity IDE
|
||||
home.file.".antigravity-ide/User/settings.json".source = ./config/antigravity-ide/settings.json;
|
||||
home.file.".antigravity-ide/User/keybindings.json".source = ./config/antigravity-ide/keybindings.json;
|
||||
|
||||
# Systemd user session target for Niri window manager
|
||||
|
||||
systemd.user.targets.niri-session = {
|
||||
|
||||
+136
-8
@@ -3,6 +3,89 @@
|
||||
|
||||
{ inputs, pkgs, ... }:
|
||||
|
||||
let
|
||||
symposium = pkgs.stdenv.mkDerivation rec {
|
||||
pname = "symposium";
|
||||
version = "0.5.1";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/symposium-dev/symposium/releases/download/symposium-v${version}/cargo-agents-x86_64-unknown-linux-musl.tar.gz";
|
||||
hash = "sha256-/YhTLS/Rmp4tx6xhL/awYDAiebH9+4dssfL0lRmtzHk=";
|
||||
};
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
installPhase = ''
|
||||
install -Dm755 cargo-agents $out/bin/cargo-agents
|
||||
ln -s $out/bin/cargo-agents $out/bin/symposium
|
||||
'';
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "Collaborative AI toolset for Rust projects (cargo-agents)";
|
||||
homepage = "https://symposium.dev";
|
||||
license = with licenses; [ mit asl20 ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
mainProgram = "cargo-agents";
|
||||
};
|
||||
};
|
||||
|
||||
hostinger-cli = pkgs.stdenv.mkDerivation rec {
|
||||
pname = "hostinger-cli";
|
||||
version = "4.1.4";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/hostinger/api-cli/releases/download/v${version}/hostinger-${version}-linux-amd64.tar.gz";
|
||||
hash = "sha256-DGliGk9wuSnf2HbCkQDcEbSv1TWmV9W4Jw7LWqCcj4E=";
|
||||
};
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
installPhase = ''
|
||||
install -Dm755 hostinger $out/bin/hostinger
|
||||
install -Dm644 completions/hostinger.bash $out/share/bash-completion/completions/hostinger
|
||||
'';
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "Official Hostinger API Command Line Interface";
|
||||
homepage = "https://github.com/hostinger/api-cli";
|
||||
license = licenses.mit;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
mainProgram = "hostinger";
|
||||
};
|
||||
};
|
||||
|
||||
gitea-cli = pkgs.stdenv.mkDerivation rec {
|
||||
pname = "gitea-cli";
|
||||
version = "1.0.0";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://gitea.com/gitea/cli/releases/download/v${version}/gitea-cli-${version}-linux-amd64";
|
||||
hash = "sha256-f/q+QV0F380YtJfVe0nIJHZLq5vvCUrPiQyWRZNsM8E=";
|
||||
};
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
nativeBuildInputs = [ pkgs.installShellFiles ];
|
||||
|
||||
installPhase = ''
|
||||
install -Dm755 $src $out/bin/gt
|
||||
|
||||
# Generate and install shell completions
|
||||
installShellCompletion --cmd gt \
|
||||
--bash <($out/bin/gt completion bash) \
|
||||
--fish <($out/bin/gt completion fish) \
|
||||
--zsh <($out/bin/gt completion zsh)
|
||||
'';
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "Official command-line tool for Gitea (successor to tea)";
|
||||
homepage = "https://gitea.com/gitea/cli";
|
||||
license = licenses.mit;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
mainProgram = "gt";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
# Neovim CLI & IDE Editor Configuration
|
||||
programs.neovim = {
|
||||
@@ -53,8 +136,15 @@
|
||||
|
||||
# Developer packages & Toolchains
|
||||
home.packages = with pkgs; [
|
||||
# AI Assistant Companion
|
||||
# AI Assistant Companion & Agent Orchestration
|
||||
inputs.antigravity.packages.${pkgs.stdenv.hostPlatform.system}.google-antigravity-cli
|
||||
herdr
|
||||
graphify
|
||||
codex
|
||||
opencode
|
||||
bubblewrap # Unprivileged sandboxing tool
|
||||
pi-coding-agent
|
||||
symposium
|
||||
|
||||
# Rust Toolchain & Language Server
|
||||
cargo
|
||||
@@ -64,29 +154,34 @@
|
||||
rust-analyzer
|
||||
gcc
|
||||
|
||||
# Python Toolchain & Language Server
|
||||
python3
|
||||
# Python Package Runner & Toolchain (LSPs/linters managed per-project)
|
||||
(python3.withPackages (ps: [
|
||||
ps.pyyaml
|
||||
]))
|
||||
uv
|
||||
ruff
|
||||
mypy
|
||||
pyright
|
||||
|
||||
# Node.js, Web & Formatter Tooling
|
||||
nodejs
|
||||
prettier
|
||||
|
||||
# Language Servers (Zed, Neovim, General)
|
||||
# Language Servers, Linters & Diagnostics (Zed, Neovim, General)
|
||||
nil
|
||||
nixd
|
||||
jdt-language-server
|
||||
typescript-language-server
|
||||
lua-language-server
|
||||
luaPackages.luacheck
|
||||
taplo
|
||||
marksman
|
||||
shellcheck
|
||||
vscode-langservers-extracted
|
||||
lemminx
|
||||
|
||||
# Cloud CLI, Git Forge & Database Management
|
||||
tea # Gitea official CLI client
|
||||
gitea-cli # Gitea official CLI client (gt, successor to tea)
|
||||
google-cloud-sdk # GCP administration utilities
|
||||
flarectl # Cloudflare official CLI client
|
||||
hostinger-cli # Hostinger official API CLI
|
||||
turso-cli # Turso libSQL management CLI
|
||||
postgresql # PostgreSQL client utilities (psql, pg_dump)
|
||||
pgcli # Postgres client with auto-completion
|
||||
@@ -97,6 +192,7 @@
|
||||
websocat # WebSocket client
|
||||
grpcurl # gRPC command-line tool
|
||||
bind.dnsutils # DNS lookup tools (dig, nslookup)
|
||||
doggo # Modern, human-friendly DNS client with DoH/DoT
|
||||
openssh # SSH client tools
|
||||
sshfs # FUSE-based SSH filesystem mount
|
||||
nmap # Network scanner
|
||||
@@ -119,6 +215,8 @@
|
||||
sqlite
|
||||
bc
|
||||
qpdf
|
||||
poppler-utils
|
||||
pandoc
|
||||
tty-clock
|
||||
curl
|
||||
parallel
|
||||
@@ -129,4 +227,34 @@
|
||||
sops # Mozilla SOPS CLI
|
||||
age # File encryption tool
|
||||
];
|
||||
|
||||
# Background two-way sync for corazoncp shared Google Drive repository
|
||||
systemd.user.services.corazoncp-drive-sync = {
|
||||
Unit = {
|
||||
Description = "Two-way sync between corazoncp/drive and Google Drive";
|
||||
After = [ "network-online.target" "graphical-session.target" ];
|
||||
Wants = [ "network-online.target" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.bash}/bin/bash /home/kiskaadee/Projects/active/corazoncp/drive/sync-drive.sh";
|
||||
Environment = [
|
||||
"PATH=${pkgs.lib.makeBinPath [ pkgs.rclone pkgs.git pkgs.openssh pkgs.libnotify pkgs.util-linux pkgs.findutils pkgs.coreutils ]}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers.corazoncp-drive-sync = {
|
||||
Unit = {
|
||||
Description = "Poll corazoncp shared Google Drive every 15 minutes";
|
||||
};
|
||||
Timer = {
|
||||
OnBootSec = "2m";
|
||||
OnUnitActiveSec = "15m";
|
||||
Persistent = true;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -114,8 +114,7 @@ def main() -> None:
|
||||
"""
|
||||
parser = argparse.ArgumentParser(
|
||||
description=(
|
||||
"Bundle a directory structure and its files into "
|
||||
"a single text document."
|
||||
"Bundle a directory structure and its files into a single text document."
|
||||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
|
||||
Executable
+75
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env bash
|
||||
# 🌐 Cloudflare DDNS Quick Updater for roadtotech.me
|
||||
|
||||
ZONE="roadtotech.me"
|
||||
TARGET_RECORDS=("roadtotech.me" "mail.roadtotech.me")
|
||||
|
||||
# 1. Load Cloudflare credentials via SOPS if not already present in environment
|
||||
if [[ -z "${CF_API_TOKEN:-}" ]]; then
|
||||
secrets_file="${HOME}/Config/secrets.yaml"
|
||||
if [[ -f "${secrets_file}" ]] && command -v sops >/dev/null 2>&1; then
|
||||
CF_API_TOKEN="$(sops -d --extract '["cloudflare"]["api_token"]' "${secrets_file}")"
|
||||
export CF_API_TOKEN
|
||||
CF_ACCOUNT_ID="$(sops -d --extract '["cloudflare"]["account_id"]' "${secrets_file}")"
|
||||
export CF_ACCOUNT_ID
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "${CF_API_TOKEN:-}" ]]; then
|
||||
echo "Error: CF_API_TOKEN is not set and could not be extracted from secrets.yaml." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 2. Determine target public WAN IP
|
||||
if [[ -n "${1:-}" ]]; then
|
||||
NEW_IP="$1"
|
||||
echo "Using manually specified IP: ${NEW_IP}"
|
||||
else
|
||||
echo "Detecting current public WAN IP..."
|
||||
NEW_IP="$(curl -s --max-time 5 https://api.ipify.org || curl -s --max-time 5 https://icanhazip.com || true)"
|
||||
NEW_IP="$(echo "${NEW_IP}" | tr -d '[:space:]')"
|
||||
echo "Detected WAN IP: ${NEW_IP}"
|
||||
fi
|
||||
|
||||
# Validate IPv4 format
|
||||
if [[ ! "${NEW_IP}" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then
|
||||
echo "Error: Invalid IPv4 address '${NEW_IP}'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 3. Query Cloudflare for existing records
|
||||
echo "Fetching active DNS records for ${ZONE}..."
|
||||
DNS_JSON="$(flarectl --json dns list --zone "${ZONE}")"
|
||||
|
||||
# 4. Iterate and update target A records
|
||||
UPDATED=0
|
||||
for RECORD_NAME in "${TARGET_RECORDS[@]}"; do
|
||||
RECORD_INFO="$(echo "${DNS_JSON}" | jq -r --arg name "${RECORD_NAME}" '.[] | select(.Name == $name and .Type == "A")')"
|
||||
|
||||
if [[ -z "${RECORD_INFO}" ]]; then
|
||||
echo "Warning: Record '${RECORD_NAME}' (Type A) not found in zone ${ZONE}." >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
RECORD_ID="$(echo "${RECORD_INFO}" | jq -r '.ID')"
|
||||
CURRENT_IP="$(echo "${RECORD_INFO}" | jq -r '.Content')"
|
||||
|
||||
if [[ "${CURRENT_IP}" == "${NEW_IP}" ]]; then
|
||||
echo "✓ ${RECORD_NAME} is already up to date (${CURRENT_IP})."
|
||||
else
|
||||
echo "Updating ${RECORD_NAME}: ${CURRENT_IP} -> ${NEW_IP}..."
|
||||
flarectl dns update --zone "${ZONE}" --id "${RECORD_ID}" --content "${NEW_IP}"
|
||||
echo "✓ ${RECORD_NAME} updated successfully."
|
||||
UPDATED=1
|
||||
fi
|
||||
done
|
||||
|
||||
# 5. Verification
|
||||
if [[ "${UPDATED}" -eq 1 ]]; then
|
||||
echo "Verifying resolution on Cloudflare nameservers..."
|
||||
sleep 2
|
||||
RESOLVED_IP="$(dig @pam.ns.cloudflare.com "${ZONE}" +short | tail -n1)"
|
||||
echo "Authoritative pam.ns.cloudflare.com resolves ${ZONE} -> ${RESOLVED_IP}"
|
||||
fi
|
||||
|
||||
echo "Done."
|
||||
@@ -0,0 +1,187 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Declarative workspace roots
|
||||
EXPLICIT_WORKSPACES=(
|
||||
"$HOME/Config"
|
||||
"$HOME/Brain"
|
||||
"$HOME/Homelab/Core"
|
||||
)
|
||||
|
||||
DISCOVERY_ROOTS=(
|
||||
"$HOME/Projects"
|
||||
"$HOME/Homelab"
|
||||
)
|
||||
|
||||
# Normalize folder basename to a valid, deterministic tmux session name
|
||||
normalize_name() {
|
||||
local raw="$1"
|
||||
local name
|
||||
name=$(basename "$raw" | tr '[:upper:]' '[:lower:]' | sed -E 's/[ .]+/-/g; s/[^a-z0-9_-]//g; s/[-_]+$//')
|
||||
if [[ -z "$name" ]]; then
|
||||
echo "ERROR: normalized session name for '$raw' is empty" >&2
|
||||
return 1
|
||||
fi
|
||||
echo "$name"
|
||||
}
|
||||
|
||||
# Discover all registered and git-backed workspaces
|
||||
# Outputs tab-separated: <session_name>\t<absolute_path>
|
||||
get_projects() {
|
||||
local -A seen_paths=()
|
||||
|
||||
# 1. Explicit workspaces
|
||||
for ws in "${EXPLICIT_WORKSPACES[@]}"; do
|
||||
if [[ -d "$ws" ]]; then
|
||||
seen_paths["$ws"]=1
|
||||
fi
|
||||
done
|
||||
|
||||
# 2. Discovered git repos under existing roots
|
||||
for root in "${DISCOVERY_ROOTS[@]}"; do
|
||||
[[ -d "$root" ]] || continue
|
||||
while IFS= read -r gitdir; do
|
||||
local pdir
|
||||
pdir=$(dirname "$gitdir")
|
||||
seen_paths["$pdir"]=1
|
||||
done < <(fd -H -d 4 -t d '^\.git$' "$root" 2>/dev/null)
|
||||
done
|
||||
|
||||
# 3. Format output
|
||||
for dir in "${!seen_paths[@]}"; do
|
||||
local sname
|
||||
if sname=$(normalize_name "$dir" 2>/dev/null); then
|
||||
printf "%s\t%s\n" "$sname" "$dir"
|
||||
fi
|
||||
done | sort -k1,1
|
||||
}
|
||||
|
||||
# Ensure the workspace registry has zero session-name collisions
|
||||
validate_registry() {
|
||||
local registry="$1"
|
||||
local collisions
|
||||
collisions=$(printf "%s\n" "$registry" | awk -F'\t' '
|
||||
{
|
||||
count[$1]++
|
||||
paths[$1] = paths[$1] "\n " $2
|
||||
}
|
||||
END {
|
||||
for (s in count) {
|
||||
if (count[s] > 1) {
|
||||
printf "ERROR: workspace name collision: '\''%s'\''%s\n\n", s, paths[s]
|
||||
}
|
||||
}
|
||||
}
|
||||
')
|
||||
|
||||
if [[ -n "$collisions" ]]; then
|
||||
printf "%s" "$collisions" >&2
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# Resolve target directory and session name from arguments or interactive selection
|
||||
resolve_workspace() {
|
||||
local projects
|
||||
projects=$(get_projects)
|
||||
validate_registry "$projects" || exit 1
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
local selected
|
||||
selected=$(printf "%s\n" "$projects" | fzf \
|
||||
--delimiter=$'\t' \
|
||||
--with-nth=1,2 \
|
||||
--prompt="Workspace > " \
|
||||
--height=40% \
|
||||
--reverse || true)
|
||||
|
||||
if [[ -z "$selected" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "$selected"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local query="$1"
|
||||
|
||||
# 1. Existing directory path
|
||||
if [[ -d "$query" ]]; then
|
||||
local abs_path sname
|
||||
abs_path=$(realpath "$query")
|
||||
sname=$(normalize_name "$abs_path") || exit 1
|
||||
printf "%s\t%s\n" "$sname" "$abs_path"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# 2. Exact session name match
|
||||
local exact exact_cnt
|
||||
exact=$(printf "%s\n" "$projects" | awk -F'\t' -v q="$query" 'tolower($1) == tolower(q)')
|
||||
exact_cnt=$(printf "%s\n" "$exact" | grep -c -v "^$" || true)
|
||||
if [[ "$exact_cnt" -eq 1 ]]; then
|
||||
echo "$exact"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# 3. Exact basename match
|
||||
local base_matches base_cnt query_base
|
||||
query_base=$(basename "$query" | tr '[:upper:]' '[:lower:]')
|
||||
base_matches=$(printf "%s\n" "$projects" | awk -F'\t' -v q="$query_base" '
|
||||
{
|
||||
n = split($2, parts, "/")
|
||||
if (tolower(parts[n]) == q) print $0
|
||||
}
|
||||
')
|
||||
base_cnt=$(printf "%s\n" "$base_matches" | grep -c -v "^$" || true)
|
||||
if [[ "$base_cnt" -eq 1 ]]; then
|
||||
echo "$base_matches"
|
||||
return 0
|
||||
elif [[ "$base_cnt" -gt 1 ]]; then
|
||||
echo "ERROR: ambiguous project basename '$query':" >&2
|
||||
printf "%s\n" "$base_matches" | awk -F'\t' '{print " " $2}' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 4. Unique Substring Match
|
||||
local sub_matches sub_cnt query_lower
|
||||
query_lower=$(echo "$query" | tr '[:upper:]' '[:lower:]')
|
||||
sub_matches=$(printf "%s\n" "$projects" | awk -F'\t' -v q="$query_lower" '
|
||||
index(tolower($1), q) || index(tolower($2), q)
|
||||
')
|
||||
sub_cnt=$(printf "%s\n" "$sub_matches" | grep -c -v "^$" || true)
|
||||
if [[ "$sub_cnt" -eq 1 ]]; then
|
||||
echo "$sub_matches"
|
||||
return 0
|
||||
elif [[ "$sub_cnt" -gt 1 ]]; then
|
||||
echo "ERROR: ambiguous match for '$query' (multiple candidates found):" >&2
|
||||
printf "%s\n" "$sub_matches" | awk -F'\t' '{printf " %-20s %s\n", $1, $2}' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "ERROR: no workspace found matching '$query'" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
main() {
|
||||
local target
|
||||
target=$(resolve_workspace "$@")
|
||||
[[ -z "$target" ]] && exit 0
|
||||
|
||||
local session_name target_dir
|
||||
IFS=$'\t' read -r session_name target_dir <<< "$target"
|
||||
|
||||
# Ensure session exists (initialize cwd only on creation)
|
||||
if ! tmux has-session -t "$session_name" 2>/dev/null; then
|
||||
tmux new-session -ds "$session_name" -c "$target_dir"
|
||||
fi
|
||||
|
||||
# Attach or switch client based on current context
|
||||
if [[ -z "${TMUX:-}" ]]; then
|
||||
exec tmux attach-session -t "$session_name"
|
||||
else
|
||||
tmux switch-client -t "$session_name"
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Executable
+177
@@ -0,0 +1,177 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 🎙️ Whisper Audio Message Transcriber
|
||||
# Fast, local, offline audio transcription using whisper-cpp and ffmpeg.
|
||||
# Optimised for voice messages (.ogg, .opus, .m4a, .mp3, .wav).
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
show_help() {
|
||||
cat << 'EOF'
|
||||
Usage: transcribe [OPTIONS] <audio-file> [audio-file2 ...]
|
||||
|
||||
Transcribes audio recordings into plain text using local whisper.cpp.
|
||||
|
||||
Options:
|
||||
-c, --clip, --clipboard Copy transcription result to Wayland clipboard (wl-copy)
|
||||
-s, --save Save transcript alongside audio file as <filename>.txt
|
||||
-m, --model <name> Whisper model size (default: small, ~488MB)
|
||||
Options: tiny, base, small, medium, large-v3-turbo
|
||||
-l, --lang <code|auto> Spoken language (e.g. en, es, auto; default: auto)
|
||||
-t, --threads <num> Computation threads (default: CPU core count)
|
||||
-q, --quiet Suppress informational messages to stderr
|
||||
-h, --help Show this help message and exit
|
||||
|
||||
Examples:
|
||||
transcribe voice_note.ogg
|
||||
transcribe -c memo.m4a
|
||||
transcribe -s -l es recording.opus
|
||||
EOF
|
||||
}
|
||||
|
||||
MODEL="${TRANSCRIBE_MODEL:-small}"
|
||||
LANG="${TRANSCRIBE_LANG:-auto}"
|
||||
CLIP=0
|
||||
SAVE=0
|
||||
QUIET=0
|
||||
THREADS="$(nproc 2>/dev/null || echo 4)"
|
||||
|
||||
# Parse CLI options
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-c|--clip|--clipboard)
|
||||
CLIP=1
|
||||
shift
|
||||
;;
|
||||
-s|--save)
|
||||
SAVE=1
|
||||
shift
|
||||
;;
|
||||
-m|--model)
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Error: --model requires an argument" >&2
|
||||
exit 1
|
||||
fi
|
||||
MODEL="$2"
|
||||
shift 2
|
||||
;;
|
||||
-l|--lang|--language)
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Error: --language requires an argument" >&2
|
||||
exit 1
|
||||
fi
|
||||
LANG="$2"
|
||||
shift 2
|
||||
;;
|
||||
-t|--threads)
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Error: --threads requires an argument" >&2
|
||||
exit 1
|
||||
fi
|
||||
THREADS="$2"
|
||||
shift 2
|
||||
;;
|
||||
-q|--quiet)
|
||||
QUIET=1
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-*)
|
||||
echo "Unknown option: $1" >&2
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Error: No audio files provided." >&2
|
||||
show_help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MODEL_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/whisper-cpp/models"
|
||||
MODEL_FILE="$MODEL_DIR/ggml-${MODEL}.bin"
|
||||
|
||||
# Auto-download model on first run if missing
|
||||
if [ ! -f "$MODEL_FILE" ]; then
|
||||
if [ "$QUIET" -eq 0 ]; then
|
||||
echo "Model 'ggml-${MODEL}.bin' not found in $MODEL_DIR." >&2
|
||||
echo "Downloading model '${MODEL}'..." >&2
|
||||
fi
|
||||
mkdir -p "$MODEL_DIR"
|
||||
whisper-cpp-download-ggml-model "$MODEL" "$MODEL_DIR"
|
||||
fi
|
||||
|
||||
# Set up temporary working directory for 16kHz audio normalization
|
||||
TEMP_DIR="$(mktemp -d -t transcribe-XXXXXX)"
|
||||
cleanup() {
|
||||
rm -rf "$TEMP_DIR"
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
ALL_OUTPUT=""
|
||||
|
||||
for input_file in "$@"; do
|
||||
if [ ! -f "$input_file" ]; then
|
||||
echo "Warning: File '$input_file' not found, skipping." >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
TEMP_WAV="$TEMP_DIR/converted_$(basename "$input_file").wav"
|
||||
|
||||
# Normalize audio to 16kHz mono 16-bit PCM WAV (Whisper specification)
|
||||
if ! ffmpeg -hide_banner -loglevel error -y -i "$input_file" -ar 16000 -ac 1 -c:a pcm_s16le "$TEMP_WAV"; then
|
||||
echo "Error: Failed to process audio file '$input_file' with ffmpeg." >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
# Run whisper-cli
|
||||
RAW_TRANSCRIPT="$(whisper-cli -m "$MODEL_FILE" -f "$TEMP_WAV" -l "$LANG" -t "$THREADS" -nt -np)"
|
||||
|
||||
# Clean transcript: strip leading whitespace from segments
|
||||
CLEAN_TRANSCRIPT="$(echo "$RAW_TRANSCRIPT" | sed -e 's/^[[:space:]]*//' | sed -e '/^[[:space:]]*$/d')"
|
||||
|
||||
# Print to stdout
|
||||
printf "%s\n" "$CLEAN_TRANSCRIPT"
|
||||
|
||||
# Optional: Save next to original audio file
|
||||
if [ "$SAVE" -eq 1 ]; then
|
||||
OUT_TXT="${input_file%.*}.txt"
|
||||
printf "%s\n" "$CLEAN_TRANSCRIPT" > "$OUT_TXT"
|
||||
if [ "$QUIET" -eq 0 ]; then
|
||||
echo "Saved transcript to: $OUT_TXT" >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$ALL_OUTPUT" ]; then
|
||||
ALL_OUTPUT="${ALL_OUTPUT}
|
||||
${CLEAN_TRANSCRIPT}"
|
||||
else
|
||||
ALL_OUTPUT="$CLEAN_TRANSCRIPT"
|
||||
fi
|
||||
|
||||
rm -f "$TEMP_WAV"
|
||||
done
|
||||
|
||||
# Optional: Copy accumulated transcript to clipboard
|
||||
if [ "$CLIP" -eq 1 ] && [ -n "$ALL_OUTPUT" ]; then
|
||||
if command -v wl-copy >/dev/null 2>&1; then
|
||||
printf "%s\n" "$ALL_OUTPUT" | wl-copy
|
||||
if [ "$QUIET" -eq 0 ]; then
|
||||
echo "Copied transcript to clipboard." >&2
|
||||
fi
|
||||
else
|
||||
echo "Warning: wl-copy not found, skipping clipboard copy." >&2
|
||||
fi
|
||||
fi
|
||||
+100
-7
@@ -1,9 +1,74 @@
|
||||
# 🐚 User Shell, Terminal Multiplexing & Git Environment
|
||||
# Bash aliases, modular shell scripts, Git, Delta, Gh, Direnv, SSH client, Tmux, Starship, and Fastfetch.
|
||||
|
||||
{ pkgs, ... }:
|
||||
{ inputs, pkgs, ... }:
|
||||
|
||||
let
|
||||
# Hermetic packaging for project-driven persistent terminal workspaces
|
||||
tmuxSessionizer = pkgs.writeShellApplication {
|
||||
name = "tmux-sessionizer";
|
||||
runtimeInputs = with pkgs; [
|
||||
bash
|
||||
coreutils
|
||||
gnused
|
||||
gawk
|
||||
gnugrep
|
||||
fd
|
||||
fzf
|
||||
tmux
|
||||
];
|
||||
text = builtins.readFile ./scripts/tmux-sessionizer.sh;
|
||||
};
|
||||
|
||||
# Declarative provisioning CLI packaged hermetically from remote flake input
|
||||
newRepo = pkgs.runCommand "new-repo" {
|
||||
nativeBuildInputs = [ pkgs.python3 ];
|
||||
} ''
|
||||
mkdir -p $out/bin
|
||||
cp ${inputs.new-repo}/new_repo.py $out/bin/new-repo
|
||||
chmod +x $out/bin/new-repo
|
||||
patchShebangs $out/bin/new-repo
|
||||
'';
|
||||
|
||||
# Hermetic packaging for local audio transcription via whisper-cpp
|
||||
transcribeCli = pkgs.writeShellApplication {
|
||||
name = "transcribe";
|
||||
runtimeInputs = with pkgs; [
|
||||
bash
|
||||
coreutils
|
||||
gnused
|
||||
gnugrep
|
||||
ffmpeg-headless
|
||||
whisper-cpp
|
||||
wl-clipboard
|
||||
curl
|
||||
];
|
||||
text = builtins.readFile ./scripts/transcribe.sh;
|
||||
};
|
||||
|
||||
# Quick manual/automation DDNS updater for Cloudflare homelab domain
|
||||
cfDdns = pkgs.writeShellApplication {
|
||||
name = "cf-ddns";
|
||||
runtimeInputs = with pkgs; [
|
||||
bash
|
||||
coreutils
|
||||
curl
|
||||
jq
|
||||
sops
|
||||
flarectl
|
||||
bind.dnsutils
|
||||
];
|
||||
text = builtins.readFile ./scripts/cf-ddns.sh;
|
||||
};
|
||||
in
|
||||
{
|
||||
home.packages = [
|
||||
tmuxSessionizer
|
||||
newRepo
|
||||
transcribeCli
|
||||
cfDdns
|
||||
];
|
||||
|
||||
programs = {
|
||||
# 🌟 Git Version Control Configuration
|
||||
git = {
|
||||
@@ -93,19 +158,21 @@
|
||||
enableDefaultConfig = false;
|
||||
settings = {
|
||||
"*" = {
|
||||
User = "kiskaadee";
|
||||
ServerAliveInterval = 15;
|
||||
ServerAliveCountMax = 3;
|
||||
};
|
||||
laptop = {
|
||||
HostName = "192.168.1.32";
|
||||
User = "kiskaadee";
|
||||
Port = 22;
|
||||
};
|
||||
server-local = {
|
||||
User = "operator";
|
||||
HostName = "192.168.1.36";
|
||||
Port = 22;
|
||||
};
|
||||
server-remote = {
|
||||
User = "operator";
|
||||
HostName = "roadtotech.me";
|
||||
Port = 2222;
|
||||
};
|
||||
@@ -114,6 +181,28 @@
|
||||
Port = 2223;
|
||||
User = "git";
|
||||
};
|
||||
"webos-tv" = {
|
||||
HostName = "192.168.1.11";
|
||||
User = "prisoner";
|
||||
Port = 9922;
|
||||
IdentityFile = "~/.ssh/webos_rsa";
|
||||
HostKeyAlgorithms = "+ssh-rsa";
|
||||
PubkeyAcceptedAlgorithms = "+ssh-rsa";
|
||||
};
|
||||
phone = {
|
||||
HostName = "192.168.1.46";
|
||||
User = "u0_a56";
|
||||
Port = 8022;
|
||||
IdentityFile = "~/.ssh/id_ed25519";
|
||||
IdentitiesOnly = true;
|
||||
};
|
||||
tablet = {
|
||||
HostName = "192.168.1.5";
|
||||
User = "u0_a259";
|
||||
Port = 8022;
|
||||
IdentityFile = "~/.ssh/id_ed25519";
|
||||
IdentitiesOnly = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -170,8 +259,12 @@
|
||||
|
||||
shellAliases = {
|
||||
zed = "zeditor";
|
||||
reload = "exec bash";
|
||||
reload = "exec $SHELL";
|
||||
ts = "tmux-sessionizer";
|
||||
check = "~/Config/scripts/test";
|
||||
nfc = "nix flake check -L";
|
||||
ff = "fastfetch --logo none";
|
||||
p3 = "python3";
|
||||
|
||||
# System Navigation
|
||||
".." = "cd ..";
|
||||
@@ -197,14 +290,11 @@
|
||||
# Network Diagnostics
|
||||
pgoog = "ping google.com -c 3";
|
||||
|
||||
# Python / Py5
|
||||
p5 = "uv run py5-run-sketch";
|
||||
p5w = "uv run watchfiles \"py5-run-sketch main.py\"";
|
||||
|
||||
# Editor Shorthand
|
||||
v = "nvim";
|
||||
clock = "tty-clock";
|
||||
ql = "quicklinks";
|
||||
sql-highlight = "bat --language=sql --style=plain";
|
||||
|
||||
# Interactive Jump helper
|
||||
zi = "zoxide query -i --preview 'eza --tree --level 2 --color=always {}'";
|
||||
@@ -220,6 +310,7 @@
|
||||
gfo = "git fetch origin";
|
||||
gcheck = "git checkout";
|
||||
gadc = "git add -A && git diff --staged | wl-copy";
|
||||
ght = "gh-token";
|
||||
};
|
||||
|
||||
# Inject modular shell helper scripts directly into .bashrc
|
||||
@@ -232,6 +323,7 @@
|
||||
${builtins.readFile ./shell/wayland.sh} # Wayland clipboard helper (wlc)
|
||||
${builtins.readFile ./shell/git.sh} # Git workflow automations (gacp, gitignore)
|
||||
${builtins.readFile ./shell/pdf.sh} # Command line PDF decryption helper
|
||||
${builtins.readFile ./shell/secrets.sh} # SOPS secret extraction helper (gh-token)
|
||||
${builtins.readFile ./shell/quicklinks.sh} # Interactive fzf web launcher
|
||||
${builtins.readFile ./shell/jump.sh} # Directory jumper & interactive fuzzy navigation
|
||||
${builtins.readFile ./shell/todo.sh} # Todo.txt & tuxedo shortcuts and syntax highlighter
|
||||
@@ -242,4 +334,5 @@
|
||||
|
||||
# Link fastfetch config
|
||||
home.file.".config/fastfetch/config.jsonc".source = ./config/fastfetch/config.jsonc;
|
||||
|
||||
}
|
||||
+7
-30
@@ -1,8 +1,8 @@
|
||||
# shellcheck shell=bash
|
||||
# 🌟 Custom Git Automation & Helper Utilities
|
||||
# Sourced in .bashrc to streamline gitignore modifications, commit-push workflows, and new repo setups.
|
||||
|
||||
# 1. gitignore: Quickly appends patterns to the repository's root .gitignore file
|
||||
# then automatically commits and pushes the change.
|
||||
# 1. gitignore: Quickly appends patterns to the repository's root .gitignore file.
|
||||
gitignore() {
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: gitignore <pattern> [pattern...]"
|
||||
@@ -10,7 +10,8 @@ gitignore() {
|
||||
fi
|
||||
|
||||
# Find the top-level repository directory path
|
||||
local GIT_ROOT=$(git rev-parse --show-toplevel 2> /dev/null)
|
||||
local GIT_ROOT
|
||||
GIT_ROOT=$(git rev-parse --show-toplevel 2> /dev/null)
|
||||
if [ -z "$GIT_ROOT" ]; then
|
||||
echo "Error: Not a Git repository."
|
||||
return 1
|
||||
@@ -28,7 +29,6 @@ gitignore() {
|
||||
fi
|
||||
|
||||
local added_count=0
|
||||
local commit_msg_list=""
|
||||
|
||||
for pattern in "$@"; do
|
||||
# Check if the pattern is already present in the .gitignore file
|
||||
@@ -38,18 +38,10 @@ gitignore() {
|
||||
echo "$pattern" >> "$GIT_IGNORE_FILE"
|
||||
echo "Added '$pattern'"
|
||||
((added_count++))
|
||||
commit_msg_list+="${pattern}, "
|
||||
fi
|
||||
done
|
||||
|
||||
# If any patterns were added, commit and push them automatically
|
||||
if [ $added_count -gt 0 ]; then
|
||||
commit_msg_list="${commit_msg_list%, }"
|
||||
echo "Committing and pushing changes..."
|
||||
git add "$GIT_IGNORE_FILE"
|
||||
git commit -m "Add to .gitignore: $commit_msg_list"
|
||||
git push
|
||||
else
|
||||
if [ "$added_count" -eq 0 ]; then
|
||||
echo "No new patterns were added."
|
||||
fi
|
||||
}
|
||||
@@ -63,24 +55,9 @@ gacp() {
|
||||
fi
|
||||
git add -A
|
||||
git commit -m "$1"
|
||||
local branch_name=$(git branch --show-current)
|
||||
local branch_name
|
||||
branch_name=$(git branch --show-current)
|
||||
git push origin "${branch_name}"
|
||||
echo "Pushed to origin/${branch_name}"
|
||||
}
|
||||
|
||||
# 3. new-repo: Initializes a new directory, git repository, and pushes it to GitHub via 'gh' CLI.
|
||||
new-repo() {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: new-repo <repository-name>"
|
||||
return 1
|
||||
fi
|
||||
local repo_name="$1"
|
||||
mkdir -p "$repo_name"
|
||||
cd "$repo_name" || return 1
|
||||
git init -b main
|
||||
echo "# $repo_name" > README.md
|
||||
touch .gitignore LICENSE
|
||||
git add -A && git commit -m "Initial commit"
|
||||
# Call the GitHub CLI tool to create the repository on GitHub
|
||||
gh repo create "$repo_name" --public --source=. --remote=origin --push
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
# shellcheck shell=bash
|
||||
# --- Word Deletion & Readline Keybindings ---
|
||||
if [[ -n "$BASH_VERSION" ]] && [[ "$-" == *i* ]]; then
|
||||
# Ctrl+W: Delete entire word under cursor (backward-word + kill-word)
|
||||
@@ -16,3 +17,27 @@ fi
|
||||
if [[ $- == *i* ]]; then
|
||||
fastfetch --logo none
|
||||
fi
|
||||
|
||||
# --- Nix Command Ergonomics ---
|
||||
# Ensure `nix flake check` always prints build and verification logs (-L),
|
||||
# and inject GitHub personal access token via NIX_CONFIG on-demand to prevent API rate limiting.
|
||||
nix() {
|
||||
local token=""
|
||||
if declare -F _get_nix_gh_token >/dev/null 2>&1; then
|
||||
token=$(_get_nix_gh_token)
|
||||
fi
|
||||
|
||||
if [[ -n "$token" ]]; then
|
||||
if [[ "${1:-}" == "flake" && "${2:-}" == "check" && "$*" != *"--log-format"* && "$*" != *"-L"* ]]; then
|
||||
NIX_CONFIG="access-tokens = github.com=${token}${NIX_CONFIG:+ $NIX_CONFIG}" command nix flake check -L "${@:3}"
|
||||
else
|
||||
NIX_CONFIG="access-tokens = github.com=${token}${NIX_CONFIG:+ $NIX_CONFIG}" command nix "$@"
|
||||
fi
|
||||
else
|
||||
if [[ "${1:-}" == "flake" && "${2:-}" == "check" && "$*" != *"--log-format"* && "$*" != *"-L"* ]]; then
|
||||
command nix flake check -L "${@:3}"
|
||||
else
|
||||
command nix "$@"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
+25
-9
@@ -1,13 +1,15 @@
|
||||
# shellcheck shell=bash
|
||||
# 🗺️ Fuzzy Navigation & Directory Jump Helpers
|
||||
# Sourced in .bashrc to provide quick, interactive folder traversal using Yazi and fzf.
|
||||
|
||||
# 1. fm: Interactive file manager wrapper using Yazi.
|
||||
# Synchronizes the active terminal shell working directory to Yazi's exit folder (sticky directory).
|
||||
fm() {
|
||||
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
|
||||
local tmp
|
||||
tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
cd -- "$cwd"
|
||||
cd -- "$cwd" || return
|
||||
fi
|
||||
rm -f -- "$tmp"
|
||||
}
|
||||
@@ -85,10 +87,24 @@ copy_dir() {
|
||||
printf "%s" "$dir" | wl-copy
|
||||
}
|
||||
|
||||
# 10. Shorthand Navigation Aliases
|
||||
cfg() { jump "$HOME/Config" "$1" 2; } # Quickly jump inside ~/Config modules
|
||||
prj() { jump "$HOME/Projects" "$1"; } # Jump into local workspace projects
|
||||
lrn() { jump "/$HOME/Learn" "$1"; } # Jump to ~/Learn
|
||||
dep() { jump "$HOME/Deployments" "$1"; } # Jump to Deployments folder
|
||||
dl() { jump "$HOME/Downloads" "$1"; } # Jump to Downloads
|
||||
med() { jump "/media" "$1"; } # Jump to /media mounted storage
|
||||
# 10. Shorthand Navigation Aliases (Dual 2-letter and mnemonic mapping)
|
||||
brain() { jump "$HOME/Brain" "$1" 2; } # Jump into ~/Brain
|
||||
homelab() { jump "$HOME/Homelab" "$1" 2; } # Jump into ~/Homelab
|
||||
conf() { jump "$HOME/Config" "$1" 2; } # Jump into ~/Config
|
||||
doc() { jump "$HOME/Documents" "$1" 2; } # Jump into ~/Documents
|
||||
dl() { jump "$HOME/Downloads" "$1" 2; } # Jump into ~/Downloads
|
||||
pic() { jump "$HOME/Pictures" "$1" 2; } # Jump into ~/Pictures
|
||||
pj() { jump "$HOME/Projects" "$1" 3; } # Jump into ~/Projects (depth 3)
|
||||
|
||||
# 2-Letter Fast Aliases
|
||||
br() { brain "$@"; }
|
||||
cf() { conf "$@"; }
|
||||
dc() { doc "$@"; }
|
||||
pc() { pic "$@"; }
|
||||
hl() { homelab "$@"; }
|
||||
|
||||
# Convenience & Backward-Compatibility Aliases
|
||||
docs() { doc "$@"; }
|
||||
pict() { pic "$@"; }
|
||||
cfg() { conf "$@"; }
|
||||
prj() { pj "$@"; }
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
# shellcheck shell=bash
|
||||
# 📄 Command Line PDF Utilities
|
||||
# Sourced in .bashrc to provide quick file operations on PDF documents.
|
||||
|
||||
@@ -30,7 +31,7 @@ pdf_dc() {
|
||||
# Handle file overwrite prompts
|
||||
if [[ -f "$output_file" ]]; then
|
||||
echo "Error: Output file '$output_file' already exists."
|
||||
read -p "Do you want to overwrite it? (y/n): " overwrite
|
||||
read -r -p "Do you want to overwrite it? (y/n): " overwrite
|
||||
if [[ "$overwrite" != "y" ]]; then
|
||||
echo "Operation cancelled."
|
||||
return 1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# shellcheck shell=bash
|
||||
# 🚀 Quicklinks Launcher Utility
|
||||
# Sourced in .bashrc to provide an interactive bookmarks and command-launcher interface.
|
||||
# Parses a pipe-separated config file (`~/.quicklinks`) containing custom CLI commands or URLs.
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
# shellcheck shell=bash
|
||||
# 🔐 Secret Extraction & Clipboard Utilities
|
||||
# Sourced in .bashrc to provide quick, safe extraction of SOPS-managed secrets into the Wayland clipboard.
|
||||
|
||||
# 1. gh-token: Extracts the GitHub repository token from Homelab secrets directly into the Wayland clipboard.
|
||||
# Uses 'sops -d --extract' to decrypt only the required key in memory without persisting plaintext to disk.
|
||||
# Uses 'wl-copy -n --sensitive' to strip trailing newlines and flag the content as sensitive for clipboard managers.
|
||||
gh-token() {
|
||||
local secrets_file="${HOMELAB_SECRETS_FILE:-$HOME/Homelab/Core/nixos/secrets.yaml}"
|
||||
|
||||
if ! command -v sops >/dev/null 2>&1; then
|
||||
echo "Error: 'sops' is not installed or not in PATH." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! command -v wl-copy >/dev/null 2>&1; then
|
||||
echo "Error: 'wl-copy' is not installed or not in PATH." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ ! -f "$secrets_file" ]]; then
|
||||
echo "Error: Secrets file not found at '$secrets_file'." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
local token
|
||||
token=$(sops -d --extract '["system"]["gh_repo_token"]' "$secrets_file" 2>/dev/null)
|
||||
local status=$?
|
||||
|
||||
if [[ $status -ne 0 || -z "$token" ]]; then
|
||||
echo "Error: Failed to extract 'system.gh_repo_token' from sops." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
printf "%s" "$token" | wl-copy -n --sensitive
|
||||
unset token
|
||||
|
||||
echo "GitHub repo token copied to clipboard (marked sensitive)."
|
||||
}
|
||||
|
||||
|
||||
flarectl() {
|
||||
local secrets_file="$HOME/Config/secrets.yaml"
|
||||
if [[ -f "$secrets_file" ]] && command -v sops >/dev/null 2>&1; then
|
||||
CF_API_TOKEN=$(sops -d --extract '["cloudflare"]["api_token"]' "$secrets_file" 2>/dev/null) \
|
||||
CF_ACCOUNT_ID=$(sops -d --extract '["cloudflare"]["account_id"]' "$secrets_file" 2>/dev/null) \
|
||||
command flarectl "$@"
|
||||
else
|
||||
command flarectl "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
hostinger() {
|
||||
local secrets_file="$HOME/Config/secrets.yaml"
|
||||
if [[ -f "$secrets_file" ]] && command -v sops >/dev/null 2>&1; then
|
||||
HOSTINGER_API_TOKEN=$(sops -d --extract '["hostinger"]["api_token"]' "$secrets_file" 2>/dev/null) \
|
||||
command hostinger "$@"
|
||||
else
|
||||
command hostinger "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
# 4. _get_nix_gh_token: Extracts and caches the GitHub repo token in memory for Nix invocations.
|
||||
# Decrypts only on first use and caches in the shell session variable __NIX_GH_TOKEN to avoid repeated SOPS latency.
|
||||
_get_nix_gh_token() {
|
||||
local secrets_file="${CONFIG_SECRETS_FILE:-$HOME/Config/secrets.yaml}"
|
||||
if [[ -z "${__NIX_GH_TOKEN:-}" ]] && [[ -f "$secrets_file" ]] && command -v sops >/dev/null 2>&1; then
|
||||
__NIX_GH_TOKEN=$(sops -d --extract '["github"]["gh_repo_token"]' "$secrets_file" 2>/dev/null) || true
|
||||
fi
|
||||
printf "%s" "${__NIX_GH_TOKEN:-}"
|
||||
}
|
||||
+13
-3
@@ -1,3 +1,4 @@
|
||||
# shellcheck shell=bash
|
||||
# 📝 Todo.txt & Tuxedo Productivity Helper and Syntax Highlighter
|
||||
# Sourced in .bashrc to provide colorized listings and quick task management shortcuts.
|
||||
|
||||
@@ -42,23 +43,32 @@ _todo_color() {
|
||||
}'
|
||||
}
|
||||
|
||||
_todo_active_tasks() {
|
||||
tuxedo --json ls 2>/dev/null | jq -r '
|
||||
map(select(.done | not))
|
||||
| sort_by([ (if .priority then 0 else 1 end), .priority, .n ])
|
||||
| .[]
|
||||
| "\(.n) \(.raw)"
|
||||
' 2>/dev/null
|
||||
}
|
||||
|
||||
todo() {
|
||||
case "$1" in
|
||||
# todo next [N] / todo n [N] -> show top N priority tasks (default: 1)
|
||||
next|n)
|
||||
shift
|
||||
local count="${1:-1}"
|
||||
tuxedo 2>/dev/null ls | head -n "$count" | _todo_color
|
||||
_todo_active_tasks | head -n "$count" | _todo_color
|
||||
;;
|
||||
# todo check-next / todo do-next / todo dn -> complete top priority task
|
||||
check-next|do-next|dn)
|
||||
local top_task
|
||||
top_task=$(tuxedo 2>/dev/null ls | head -n 1)
|
||||
top_task=$(_todo_active_tasks | head -n 1)
|
||||
if [[ -n "$top_task" ]]; then
|
||||
local task_id
|
||||
task_id=$(echo "$top_task" | awk '{print $1}')
|
||||
echo "Completing: $top_task"
|
||||
tuxedo do "$task_id"
|
||||
tuxedo "do" "$task_id"
|
||||
else
|
||||
echo "No tasks found in todo.txt"
|
||||
fi
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# shellcheck shell=bash
|
||||
# 📋 Custom Wayland Desktop Utilities
|
||||
# Sourced in .bashrc to provide command-line utilities optimized for Wayland compositor environments.
|
||||
|
||||
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/test - Automated test & invariant verification runner for Workstation Config
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
echo "🐚 Running ShellCheck across shell scripts..."
|
||||
find . -type f -name "*.sh" -not -path "./.git/*" -exec shellcheck -s bash {} +
|
||||
echo "✅ ShellCheck passed!"
|
||||
|
||||
echo "🌙 Checking Neovim Lua configuration (luacheck)..."
|
||||
if command -v luacheck &>/dev/null; then
|
||||
luacheck home/config/nvim --globals vim
|
||||
else
|
||||
nix-shell -p luaPackages.luacheck --run "luacheck home/config/nvim --globals vim"
|
||||
fi
|
||||
echo "✅ Lua checks passed!"
|
||||
|
||||
echo "🐍 Running Python linters & type analysis (Ruff & Pyright)..."
|
||||
if command -v ruff &>/dev/null && command -v pyright &>/dev/null; then
|
||||
ruff check --no-cache .
|
||||
ruff format --check .
|
||||
pyright .
|
||||
else
|
||||
nix-shell -p ruff pyright --run "ruff check --no-cache . && ruff format --check . && pyright ."
|
||||
fi
|
||||
echo "✅ Python checks passed!"
|
||||
|
||||
echo "❄️ Verifying NixOS flake & sandbox checks..."
|
||||
nix flake check -L
|
||||
|
||||
echo "✨ All checks and static analyses passed successfully!"
|
||||
@@ -0,0 +1,45 @@
|
||||
hello: ENC[AES256_GCM,data:oSNILLWbmrCgBOtDkn+HR0RyJRkI8HbPLzXyQrz/WO8+ekS0cpW46ybcw7sdzg==,iv:phN/JNw4X0wXdNlZCgZCoB+IW3S2MH0WERWM+ldCWog=,tag:QAmuj3dYOMH9uEWteU5Pgg==,type:str]
|
||||
example_key: ENC[AES256_GCM,data:RX50AQc6D7bXC5wfAw==,iv:9JeXuChb6OBy/VSOGLtpS/lpo4dQPuH2DHurUW43jT4=,tag:bbQS+CTbFgD7W7H/D41lBQ==,type:str]
|
||||
example_array:
|
||||
- ENC[AES256_GCM,data:ktZK7gXHOJhwCy9Wm10=,iv:FhC4o1MOBQr6ntaCIHXEkqUuLJ7Wx6iehqQl89L10SI=,tag:6a0H2oWrl06E/g9+PFNBvg==,type:str]
|
||||
- ENC[AES256_GCM,data:jmkTYzu8bac5zS6oWtM=,iv:JyJUfCntVrVifHJj/oqMLD7LvxS9X2zP+baD9zzTmVU=,tag:nuG7IR8BY91ONFl/Sc+OgA==,type:str]
|
||||
example_number: ENC[AES256_GCM,data:MlZBL1vRuOr6yw==,iv:BfdTRkJfwLFoiemLMsTItGLMQCv7O9mZ48pro+C6Big=,tag:95O4J/ebAEdwlIN1Uw1jEQ==,type:float]
|
||||
example_booleans:
|
||||
- ENC[AES256_GCM,data:Zcpsrg==,iv:kHoZxCs1GlGye9lHJzEo7KRtqMwYtj8YbMhWU3gH6yU=,tag:Gi0DLx9Wg3uR/MxiFT/8Nw==,type:bool]
|
||||
- ENC[AES256_GCM,data:Jnyq/0A=,iv:4ssfhoW8g4459tewk4BckRx7QwT5+vJsQl4ZgnahgMU=,tag:DaSJyPjpwMWSweigZhZ8DQ==,type:bool]
|
||||
github:
|
||||
gh_login_token: ENC[AES256_GCM,data:z89+EY5q0pWLTvl64heqKZ8iKgd0DeXyNTfnR2R7gsIGun0EaOXjOA==,iv:t+uduJFIIoTCo/QywYcFUSK5AwngS0WuCiSD0Ic6c3U=,tag:nACKzVlZsy3vRJIPDzkxDw==,type:str]
|
||||
gh_repo_token: ENC[AES256_GCM,data:STrQMWcGGi4WLnU52sPM3oJDpt7ttxMjGq8BM6JFR98n4He6QFfNaQ==,iv:G1naOIBKYlrDsP6/W867kQlCxZgrCTwx1uZZw+FUuE8=,tag:Z2C8/wmbsMhP5mIdmCoXag==,type:str]
|
||||
gitea:
|
||||
api_token: ENC[AES256_GCM,data:NiafimuiG2nDfcdybyI25NGt6pBfklfVb3G5MWUUhXKKJF3dDV0Ofw==,iv:qMdbxqZfQDvMkxsOEmQ7ZoQ3HTbSlmsRbaaSl/M8F3g=,tag:BIPDKHonpt/VBpLK21Qciw==,type:str]
|
||||
login_token: null
|
||||
runner_token: ENC[AES256_GCM,data:HrGHKQWCmkb008E5MaZfgcSGm4jVQZMRlOgPRc5V9w49Gzw2glMfeA==,iv:MfZCa4ixTAuIonZX10XVPjkSbWbfXDAbF/bK/E1eDgk=,tag:wsnXWy7kRuDsMSCrQyeHow==,type:str]
|
||||
cloudflare:
|
||||
account_name: ENC[AES256_GCM,data:G8e06ImdcZLV,iv:EOLE38zsrNrShd8jiQ6rsZ4eAFZ7RwZJfTEyw72LUzc=,tag:xo/RQt9MK/0DZL4u4DYkyA==,type:str]
|
||||
glob_api_key: ENC[AES256_GCM,data:sg43YThUiBEXk3S7afzEYLBTGESjDRtJOBHkPmRHqlrtASzxG5KH7cuozmS6k3S8mHCXHA==,iv:NtDW4930mML9vgz+1soXBU95IX8eMP98NVGHIllFRfE=,tag:kSLWY86hLC4k5lxVC0vEaw==,type:str]
|
||||
api_token: ENC[AES256_GCM,data:vlyxVVzZhzEw/3j2sL3lp1BX2TfuzNoV35EXbbxllEv/BAAfGqlQ9uXK2IMtbeXCNoBlhfw=,iv:uiGxP6vg3lXXKHS5EWs9GpXD+sOqgL3vnpA7AjcA4RY=,tag:EFj0hdBICeLuyO7aBIySxA==,type:str]
|
||||
account_id: ENC[AES256_GCM,data:7wLlngvwjIsB2OkDKpdAdigv3zaUjLFklCASDXztBK0=,iv:UDCIqypIC+CiU2l/B1QmibiLVtRlBYfetK6So14nv3E=,tag:UQx+TpW6q2PylBKaXZvGqw==,type:str]
|
||||
hostinger:
|
||||
api_token: ENC[AES256_GCM,data:Q0roDicxp5QrIZUs78/vwx4vZWKHDsY2Ww7W1qN6yvK6TzI5tfx2jaQxKyVMxnAq,iv:7x4oGcjXAr9Jusp/6JjjNr1qBvIrwvLjx1Kv9HoQhWk=,tag:0YwwGplUwy03f1HQh5nywQ==,type:str]
|
||||
openrouter:
|
||||
api_key: ENC[AES256_GCM,data:fSVxJEuFy4xRTHGQMe/GNVRpP9QiHGClVCdTnryv+tgq/2F2CC73X+V93am8Mgdvag0PpQdVULOIIvtacdaX9cTQxcT6QjHlng==,iv:8ia6KPnRbOXiJU8skb9eCTkbtpLWVTGy2B2Y8TuA1cg=,tag:TmSIQggoGoziuuUHX/trFg==,type:str]
|
||||
spaceship:
|
||||
corazoncp-domain:
|
||||
SPACESHIP_API_KEY: ENC[AES256_GCM,data:xgihxuht1d/BlMAUSsmclAaV5U6zrZg=,iv:pCgTh03ZfXuxOtDGTuTXwNJEfOHXIUzcQTh8ufVWb+4=,tag:SjP4ljM0K7rgXryiPJTVBw==,type:str]
|
||||
corazoncp-secret:
|
||||
SPACESHIP_API_SECRET: ENC[AES256_GCM,data:Elxq5OTilc21yhQnfJRFzKoXViKuQjXTWNvqb0t1DCt0VV1PKR66md3Md3LJn+vaP59u/nRWiJoEq5IfoxaoCQ==,iv:bBTj3EQMnB725+wegTxI3+8xhUQmlDbhKANaHjXBy8g=,tag:1f5T2s25PJFihuaYATNomw==,type:str]
|
||||
sops:
|
||||
age:
|
||||
- enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBoTWM4TVJwcGFkcjlTTHUz
|
||||
ajR1d053S3VMNEtDVDBVOEZnVnpwRWN5MHkwCk1zTVROcDZodWNBRFFVNzVSUG83
|
||||
WExNeWRZKzV0eUQvSTJPeEpiaUZYMzAKLS0tIFJibDIyRTJBVnhNWjJPQnJPeCtI
|
||||
Z3ZNa0xTUkFoYzdiUWFKMjVlQy9RdG8Kk12VHTYAxeNizQL7fEBkaO5a8gbyHmKr
|
||||
uDRpsV8weLjy6L6ap5sMo0yL5R8Tf0uy+/RXZKw9tU/s+Pu7qleZKA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
recipient: age1pln9sxy5j93lklqklfwp3qepx7x4cs4y2w63n9y3ykt68qgra5ysqleesg
|
||||
lastmodified: "2026-11-02T23:51:21Z"
|
||||
mac: ENC[AES256_GCM,data:XpUN8gKDXjgO8wd3lmzHj5bPK1d29f+K1LPqdpsdGZJ9lCqTPqshHdLrX7QE+uZfrgR+5wOs2Onppn/ZR196T3Ok0nAk4CKp7msHBJS49SF5ld9MEgWOSDwK9EwLsNYNHcMY/ehCaWZpmhsu/y10hYMGousmNKtMrcCGYhBht1E=,iv:u2r5GZfVxJkmxICuOiF7Yh89h7RMwOpmHWHPJnkauy0=,tag:BLyAyskMAuCVs+bZZXiwzA==,type:str]
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.13.3
|
||||
@@ -11,6 +11,19 @@
|
||||
# Allow installation of unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Upstream fixes & package hash corrections
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
# Temporary upstream fix: AnyDesk vendor re-released 8.1.0 tarball in-place
|
||||
anydesk = prev.anydesk.overrideAttrs (old: {
|
||||
src = prev.fetchurl {
|
||||
inherit (old.src) url;
|
||||
hash = "sha256-zS5P2eyTHZY7cBW8mQ2Q6M0lXcx9VZZTtpG3Bb6u7IQ=";
|
||||
};
|
||||
});
|
||||
})
|
||||
];
|
||||
|
||||
# EFI bootloader configuration
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
@@ -19,6 +32,56 @@
|
||||
networking.hostName = "laptop";
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# 🛡️ Dynamic Firewall for Trusted Home Wi-Fi
|
||||
# Automatically marks the Wi-Fi interface as fully trusted (accepting all incoming ports)
|
||||
# ONLY when connected to the trusted home Wi-Fi network ("VICTORIA"), removing the friction of
|
||||
# managing arbitrary development ports. Restores the strict default firewall immediately upon
|
||||
# disconnecting or connecting to any public / untrusted network.
|
||||
networking.firewall.extraCommands = ''
|
||||
iptables -N nixos-fw-home 2>/dev/null || true
|
||||
iptables -C nixos-fw -j nixos-fw-home 2>/dev/null || iptables -I nixos-fw 1 -j nixos-fw-home
|
||||
ip6tables -N nixos-fw-home 2>/dev/null || true
|
||||
ip6tables -C nixos-fw -j nixos-fw-home 2>/dev/null || ip6tables -I nixos-fw 1 -j nixos-fw-home
|
||||
'';
|
||||
|
||||
networking.networkmanager.dispatcherScripts = [
|
||||
{
|
||||
source = pkgs.writeShellScript "nm-trusted-wifi-firewall" ''
|
||||
IFACE="$1"
|
||||
ACTION="$2"
|
||||
TRUSTED_SSID="VICTORIA"
|
||||
|
||||
IPT="${pkgs.iptables}/bin/iptables"
|
||||
IP6T="${pkgs.iptables}/bin/ip6tables"
|
||||
LOGGER="${pkgs.util-linux}/bin/logger"
|
||||
|
||||
manage_chain() {
|
||||
local cmd="$1"
|
||||
$cmd -N nixos-fw-home 2>/dev/null || true
|
||||
$cmd -C nixos-fw -j nixos-fw-home 2>/dev/null || $cmd -I nixos-fw 1 -j nixos-fw-home
|
||||
}
|
||||
|
||||
manage_chain "$IPT"
|
||||
manage_chain "$IP6T"
|
||||
|
||||
if [ "$ACTION" = "up" ] && [ "$CONNECTION_ID" = "$TRUSTED_SSID" ]; then
|
||||
$IPT -F nixos-fw-home
|
||||
$IPT -A nixos-fw-home -i "$IFACE" -j ACCEPT
|
||||
|
||||
$IP6T -F nixos-fw-home
|
||||
$IP6T -A nixos-fw-home -i "$IFACE" -j ACCEPT
|
||||
|
||||
$LOGGER -t nm-firewall "Connected to trusted network $TRUSTED_SSID: trusted interface $IFACE (all incoming ports accepted)"
|
||||
elif [ "$ACTION" = "down" ] || [ -n "$CONNECTION_ID" -a "$CONNECTION_ID" != "$TRUSTED_SSID" ]; then
|
||||
$IPT -F nixos-fw-home
|
||||
$IP6T -F nixos-fw-home
|
||||
$LOGGER -t nm-firewall "Untrusted or disconnected network ($CONNECTION_ID): restored strict firewall"
|
||||
fi
|
||||
'';
|
||||
type = "basic";
|
||||
}
|
||||
];
|
||||
|
||||
# Regional and language settings
|
||||
time.timeZone = "America/Bogota";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
@@ -49,9 +112,31 @@
|
||||
stdenv.cc.cc.lib
|
||||
zlib
|
||||
glib
|
||||
openssl
|
||||
];
|
||||
};
|
||||
|
||||
# 🧠 Memory & Swap Management
|
||||
# Compressed in-RAM swap prevents synchronous page thrashing and lockups under high memory pressure.
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# 🛡️ Early OOM Killer Daemon
|
||||
# Intervenes proactively before the kernel freezes, protecting compositor and core session services.
|
||||
services.earlyoom = {
|
||||
enable = true;
|
||||
enableNotifications = true;
|
||||
extraArgs = [
|
||||
"--avoid" "^(niri|dms|systemd|sshd)$"
|
||||
];
|
||||
};
|
||||
|
||||
# 🦠 ClamAV Antivirus Database Updater
|
||||
# Automatically keeps virus definitions updated in /var/lib/clamav via systemd timer
|
||||
# without running the continuous memory-heavy scanner daemon in RAM. Provides clamscan system-wide.
|
||||
services.clamav.updater.enable = true;
|
||||
|
||||
# System-wide administrative tools
|
||||
environment.systemPackages = with pkgs; [
|
||||
cups-pk-helper
|
||||
|
||||
+10
-5
@@ -7,13 +7,12 @@
|
||||
# Graphical Compositor (Niri window manager)
|
||||
programs.niri.enable = true;
|
||||
|
||||
# DankMaterialShell (DMS) graphical helper/shell daemon
|
||||
programs.dms-shell = {
|
||||
# DankMaterialShell / Dux shell daemon
|
||||
programs.dux-shell = {
|
||||
enable = true;
|
||||
package = inputs.dms.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||
systemd.enable = true;
|
||||
systemd.restartIfChanged = true;
|
||||
enableDynamicTheming = true;
|
||||
};
|
||||
|
||||
# DMS Greeter (dank-greeter + greetd)
|
||||
@@ -40,6 +39,9 @@
|
||||
};
|
||||
};
|
||||
|
||||
# Unlock GNOME Keyring on login via greetd
|
||||
security.pam.services.greetd.enableGnomeKeyring = true;
|
||||
|
||||
# Clean boot configuration for the greeter (suppresses tty1 diagnostic messages)
|
||||
systemd.services.greetd.serviceConfig = {
|
||||
Type = "idle";
|
||||
@@ -67,6 +69,9 @@
|
||||
};
|
||||
};
|
||||
|
||||
# Wayland execution flags for Electron / Chromium applications
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
# Wayland & Desktop Integration session flags
|
||||
environment.sessionVariables = {
|
||||
NIXOS_OZONE_WL = "1";
|
||||
QT_QPA_PLATFORMTHEME = "xdgdesktopportal";
|
||||
};
|
||||
}
|
||||
+6
-1
@@ -45,7 +45,12 @@
|
||||
|
||||
hardware.sane = {
|
||||
enable = true;
|
||||
extraBackends = [ pkgs.epsonscan2 ];
|
||||
extraBackends = [
|
||||
(pkgs.epsonscan2.override {
|
||||
withNonFreePlugins = true;
|
||||
})
|
||||
pkgs.sane-airscan
|
||||
];
|
||||
};
|
||||
|
||||
# 🐳 Virtualisation / Docker container daemon
|
||||
|
||||
Reference in new issue
Block a user