home: update opencode and lazygit configs
This commit is contained in:
@@ -12,7 +12,9 @@
|
|||||||
../gnome
|
../gnome
|
||||||
./dnote.nix
|
./dnote.nix
|
||||||
../modules/zed
|
../modules/zed
|
||||||
|
./secrets.nix
|
||||||
inputs.hastebin.nixosModules.hm
|
inputs.hastebin.nixosModules.hm
|
||||||
|
inputs.agenix.homeManagerModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
# This value determines the Home Manager release that your configuration is
|
# This value determines the Home Manager release that your configuration is
|
||||||
@@ -212,9 +214,22 @@
|
|||||||
};
|
};
|
||||||
initContent = ''
|
initContent = ''
|
||||||
. "${config.xdg.configHome}/zsh/init"
|
. "${config.xdg.configHome}/zsh/init"
|
||||||
|
. "${config.age.secrets.context7.path}"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
lazygit = {
|
lazygit =
|
||||||
|
let
|
||||||
|
getBaseBranch = pkgs.writeShellScriptBin "git-base-branch" ''
|
||||||
|
current_branch="$(git rev-parse --abbrev-ref HEAD)"
|
||||||
|
if [[ "$current_branch" =~ -review$ ]]; then
|
||||||
|
echo "''${current_branch%-review}"
|
||||||
|
else
|
||||||
|
git config get init.defaultBranch
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
escapeGoTemplate = builtins.replaceStrings [ "{{" "}}" ] [ ''{{"{{"}}'' ''{{"}}"}}'' ];
|
||||||
|
in
|
||||||
|
{
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
gui = {
|
gui = {
|
||||||
@@ -248,7 +263,7 @@
|
|||||||
context = "global";
|
context = "global";
|
||||||
command = ''
|
command = ''
|
||||||
git push --force-with-lease --set-upstream origin "{{.SelectedLocalBranch.Name}}" &&
|
git push --force-with-lease --set-upstream origin "{{.SelectedLocalBranch.Name}}" &&
|
||||||
gh pr create --title "{{.SelectedLocalBranch.Name}}" -B "$(git config get init.defaultBranch)" --fill ||
|
gh pr create --title "{{.SelectedLocalBranch.Name}}" -B "$(${lib.getExe getBaseBranch})" --fill ||
|
||||||
(git log --reverse --no-merges --pretty='- %s' master..HEAD | gh pr edit --body-file -);
|
(git log --reverse --no-merges --pretty='- %s' master..HEAD | gh pr edit --body-file -);
|
||||||
gh pr view --web
|
gh pr view --web
|
||||||
'';
|
'';
|
||||||
@@ -261,13 +276,31 @@
|
|||||||
type = "input";
|
type = "input";
|
||||||
title = "New Branch Name:";
|
title = "New Branch Name:";
|
||||||
key = "BranchName";
|
key = "BranchName";
|
||||||
initialValue = "{{.SelectedLocalBranch.Name}}_review";
|
initialValue = "{{.SelectedLocalBranch.Name}}-review";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
command = ''
|
command = ''
|
||||||
git checkout -b {{.Form.BranchName | quote}}
|
git checkout -b {{.Form.BranchName | quote}}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
key = "G";
|
||||||
|
context = "localBranches";
|
||||||
|
prompts = [
|
||||||
|
{
|
||||||
|
type = "menuFromCommand";
|
||||||
|
title = "PR:";
|
||||||
|
key = "pr";
|
||||||
|
command = escapeGoTemplate "gh pr list --search '-author:@me' --json number,title,author,updatedAt -t '{{range .}}{{tablerow .number .title .author.login}}{{end}}'";
|
||||||
|
filter = "(?<pr_number>[0-9]+)(?<rest>.*)";
|
||||||
|
labelFormat = "{{ .rest }}";
|
||||||
|
valueFormat = "{{ .pr_number }}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
command = ''
|
||||||
|
gh pr checkout {{.Form.pr | quote}}
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -589,6 +622,7 @@
|
|||||||
|
|
||||||
programs.rbw.enable = true;
|
programs.rbw.enable = true;
|
||||||
programs.rclone.enable = true;
|
programs.rclone.enable = true;
|
||||||
|
programs.firefox.enable = true;
|
||||||
|
|
||||||
xdg.configFile."opencode/opencode.jsonc".text = builtins.toJSON {
|
xdg.configFile."opencode/opencode.jsonc".text = builtins.toJSON {
|
||||||
"$schema" = "https://opencode.ai/config.json";
|
"$schema" = "https://opencode.ai/config.json";
|
||||||
@@ -597,6 +631,57 @@
|
|||||||
agent = {
|
agent = {
|
||||||
explore.model = "opencode/minimax-m2.1";
|
explore.model = "opencode/minimax-m2.1";
|
||||||
};
|
};
|
||||||
|
lsp = {
|
||||||
|
ruby-lsp = {
|
||||||
|
initialization = {
|
||||||
|
enabledFeatures = {
|
||||||
|
codeActions = true;
|
||||||
|
codeLens = true;
|
||||||
|
completion = true;
|
||||||
|
definition = true;
|
||||||
|
diagnostics = true;
|
||||||
|
documentHighlights = true;
|
||||||
|
documentLink = true;
|
||||||
|
documentSymbols = true;
|
||||||
|
foldingRanges = true;
|
||||||
|
formatting = false;
|
||||||
|
hover = true;
|
||||||
|
inlayHint = true;
|
||||||
|
onTypeFormatting = true;
|
||||||
|
selectionRanges = true;
|
||||||
|
semanticHighlighting = true;
|
||||||
|
signatureHelp = true;
|
||||||
|
typeHierarchy = true;
|
||||||
|
workspaceSymbol = true;
|
||||||
|
};
|
||||||
|
linters = [ "standard" ];
|
||||||
|
};
|
||||||
|
extensions = [
|
||||||
|
".rb"
|
||||||
|
".erb"
|
||||||
|
".haml"
|
||||||
|
];
|
||||||
|
command = [
|
||||||
|
"bundle"
|
||||||
|
"exec"
|
||||||
|
"ruby-lsp"
|
||||||
|
"--lsp"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
rubocop = {
|
||||||
|
command = [
|
||||||
|
"bundle"
|
||||||
|
"exec"
|
||||||
|
"rubocop"
|
||||||
|
"--lsp"
|
||||||
|
];
|
||||||
|
extensions = [
|
||||||
|
".rb"
|
||||||
|
".erb"
|
||||||
|
".haml"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
mcp = {
|
mcp = {
|
||||||
memory = {
|
memory = {
|
||||||
type = "local";
|
type = "local";
|
||||||
@@ -617,6 +702,14 @@
|
|||||||
(lib.getExe pkgs-unstable.chromium)
|
(lib.getExe pkgs-unstable.chromium)
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
context7 = {
|
||||||
|
type = "remote";
|
||||||
|
url = "https://mcp.context7.com/mcp";
|
||||||
|
headers = {
|
||||||
|
CONTEXT7_API_KEY = "{env:CONTEXT7_API_KEY}";
|
||||||
|
};
|
||||||
|
enabled = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
15
home/common/secrets.nix
Normal file
15
home/common/secrets.nix
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
age.secrets = lib.listToAttrs (
|
||||||
|
map
|
||||||
|
(secret: {
|
||||||
|
name = secret;
|
||||||
|
value = {
|
||||||
|
file = ../../secrets/${secret}.age;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
[
|
||||||
|
"context7"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
9
secrets/context7.age
Normal file
9
secrets/context7.age
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 osOCZA wDdoFnPs/OUczxmB6WgzSQ0HtguSmIsX1di6gH5guFM
|
||||||
|
b6PAgnY1Kki92V+ky+/Cuq5UezYdchS3g5MtqtRxDMQ
|
||||||
|
-> ssh-ed25519 DFiohQ oZmlLt1Em4PnIZAUwqxed5EH1ZG/Bkm3FPiZI9uxVUY
|
||||||
|
/dAEjEHp9mcygfYj+taalhqjJ6ywkWu45ymwnmtlzaY
|
||||||
|
-> ssh-ed25519 hRPDBg MKpKkBgl0baf6qJh940ekh1z/0bKbzYTBb9In2yVd3Q
|
||||||
|
1uX/3y+A/a+vxSl41DlUnZVdh6lpDYFwunzLV3DRblk
|
||||||
|
--- KQncWqjni5UN+D3I1OSWdKxVf5/UiLBUNBwFMG/1+mg
|
||||||
|
Š<EFBFBD>öôó\ÄXã±zÐÿÌ®œ¬Û\~.¼©ûfå•w@÷
|
||||||
@@ -41,4 +41,5 @@ in
|
|||||||
"glance/reddit/app-secret.age".publicKeys = users ++ [ freun-dev ];
|
"glance/reddit/app-secret.age".publicKeys = users ++ [ freun-dev ];
|
||||||
"actual.age".publicKeys = users ++ [ freun-dev ];
|
"actual.age".publicKeys = users ++ [ freun-dev ];
|
||||||
"voidauth.age".publicKeys = users ++ [ freun-dev ];
|
"voidauth.age".publicKeys = users ++ [ freun-dev ];
|
||||||
|
"context7.age".publicKeys = users ++ [ radish ];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user