Compare commits
11 Commits
unified
...
0012b07304
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0012b07304 | ||
|
|
f7d8e728ff | ||
|
|
228fb04814 | ||
|
|
80fb31ffe1 | ||
|
|
240c838a7b | ||
|
|
1e7c110903 | ||
|
|
87dbdd522b | ||
|
|
74a01d576e | ||
|
|
cb8f841e43 | ||
|
|
1ce6ddf090 | ||
|
|
5c878e1458 |
51
TODO.md
51
TODO.md
@@ -33,11 +33,9 @@ This file tracks remaining tasks and known issues for the NixOS configuration.
|
||||
|
||||
- [ ] Consider adding additional shell aliases
|
||||
- [ ] Review if any macOS-specific tools need Linux alternatives
|
||||
- [ ] Consider adding dircolors configuration
|
||||
|
||||
### Documentation
|
||||
|
||||
- [ ] Add screenshots of tmux setup
|
||||
- [ ] Document custom Neovim configuration (lua files)
|
||||
- [ ] Create troubleshooting guide for common issues
|
||||
|
||||
@@ -51,69 +49,20 @@ This file tracks remaining tasks and known issues for the NixOS configuration.
|
||||
|
||||
These were not in the original Home Manager config but might be useful on NixOS:
|
||||
|
||||
- [ ] Desktop environment / Window manager
|
||||
- [ ] Display manager (GDM, SDDM, LightDM)
|
||||
- [ ] Sound configuration (PipeWire/PulseAudio)
|
||||
- [ ] Printing support
|
||||
- [ ] Bluetooth support
|
||||
- [ ] Docker / Podman
|
||||
- [ ] Virtualization (QEMU/KVM)
|
||||
|
||||
## Known Issues
|
||||
|
||||
### Nvim Configuration Files
|
||||
|
||||
The nvim configuration references lua files from the parent directory:
|
||||
```nix
|
||||
initLua = builtins.concatStringsSep "\n" [
|
||||
(lib.strings.fileContents ../../../nvim/base.lua)
|
||||
(lib.strings.fileContents ../../../nvim/keymaps.lua)
|
||||
(lib.strings.fileContents ../../../nvim/plugins.lua)
|
||||
(lib.strings.fileContents ../../../nvim/filetype.lua)
|
||||
];
|
||||
```
|
||||
|
||||
**Status**: Should work if nvim/ directory exists at `/home/pan/dev/config/dot/nvim/`
|
||||
|
||||
**Action**: Verify these files exist or adjust paths
|
||||
|
||||
### Profile Loading
|
||||
|
||||
The shell configuration is now configurable via `dot.sh.sourceProfile`:
|
||||
```nix
|
||||
profileExtra = lib.mkIf cfg.sourceProfile ''
|
||||
source $HOME/.profile
|
||||
'';
|
||||
```
|
||||
|
||||
**Status**: Disabled by default. Only enabled for work host.
|
||||
|
||||
**Action**: Verify `~/.profile` exists on hosts where `dot.sh.sourceProfile = true` is set.
|
||||
|
||||
## Testing Checklist
|
||||
|
||||
Before considering this configuration complete:
|
||||
|
||||
- [ ] System boots successfully
|
||||
- [ ] User can login as `pan`
|
||||
- [ ] Zsh loads with Prezto
|
||||
- [ ] Tmux starts without errors
|
||||
- [ ] Neovim opens and plugins load
|
||||
- [ ] LSP servers work in Neovim
|
||||
- [ ] Git commands work with correct identity
|
||||
- [ ] Lazygit opens and works
|
||||
- [ ] Jujutsu commands work
|
||||
- [ ] Taskwarrior shows tasks
|
||||
- [ ] Direnv loads `.envrc` files
|
||||
- [ ] fzf keybindings work (Ctrl+R)
|
||||
- [ ] zoxide navigation works
|
||||
- [ ] All shell aliases work
|
||||
|
||||
## Future Enhancements
|
||||
|
||||
- [ ] Add backup/restore scripts
|
||||
- [ ] Create CI/CD for testing configuration
|
||||
- [ ] Add secrets management (agenix or sops-nix)
|
||||
- [ ] Consider using flake-parts for better organization
|
||||
- [ ] Add system monitoring tools
|
||||
- [ ] Configure automatic updates
|
||||
|
||||
11
flake.lock
generated
11
flake.lock
generated
@@ -143,16 +143,17 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1770657009,
|
||||
"narHash": "sha256-v/LA5ZSJ+JQYzMSKB4sySM0wKfsAqddNzzxLLnbsV/E=",
|
||||
"lastModified": 1768814715,
|
||||
"narHash": "sha256-uTvoxG2KuWQsIaVbvzkEQB276IxVZYrV+UeALXnIyp8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NixOS-WSL",
|
||||
"rev": "5b50ea1aaa14945d4794c80fcc99c4aa1db84d2d",
|
||||
"repo": "nixos-wsl",
|
||||
"rev": "a14126746cee49ba450b9c7e0dc024128e094009",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "NixOS-WSL",
|
||||
"ref": "release-25.05",
|
||||
"repo": "nixos-wsl",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
nixpkgs-wsl-stable.url = "github:nixos/nixpkgs/nixos-25.05";
|
||||
|
||||
nixos-wsl = {
|
||||
url = "github:nix-community/NixOS-WSL";
|
||||
url = "github:nix-community/nixos-wsl/release-25.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs-wsl-stable";
|
||||
};
|
||||
|
||||
|
||||
@@ -18,5 +18,7 @@
|
||||
dot.llm = {
|
||||
enable = true;
|
||||
gemini-cli.enable = true;
|
||||
opencode.enable = true;
|
||||
opencode.enableConfig = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
enable = true;
|
||||
claude-code.enable = true;
|
||||
opencode.enable = true;
|
||||
opencode.enableConfig = true;
|
||||
};
|
||||
|
||||
dot.tmux.workMode = true;
|
||||
|
||||
@@ -18,5 +18,11 @@
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
|
||||
fileSystems."/home/pan/pro" = {
|
||||
device = "/dev/disk/by-uuid/9a37862c-85db-4434-b06a-ec8c2713ecc9";
|
||||
fsType = "ext4"; # or xfs, etc.
|
||||
options = [ "defaults" "nofail" "x-systemd.automount" ];
|
||||
};
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
./dev.nix
|
||||
./nvim.nix
|
||||
./task.nix
|
||||
./opencode.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
|
||||
@@ -83,6 +83,8 @@
|
||||
settings = {
|
||||
aliases = {
|
||||
tug = ["bookmark" "move" "--from" "heads(::@- & bookmarks())" "--to" "@-"];
|
||||
lg = ["log"];
|
||||
des = ["describe"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -59,6 +59,7 @@ in
|
||||
copilot-lua
|
||||
copilot-cmp
|
||||
CopilotChat-nvim
|
||||
opencode-nvim
|
||||
bullets-vim
|
||||
nvim-dap
|
||||
nvim-nio
|
||||
@@ -81,7 +82,8 @@ in
|
||||
|
||||
extraLuaConfig = ''
|
||||
_G.is_work = ${if cfg.workMode then "true" else "false"}
|
||||
_G.is_home = ${if pkgs.stdenv.isDarwin then "true" else "false"}
|
||||
_G.is_mac = ${if pkgs.stdenv.isDarwin then "true" else "false"}
|
||||
_G.is_private_nixos = ${if !cfg.workMode && pkgs.stdenv.isLinux then "true" else "false"}
|
||||
|
||||
require('base')
|
||||
require('keymaps')
|
||||
|
||||
89
modules/home/opencode.nix
Normal file
89
modules/home/opencode.nix
Normal file
@@ -0,0 +1,89 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.dot.llm.opencode;
|
||||
in
|
||||
{
|
||||
options.dot.llm.opencode = {
|
||||
enableConfig = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable managed OpenCode configuration";
|
||||
};
|
||||
|
||||
workMode = lib.mkEnableOption "work-specific opencode configuration";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enableConfig {
|
||||
# Declare the sops secret
|
||||
sops.secrets.langdock_api_key = {
|
||||
# Uses defaultSopsFile from secrets.nix
|
||||
};
|
||||
|
||||
# Create the OpenCode config.json template with secret substitution
|
||||
sops.templates."opencode/opencode.json" = {
|
||||
content = builtins.toJSON (let
|
||||
baseConfig = {
|
||||
"$schema" = "https://opencode.ai/config.json";
|
||||
default_agent = "plan";
|
||||
};
|
||||
|
||||
workConfig = {
|
||||
enabled_providers = [ "anthropic" "langdock-openai" "ollama" ];
|
||||
model = "anthropic/claude-opus-4-6-default";
|
||||
small_model = "anthropic/claude-haiku-4-5-20251001";
|
||||
provider = {
|
||||
langdock-openai = {
|
||||
npm = "@ai-sdk/openai-compatible";
|
||||
name = "Langdock OpenAI";
|
||||
options = {
|
||||
baseURL = "https://api.langdock.com/openai/eu/v1";
|
||||
apiKey = config.sops.placeholder.langdock_api_key;
|
||||
};
|
||||
models = {
|
||||
"gpt-5.2" = { name = "GPT-5.2"; };
|
||||
"gpt-5-mini" = { name = "GPT-5 mini"; };
|
||||
};
|
||||
};
|
||||
anthropic = {
|
||||
options = {
|
||||
baseURL = "https://api.langdock.com/anthropic/eu/v1";
|
||||
apiKey = config.sops.placeholder.langdock_api_key;
|
||||
};
|
||||
models = {
|
||||
"claude-opus-4-6-default" = { name = "Opus 4.6"; };
|
||||
"claude-sonnet-4-5-20250929" = { name = "Sonnet 4.5"; };
|
||||
"claude-haiku-4-5-20251001" = { name = "Haiku 4.5"; };
|
||||
};
|
||||
whitelist = [ "claude-opus-4-6-default" "claude-sonnet-4-5-20250929" "claude-haiku-4-5-20251001"];
|
||||
};
|
||||
ollama = {
|
||||
npm = "@ai-sdk/openai-compatible";
|
||||
name = "Ollama (Local)";
|
||||
options = {
|
||||
baseURL = "http://192.168.11.23:11434/v1";
|
||||
};
|
||||
models = {
|
||||
"qwen3-coder:30b" = { name = "Qwen 3 Coder 30B"; };
|
||||
"codellama:34b-instruct" = { name = "CodeLlama 34B Instruct"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
personalConfig = {
|
||||
plugin = [ "opencode-gemini-auth@latest" ];
|
||||
model = "google/gemini-3-pro-preview";
|
||||
small_model = "google/gemini-3-flash-preview";
|
||||
enabled_providers = [ "google" ];
|
||||
};
|
||||
in
|
||||
# Merge base config with the selected mode config
|
||||
baseConfig // (if cfg.workMode then workConfig else personalConfig)
|
||||
);
|
||||
};
|
||||
|
||||
# Link the generated config to the expected location
|
||||
xdg.configFile."opencode/opencode.json".source = config.lib.file.mkOutOfStoreSymlink config.sops.templates."opencode/opencode.json".path;
|
||||
};
|
||||
}
|
||||
@@ -96,6 +96,7 @@ in
|
||||
ripgrep-all
|
||||
viddy
|
||||
duf
|
||||
lsof
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
|
||||
@@ -21,7 +21,9 @@ vim.api.nvim_create_autocmd('FileType', {
|
||||
-- require('dap-python').setup()
|
||||
-- require('dap-go').setup()
|
||||
|
||||
vim.lsp.enable('ruff')
|
||||
-- vim.lsp.enable('ruff')
|
||||
-- vim.lsp.config('ty')
|
||||
vim.lsp.enable('ty')
|
||||
vim.lsp.enable('gopls')
|
||||
vim.lsp.enable('marksman')
|
||||
vim.lsp.enable('rust_analyzer')
|
||||
|
||||
@@ -377,7 +377,7 @@ dap.configurations.zig = {
|
||||
},
|
||||
}
|
||||
|
||||
if _G.is_home then
|
||||
if _G.is_mac then
|
||||
workspaces = {
|
||||
{
|
||||
name = "privat",
|
||||
@@ -410,6 +410,16 @@ if _G.is_work then
|
||||
daily_notes = {}
|
||||
end
|
||||
|
||||
if _G.is_private_nixos then
|
||||
workspaces = {
|
||||
{
|
||||
name = "tech",
|
||||
path = "~/notes",
|
||||
},
|
||||
}
|
||||
daily_notes = {}
|
||||
end
|
||||
|
||||
require("obsidian").setup({
|
||||
workspaces = workspaces,
|
||||
templates = {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
keys:
|
||||
- &macbook age1hmgy68ukugduef75ev72jnpu77ff3lajadpf7u0zv3ex4nt7f5qs5nxx2l
|
||||
- &macnix age1yez9q5q94kt99d9q8eqgqrkz7djmk3kwsqdjp7ww7e0fquzjevpsjkk5x4
|
||||
- &worknix age1wufdcd234uw69lcw6gtv9r5zfz7h5tvu0fzcg5d8tn67yx6pv47sary4q2
|
||||
|
||||
creation_rules:
|
||||
- path_regex: secrets\.yaml$
|
||||
@@ -8,3 +9,4 @@ creation_rules:
|
||||
- age:
|
||||
- *macbook
|
||||
- *macnix
|
||||
- *worknix
|
||||
|
||||
@@ -1,25 +1,34 @@
|
||||
gemini_api_key: ENC[AES256_GCM,data:nN7Hng==,iv:uOL0UyHpiRpAXfkX8qyVAnJZFm4ljkgYiZycrdSoW9U=,tag:7A/rHJcEykcoyJLeTV/gaw==,type:str]
|
||||
langdock_api_key: ENC[AES256_GCM,data:9CTt73dQowcjIdjQoPMjsmGeIgV0nyHZxePOwak/m09ePfu4Gb3gDC17wq9Hde5J9IqpEID73Kdo/DsGm9m765rPGQFxGwTo3MO5eZgXAQjFXQNNhYm+sug=,iv:TVuiMG/7HYjncK3oC8r5xYrnNGXFcrBrpq9OO+7plNY=,tag:EZqUOGYwTHcukDop8p/JBw==,type:str]
|
||||
sops:
|
||||
age:
|
||||
- recipient: age1hmgy68ukugduef75ev72jnpu77ff3lajadpf7u0zv3ex4nt7f5qs5nxx2l
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAxUEZwYkFDYVd4ek53QU13
|
||||
YStKbEVOeTJaalVIWXh1SUlrSnUzanM0anpBCktBMytXQUNyOTZaZGc4NG1Ta1lX
|
||||
Mi91UWxXZWZjRDZqNDJWQU1YODgzUkkKLS0tIFY4TjUyczQ0SGZMOUM0NkQvUC94
|
||||
WDBpdDJMaWVvUGZUcXZLZE9oYjdKLzgK4B25MbF/3bUFJ5+zxUfpSNM79HT13nux
|
||||
dvlcwkwYKIkS9YZpnyiYXZGupFhUcq1ipIvsbq/B3WR9IFn4xromPw==
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBJcTBpZ3BwNnVxVkFQQWgy
|
||||
VWFsMFF0WGIzbTBFZ0htQ251dGlVdW5PckdNCmtldkZZL0Z3SER2OHZuUGdvNVpI
|
||||
Vk1KS1ZYVzZXZGtUbTNtZnhPeStSTlUKLS0tICtXYTgxMHc0alBYUDAzcXVXcm9J
|
||||
YjQrUGZaWmpaV2tGOXJmbGR5K3l1VFEK+bsmeV/PjYcSlsJz0ZQZ8U9EYSu8bTJM
|
||||
BJ0T910cPudb/dkMrU9QSWUlBbOKk78ivKvDbwqPBfguSqU5GevLGg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
- recipient: age1yez9q5q94kt99d9q8eqgqrkz7djmk3kwsqdjp7ww7e0fquzjevpsjkk5x4
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBvK0lsajZ1b3dlMVA4Z2hm
|
||||
ek9lZENNYnVnQXp2U0hGM2pDd0FSL2JVbVhVClZUTWhNcmJadSttU2UrRVhTWU1y
|
||||
RVV6NlpndEsyYk9zSmRqLytOWUtCNWMKLS0tIGN1TDJPY2orMGJobFExUEhWYzdx
|
||||
dDB3YWVlbUY4V25pa0IvTW1xNG1XcmMK+LLoW8f+M0eBIyxwI3tD637Fw/FuXmYx
|
||||
RV/hAOaznmfq3filh9KAEA+A/9mDI2lUeF/ye/g27tEEVtNRF9H+Dg==
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA3WXdEM2RORG56N3hVRGx5
|
||||
NVZnWHY4TG5sRmdyQnJqVm4waUpoNGc4eFQ0CkNoanF3ZFRNQzQ5dHBST1BkSko0
|
||||
cDAwYlBKVUZ3amJrcDJHcTloaXIwcWsKLS0tIDlMa0dqNmJvMjZZSVBPWjJncGlK
|
||||
Q3F3cHFoWC9Ga0Q4S3VqQ1psRjZZUmsK7+d9wMgC27xaOu1CLX8YbG8BbJdYhLLg
|
||||
dc8RHujixqkvheiv9syzCNF0z6Oc2qT5Vw2v7gCZ1SPgomOf3oHNHQ==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2026-02-07T15:11:34Z"
|
||||
mac: ENC[AES256_GCM,data:Pgi9tYWnrMrlM9NjqDy0+BrH51/0T4c7M6dornLCumnRtR2Y3MZYGyA2E97kbwuqoPJCOWkzhJt7smwCRI+H0rXveO+ps+v5iUxzP+7MQmepn5wjS32HoL5c2Oer4CR7PkKY7YvL7z5IT6QcIgRXMODhsVbWgB8CjPrn/GYqb5Y=,iv:A2AyCNHfQEdx/wvUJQGc9ndL2/OYGGxBMidYOTHXO7Q=,tag:9uzJcu3bogQgVj0bDOPCwg==,type:str]
|
||||
- recipient: age1wufdcd234uw69lcw6gtv9r5zfz7h5tvu0fzcg5d8tn67yx6pv47sary4q2
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBpWjdzMWpCemJJR2FvUjJ2
|
||||
b0hraEVBWDdJeG9JRFpLYm5XV1FDUDFMeFdnCktwRElvTmoyZmpPQ3VjbldXVHo4
|
||||
SmpjQlRPK2o3YnNLMklyMnVwWERtb28KLS0tIDNjcGJhMkR1bCtBWUV1WU5TZjVR
|
||||
YjBrekY4Y2JSczBEQ3BObjhKZkhYc3MKMrGlO/w7Hvp23rpL71/XDsJDcbc3t73C
|
||||
iXdD2Oc9V5g5Jz3H7mkaAlNRg8u+LwGXYdwZiG7NWSyQnARPgeMBwQ==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2026-02-10T21:55:05Z"
|
||||
mac: ENC[AES256_GCM,data:Qmwba0kQ8uzz72UbkVx+41i+iFtjI07nRLkYI9+G3TNCDVcWSFdPXCjWxdozU1jTOYyt9EZpP5x+5DLRCbNIlsKpClMvVGwAbu8XKvqQoF5Ao4PXOFNg6hyWTPjoVDLHkEaykpgpg1fr29CHUDkyyFGniQ+Slv5LAndAx+ncTAA=,iv:ehZZi7DUlYlGcBMgV25h+cew/amgbH2tKFMr7jaNw/U=,tag:ag2vcgc29Dlx+QI8qju/LQ==,type:str]
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.11.0
|
||||
|
||||
Reference in New Issue
Block a user