Compare commits

...

3 Commits

6 changed files with 190 additions and 70 deletions

View File

@@ -14,6 +14,23 @@
tux.services.openssh.enable = true;
sops.secrets = {
hyperbolic_api_key = {
sopsFile = ./secrets.yaml;
owner = "${username}";
};
gemini_api_key = {
sopsFile = ./secrets.yaml;
owner = "${username}";
};
open_router_api_key = {
sopsFile = ./secrets.yaml;
owner = "${username}";
};
};
boot.binfmt.emulatedSystems = ["aarch64-linux"];
nixpkgs = {

27
hosts/sirius/secrets.yaml Normal file
View File

@@ -0,0 +1,27 @@
hyperbolic_api_key: ENC[AES256_GCM,data:3E4oWt65AU3anVUEU52r7vpRddDgXdqKgvc/URQmJGbA0nu6sbRmw3lD44SG0L5tMubi20+gkKlyFV3i8q2U148eo582Sxh8eXshvvjZ+gr9W9Eg0Tk9kQWycrE+N3r3g1AC+CWtbkRFDxQLuVAYf9W4mTw2Yg1VLV7H3BUCSYv3Rg5EPb9c,iv:Z+72Bk+5ZnHVR+SHXgM5mwfsIp4zZf9Iv8cAaZQB3Mg=,tag:phqWkpOCKnfiCBvR/f3flw==,type:str]
gemini_api_key: ENC[AES256_GCM,data:S9DEgF4xIDXaOqs+3vdRbFb4Z8eAV1hVg8PwEfasWu9XGH3CTXV8,iv:LvUFg6dzlzC3feGh//d2rmxvVq5TJQDEBQWfxNa259Y=,tag:juLXnsiXz7OmYvyKfAv66Q==,type:str]
open_router_api_key: ENC[AES256_GCM,data:tUtkVER9ZlhSeb0bDbA1nRi1lkRX/ofosV+mcHnaNQmAZXWXiyn8WDfemxxNuvU86YctURxL4TckfsQv7RmMjY7esB1Pmmwf9Q==,iv:elT8JJu48cgu4Q1YWxiL4ePNkP+EGhI8blqfUB/nmz8=,tag:bMvUXUegE+GJ6WdypTxLyw==,type:str]
sops:
age:
- recipient: age14vktfes95f33vuefwnmuvryas7az04u76dsgyhfvsx73czkvmp2q7njkl4
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBtVUx5VWlHekQ1ZlBWb1cv
aWpXQ0NUaDVudENNRWhPdXlhekhwZW9zbjNNCkRzTlVOZm53MnJmckp6d3FsTU9D
M2pZYUs2aHJzWjQzM01BMUVaZHlsdm8KLS0tIG04Rjc3VXM1eFhvTGhpMVlJdE9K
dkYwdGZMRmZ1MFFTVlI4T0MrNytsV00KmdCXJ/EBZhLN/NXuOf36LjwmGTze46Ou
kQtKSpdzLdo/bdS6sbUGVHqDLeS7GwGtVciMh9zBHCsGBCAAkQHxIA==
-----END AGE ENCRYPTED FILE-----
- recipient: age1f860dfewlx5jtt9ejr47gywx70p3dmyc8mat29gpr75psljwjv8q5xyxkq
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBiSXhQdEpJZHBGbjlZTnhD
U0Zwc1pwbGtHdkRFbWJRVzRNWUdqakhzM2pJCmYyYlMwQVZEbzkxcnRKVERyeExB
Z0hXcTdyMHMwREExdlJmR3JHTldvRnMKLS0tIFNMczN6QmI3cUR6clBDU2dKQTVF
U1dpRkttaURwSkgySVdiR25iZk50b2cKrrNfeAV73W3+kWM0diIFj08+koBVySVx
U3tYYrePi7qQxDSrNo4a14yOopjktj/ABKpxI5cfza6aS5NQxErq2Q==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-10-10T21:30:12Z"
mac: ENC[AES256_GCM,data:IxGSaYj3PLV+RA4G+A3yep0RkcPr9xd6X7yKJP3QVthzGinm0KRNs8wyMdDgdSrK/e0AlzN594VOMTRRgxLV9oPqEPqufWDGGCpiKuW+q2mJSv3i3f1dUbO/l+OSTEFqeeKb8rWEhbJ3qcjEhI/eFB+RNkDtJvSzDlJsS4uDB9A=,iv:VlvTI3AHyBKpwr9b29YqN8V1Tjq2E8oAOAPA7LuAKps=,tag:+BFt/T4ep66WFz9Y2a7a9w==,type:str]
unencrypted_suffix: _unencrypted
version: 3.10.2

View File

@@ -25,7 +25,7 @@ in {
package = pkgs.brave;
commandLineArgs = [
"--disable-features=WebRtcAllowInputVolumeAdjustment"
"--force-device-scale-factor=1.05"
"--force-device-scale-factor=1.0"
];
};

View File

@@ -1,15 +0,0 @@
{...}: {
programs = {
aichat = {
enable = true;
settings = {
model = "gemini:gemini-2.0-flash-lite";
clients = [
{
type = "gemini";
}
];
};
};
};
}

View File

@@ -1,7 +1,6 @@
{pkgs, ...}: {
imports = [
./lazygit.nix
./aichat.nix
./superfile.nix
./open-code.nix
];

View File

@@ -9,69 +9,161 @@
customCommands = [
{
key = "<c-a>";
description = "Pick AI commit";
command = ''
aichat "Please suggest 10 commit messages, given the following diff:
description = "AI-powered conventional commit";
context = "global";
command = "git commit -m \"{{.Form.CommitMsg}}\"";
loadingText = "Generating commit messages...";
prompts = [
{
type = "menu";
key = "Type";
title = "Type of change";
options = [
{
name = "AI defined";
description = "Let AI analyze and determine the best commit type";
value = "ai-defined";
}
{
name = "build";
description = "Changes that affect the build system or external dependencies";
value = "build";
}
{
name = "feat";
description = "A new feature";
value = "feat";
}
{
name = "fix";
description = "A bug fix";
value = "fix";
}
{
name = "chore";
description = "Other changes that don't modify src or test files";
value = "chore";
}
{
name = "ci";
description = "Changes to CI configuration files and scripts";
value = "ci";
}
{
name = "docs";
description = "Documentation only changes";
value = "docs";
}
{
name = "perf";
description = "A code change that improves performance";
value = "perf";
}
{
name = "refactor";
description = "A code change that neither fixes a bug nor adds a feature";
value = "refactor";
}
{
name = "revert";
description = "Reverts a previous commit";
value = "revert";
}
{
name = "style";
description = "Changes that do not affect the meaning of the code";
value = "style";
}
{
name = "test";
description = "Adding missing tests or correcting existing tests";
value = "test";
}
];
}
{
type = "menuFromCommand";
title = "AI Generated Commit Messages";
key = "CommitMsg";
command = ''
bash -c "
# Check for staged changes
diff=\$(git diff --cached | head -n 10)
if [ -z \"\$diff\" ]; then
echo \"No changes in staging. Add changes first.\"
exit 1
fi
\`\`\`diff
$(git diff --cached)
\`\`\`
SELECTED_TYPE=\"{{.Form.Type}}\"
COMMITS_TO_SUGGEST=8
**Criteria:**
opencode run -m \"google/gemini-2.5-flash-lite\" \"
You are an expert at writing Git commits. Your job is to write commit messages that follow the Conventional Commits format.
1. **Format:** Each commit message must follow the conventional commits format, which is \`<type>(<scope>): <description>\`.
2. **Relevance:** Avoid mentioning a module name unless it's directly relevant to the change.
3. **Enumeration:** List the commit messages from 1 to 10.
4. **Clarity and Conciseness:** Each message should clearly and concisely convey the change made.
The user has selected: \$SELECTED_TYPE
**Commit Message Examples:**
Your task is to:
1. Analyze the code changes
2. Determine the most appropriate commit type (if user selected 'ai-defined')
3. Determine an appropriate scope (component/area affected)
4. Decide if this is a breaking change
5. Write clear, concise commit messages
- fix(app): add password regex pattern
- test(unit): add new test cases
- style: remove unused imports
- refactor(pages): extract common code to \`utils/wait.ts\`
Available commit types:
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing tests or correcting existing tests
- build: Changes that affect the build system or external dependencies
- ci: Changes to CI configuration files and scripts
- chore: Other changes that don't modify src or test files
- revert: Reverts a previous commit
**Recent Commits on Repo for Reference:**
Follow these guidelines:
- Structure: <type>(<scope>): <description>
- If user selected 'ai-defined', analyze the changes and pick the most suitable type
- If user selected a specific type, use that type: \$SELECTED_TYPE
- Add scope in parentheses if applicable (e.g., auth, api, ui, config)
- Use exclamation mark (!) after type/scope for breaking changes: type(scope)!: description
- Use lowercase for description (except proper nouns)
- Use imperative mood (\\\"add\\\", not \\\"added\\\")
- Keep description under 50 characters when possible
- No period at the end of subject line
\`\`\`
$(git log -n 10 --pretty=format:'%h %s')
\`\`\`
Examples:
- feat(auth): add OAuth login support
- fix(api): handle null response in user endpoint
- docs(readme): update installation instructions
- style(ui): improve button spacing consistency
- refactor(database): simplify query builder logic
- test(auth): add unit tests for login flow
- build(deps): upgrade React to version 18
- ci(github): fix deployment workflow
- chore(config): update ESLint rules
- perf(api)!: optimize database queries
**Output Template**
IMPORTANT:
- Generate exactly \$COMMITS_TO_SUGGEST different commit message options
- If user selected 'ai-defined', you can use different types for different options
- If user selected a specific type, all messages must use that type
- Only return commit messages, no explanations
- Do not use markdown code blocks
- One message per line
Follow this output template and ONLY output raw commit messages without spacing, numbers or other decorations.
Previous commits for context:
\$(git log --oneline -10)
fix(app): add password regex pattern
test(unit): add new test cases
style: remove unused imports
refactor(pages): extract common code to \`utils/wait.ts\`
**Instructions:**
- Take a moment to understand the changes made in the diff.
- Think about the impact of these changes on the project (e.g., bug fixes, new features, performance improvements, code refactoring, documentation updates). It's critical to my career you abstract the changes to a higher level and not just describe the code changes.
- Generate commit messages that accurately describe these changes, ensuring they are helpful to someone reading the project's history.
- Remember, a well-crafted commit message can significantly aid in the maintenance and understanding of the project over time.
- If multiple changes are present, make sure you capture them all in each commit message.
Keep in mind you will suggest 10 commit messages. Only 1 will be used. It's better to push yourself (esp to synthesize to a higher level) and maybe wrong about some of the 10 commits because only one needs to be good. I'm looking for your best commit, not the best average commit. It's better to cover more scenarios than include a lot of overlap.
Write your 10 commit messages below in the format shown in Output Template section above." \
| fzf --height 40% --border --ansi --preview "echo {}" --preview-window=up:wrap \
| xargs -I {} bash -c '
COMMIT_MSG_FILE=$(mktemp)
echo "{}" > "$COMMIT_MSG_FILE"
''${EDITOR:-vim} "$COMMIT_MSG_FILE"
if [ -s "$COMMIT_MSG_FILE" ]; then
git commit -F "$COMMIT_MSG_FILE"
else
echo "Commit message is empty, commit aborted."
fi
rm -f "$COMMIT_MSG_FILE"'
'';
context = "files";
output = "terminal";
Changes to analyze:
\$(git diff --cached --stat)
\$(git diff --cached)
\"
"
'';
}
];
}
];
};