feat: initial m3ta-home structure
- flake.nix with nixpkgs, home-manager, nix-colors, m3ta-nixpkgs, agenix, NUR inputs - lib/mkHome.nix: compose HM config from user + identity + context + sets - profiles/base: shell, cli-tools, secrets (always loaded) - profiles/contexts/desktop: WM, apps, theme, ghostty - profiles/contexts/server: minimal headless - profiles/sets/coding: core (git, direnv, jq, rg), editor, lsp, languages, agents - profiles/sets/gaming: steam, gamescope, gpu - profiles/sets/media: obs, ffmpeg, kdenlive, handbrake, yt-dlp - users/m3tam3re/identities: private.nix, work.nix (git, jj, ssh per identity) - users/m3tam3re/preferences: cliphist, difftastic, base packages
This commit is contained in:
85
profiles/sets/coding/agents/agents.nix
Normal file
85
profiles/sets/coding/agents/agents.nix
Normal file
@@ -0,0 +1,85 @@
|
||||
# AI agent system — OpenCode, Pi, and MCP server configuration.
|
||||
# Relies on coding.agents options provided by home/common/default.nix
|
||||
# (inputs.m3ta-nixpkgs.homeManagerModules.default).
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
videoDrivers ? [],
|
||||
...
|
||||
}: {
|
||||
# Agent Git Identity configuration
|
||||
# Note: Uses existing gitea SSH key (m3tam3re identity) for push auth
|
||||
coding.agents.gitIdentity = {
|
||||
enable = true;
|
||||
name = "m3ta-chiron";
|
||||
email = "m3ta-chiron@agentmail.to";
|
||||
sshKey = "/home/m3tam3re/.ssh/gitea";
|
||||
};
|
||||
|
||||
imports = [
|
||||
# OpenCode and Pi agent configurations
|
||||
./opencode.nix
|
||||
./pi.nix
|
||||
];
|
||||
|
||||
coding.agents.skills = {
|
||||
agentsInput = inputs.agents;
|
||||
externalSkills = [
|
||||
{
|
||||
src = inputs.skills-anthropic;
|
||||
selectSkills = ["pdf" "docx" "frontend-design"];
|
||||
}
|
||||
{src = inputs.skills-superpowers;}
|
||||
{src = inputs.skills-vercel;}
|
||||
{src = inputs.skills-basecamp;}
|
||||
{src = inputs.skills-kestra;}
|
||||
];
|
||||
};
|
||||
|
||||
programs.mcp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
DeepWiki = {
|
||||
url = "https://mcp.deepwiki.com/mcp";
|
||||
};
|
||||
Ref = {
|
||||
command = "bash";
|
||||
args = ["-c" "REF_API_KEY=$(cat /run/agenix/ref-key) exec bunx ref-tools-mcp@latest"];
|
||||
};
|
||||
Exa = {
|
||||
command = "bash";
|
||||
args = ["-c" "EXA_API_KEY=$(cat /run/agenix/exa-key) exec bunx exa-mcp-server@latest tools=web_search_exa"];
|
||||
};
|
||||
Outline = {
|
||||
url = "https://wiki.az-gruppe.com/mcp";
|
||||
};
|
||||
ContextMode = {
|
||||
command = "bash";
|
||||
args = ["-c" "exec bunx context-mode@latest"];
|
||||
};
|
||||
Honcho = {
|
||||
command = "bash";
|
||||
args = [
|
||||
"-c"
|
||||
''exec bunx mcp-remote@latest https://mcp.honcho.dev --header "Authorization:Bearer $(cat /run/agenix/honcho-key)" --header "X-Honcho-User-Name:m3tam3re"''
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
agenix-cli
|
||||
agent-browser
|
||||
beads
|
||||
pi
|
||||
(qmd.override {
|
||||
vulkanSupport = videoDrivers == ["amdgpu"];
|
||||
cudaSupport = videoDrivers == ["nvidia"];
|
||||
})
|
||||
# opencode-desktop
|
||||
openshell
|
||||
openspec
|
||||
];
|
||||
}
|
||||
260
profiles/sets/coding/agents/opencode.nix
Normal file
260
profiles/sets/coding/agents/opencode.nix
Normal file
@@ -0,0 +1,260 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
coding.agents.opencode = {
|
||||
enable = true;
|
||||
agentsInput = inputs.agents;
|
||||
};
|
||||
|
||||
coding.opencode = {
|
||||
enable = true;
|
||||
|
||||
ohMyOpencodeSettings = {
|
||||
agents = {
|
||||
sisyphus.model = "litellm/claude-opus-4-6";
|
||||
oracle.model = "litellm/claude-sonnet-4-6";
|
||||
librarian.model = "litellm/claude-sonnet-4-6";
|
||||
explore.model = "litellm/claude-haiku-4-5";
|
||||
multimodal-looker.model = "litellm/gpt-5.3-codex";
|
||||
prometheus.model = "litellm/claude-opus-4-6";
|
||||
metis.model = "litellm/claude-opus-4-6";
|
||||
momus.model = "litellm/claude-opus-4-6";
|
||||
atlas.model = "litellm/claude-sonnet-4-6";
|
||||
};
|
||||
categories = {
|
||||
visual-engineering.model = "zai-coding-plan/glm-5.1";
|
||||
ultrabrain.model = "litellm/claude-opus-4-6";
|
||||
deep.model = "litellm/claude-sonnet-4-6";
|
||||
artistry.model = "zai-coding-plan/glm-5.1";
|
||||
quick.model = "litellm/claude-haiku-4-5";
|
||||
unspecified-low.model = "litellm/claude-sonnet-4-6";
|
||||
unspecified-high.model = "litellm/claude-opus-4-6";
|
||||
writing.model = "zai-coding-plan/glm-5.1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Keep TUI settings in programs.opencode.tui to satisfy OpenCode v1.2.15+.
|
||||
programs.opencode.tui.theme = "opencode";
|
||||
|
||||
# Override legacy default settings to avoid deprecated TUI keys in settings.
|
||||
programs.opencode.settings = lib.mkForce {
|
||||
plugin = ["oh-my-openagent"];
|
||||
formatter = {
|
||||
alejandra = {
|
||||
command = ["alejandra" "-q" "-"];
|
||||
extensions = [".nix"];
|
||||
};
|
||||
};
|
||||
|
||||
# Security: permission hardening for OpenCode
|
||||
# Last matching rule wins. Glob patterns: * = any chars, ? = single char.
|
||||
# ~ and $HOME are expanded to the user's home directory.
|
||||
# external_directory gates paths outside the working directory.
|
||||
permission = {
|
||||
# External directory access: ask by default, allow safe paths
|
||||
"external_directory" = {
|
||||
"*" = "ask";
|
||||
"/nix/store/**" = "allow";
|
||||
"/tmp/**" = "allow";
|
||||
};
|
||||
|
||||
# Read access: allow by default, deny sensitive paths
|
||||
"read" = {
|
||||
"*" = "allow";
|
||||
"~/.ssh/**" = "deny";
|
||||
"~/.gnupg/**" = "deny";
|
||||
"~/.aws/**" = "deny";
|
||||
"~/.kube/**" = "deny";
|
||||
"~/.config/gh/**" = "deny";
|
||||
"~/.config/gcloud/**" = "deny";
|
||||
"~/.config/op/**" = "deny";
|
||||
"~/.config/sops/**" = "deny";
|
||||
"/run/agenix/**" = "deny";
|
||||
"~/.pi/agent/auth.json" = "deny";
|
||||
"~/.pi/agent/sessions/**" = "deny";
|
||||
"*.env" = "deny";
|
||||
"*.env.*" = "deny";
|
||||
"*.pem" = "deny";
|
||||
"*.key" = "deny";
|
||||
"*.p12" = "deny";
|
||||
"*.pfx" = "deny";
|
||||
"*id_rsa*" = "deny";
|
||||
"*id_ed25519*" = "deny";
|
||||
"*id_ecdsa*" = "deny";
|
||||
"*.example.env" = "allow";
|
||||
"*.sample.env" = "allow";
|
||||
"*.test.env" = "allow";
|
||||
".env.example" = "allow";
|
||||
".env.sample" = "allow";
|
||||
".env.test" = "allow";
|
||||
"~/.ssh/*.pub" = "allow";
|
||||
"*.pub" = "allow";
|
||||
"*.csr" = "allow";
|
||||
};
|
||||
|
||||
# Edit access: ask by default, deny sensitive paths
|
||||
"edit" = {
|
||||
"*" = "ask";
|
||||
"~/.ssh/**" = "deny";
|
||||
"~/.gnupg/**" = "deny";
|
||||
"~/.aws/**" = "deny";
|
||||
"~/.kube/**" = "deny";
|
||||
"~/.config/gh/**" = "deny";
|
||||
"~/.config/gcloud/**" = "deny";
|
||||
"~/.config/op/**" = "deny";
|
||||
"~/.config/sops/**" = "deny";
|
||||
"/run/agenix/**" = "deny";
|
||||
"~/.pi/agent/auth.json" = "deny";
|
||||
"~/.pi/agent/sessions/**" = "deny";
|
||||
"*.env" = "deny";
|
||||
"*.env.*" = "deny";
|
||||
"*.pem" = "deny";
|
||||
"*.key" = "deny";
|
||||
"*.p12" = "deny";
|
||||
"*.pfx" = "deny";
|
||||
"*id_rsa*" = "deny";
|
||||
"*id_ed25519*" = "deny";
|
||||
"*id_ecdsa*" = "deny";
|
||||
"~/.ssh/*.pub" = "allow";
|
||||
"*.pub" = "allow";
|
||||
"*.csr" = "allow";
|
||||
};
|
||||
|
||||
# Glob patterns: same rules as read for file matching
|
||||
"glob" = {
|
||||
"*" = "allow";
|
||||
"~/.ssh/**" = "deny";
|
||||
"~/.gnupg/**" = "deny";
|
||||
"/run/agenix/**" = "deny";
|
||||
"*.env" = "deny";
|
||||
"*.env.*" = "deny";
|
||||
"*.pem" = "deny";
|
||||
"*.key" = "deny";
|
||||
"*.p12" = "deny";
|
||||
"*.pfx" = "deny";
|
||||
};
|
||||
|
||||
# Grep: allow search, but deny searching for secrets
|
||||
"grep" = {
|
||||
"*" = "allow";
|
||||
"~/.ssh/**" = "deny";
|
||||
"~/.gnupg/**" = "deny";
|
||||
"/run/agenix/**" = "deny";
|
||||
"*PASSWORD*" = "ask";
|
||||
"*SECRET*" = "ask";
|
||||
"*API_KEY*" = "ask";
|
||||
"*PRIVATE_KEY*" = "ask";
|
||||
};
|
||||
|
||||
# Bash: ask by default, deny dangerous and env-leak commands
|
||||
"bash" = {
|
||||
"*" = "ask";
|
||||
"git status*" = "allow";
|
||||
"git diff*" = "allow";
|
||||
"git log*" = "allow";
|
||||
"git branch*" = "allow";
|
||||
"git show*" = "allow";
|
||||
"git remote*" = "allow";
|
||||
"nix --version" = "allow";
|
||||
"nix eval*" = "allow";
|
||||
"nix build*" = "allow";
|
||||
"nix develop*" = "allow";
|
||||
"nix shell*" = "allow";
|
||||
"nix search*" = "allow";
|
||||
"alejandra*" = "allow";
|
||||
"git add*" = "allow";
|
||||
"git commit*" = "allow";
|
||||
"git push*" = "ask";
|
||||
"git pull*" = "allow";
|
||||
"rm *" = "ask";
|
||||
"rm -rf *" = "deny";
|
||||
"sudo *" = "ask";
|
||||
"env" = "deny";
|
||||
"printenv" = "deny";
|
||||
"cat /proc/*/environ" = "deny";
|
||||
"gpg *--export-secret*" = "deny";
|
||||
"ssh-add -D" = "deny";
|
||||
"docker run --privileged*" = "deny";
|
||||
"curl *| *sh" = "deny";
|
||||
"wget *| *sh" = "deny";
|
||||
};
|
||||
|
||||
# Web fetch: ask for sensitive URLs
|
||||
"webfetch" = {
|
||||
"*" = "ask";
|
||||
"https://api.github.com*" = "allow";
|
||||
"https://search.nixos.org*" = "allow";
|
||||
};
|
||||
|
||||
# Doom loop guard
|
||||
"doom_loop" = "ask";
|
||||
};
|
||||
|
||||
# AZ-Gruppe LiteLLM endpoint + available models
|
||||
provider = {
|
||||
litellm = {
|
||||
npm = "@ai-sdk/openai-compatible";
|
||||
name = "LiteLLM (AZ-Gruppe)";
|
||||
options.baseURL = "https://llm.az-gruppe.com/v1";
|
||||
models = {
|
||||
"gpt-5.2" = {
|
||||
name = "GPT-5.2";
|
||||
limit = {
|
||||
context = 400000;
|
||||
output = 128000;
|
||||
};
|
||||
};
|
||||
"gpt-5.3-codex" = {
|
||||
name = "GPT-5.3 Codex";
|
||||
limit = {
|
||||
context = 400000;
|
||||
output = 128000;
|
||||
};
|
||||
};
|
||||
"claude-haiku-4-5" = {
|
||||
name = "Claude Haiku 4.5";
|
||||
options = {
|
||||
thinking = {
|
||||
type = "enabled";
|
||||
budget_tokens = 16000;
|
||||
};
|
||||
};
|
||||
limit = {
|
||||
context = 200000;
|
||||
output = 64000;
|
||||
};
|
||||
};
|
||||
"claude-sonnet-4-6" = {
|
||||
name = "Claude Sonnet 4.6";
|
||||
options = {
|
||||
thinking = {
|
||||
type = "enabled";
|
||||
budget_tokens = 16000;
|
||||
};
|
||||
};
|
||||
limit = {
|
||||
context = 200000;
|
||||
output = 64000;
|
||||
};
|
||||
};
|
||||
"claude-opus-4-6" = {
|
||||
name = "Claude Opus 4.6";
|
||||
options = {
|
||||
thinking = {
|
||||
type = "enabled";
|
||||
budget_tokens = 16000;
|
||||
};
|
||||
};
|
||||
limit = {
|
||||
context = 200000;
|
||||
output = 128000;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
269
profiles/sets/coding/agents/pi.nix
Normal file
269
profiles/sets/coding/agents/pi.nix
Normal file
@@ -0,0 +1,269 @@
|
||||
{inputs, ...}: {
|
||||
coding.agents.pi = {
|
||||
enable = true;
|
||||
agentsInput = inputs.agents;
|
||||
|
||||
modelOverrides = {
|
||||
chiron = "minimax/MiniMax-M2.7";
|
||||
chiron-forge = "minimax/MiniMax-M2.7";
|
||||
};
|
||||
|
||||
# Coding rules for Pi agent
|
||||
# Rules sourced from AGENTS repo
|
||||
codingRules = {
|
||||
# Language-specific rules
|
||||
languages = [
|
||||
"nix" # Nix language conventions
|
||||
];
|
||||
|
||||
# Standard concerns from AGENTS repo
|
||||
concerns = [
|
||||
"coding-style" # General coding principles
|
||||
"naming" # Naming conventions (camelCase, snake_case, etc.)
|
||||
"documentation" # Documentation standards
|
||||
"testing" # Testing guidelines (Arrange-Act-Assert)
|
||||
"git-workflow" # Conventional commits, branch naming
|
||||
"git-identity" # Git identity configuration for agents
|
||||
"project-structure" # Project layout conventions
|
||||
];
|
||||
|
||||
# No framework-specific rules for NixOS config
|
||||
frameworks = [];
|
||||
};
|
||||
|
||||
settings = {
|
||||
packages = [
|
||||
"npm:@dreadedzombie/pi-init"
|
||||
"npm:@plannotator/pi-extension"
|
||||
"npm:@thesethrose/pi-zai-provider"
|
||||
"npm:pi-agent-browser-native"
|
||||
"npm:pi-beads-extension"
|
||||
"npm:pi-lens"
|
||||
"npm:pi-markdown-preview"
|
||||
"npm:pi-mcp-adapter"
|
||||
"npm:pi-powerline-footer"
|
||||
"npm:pi-prompt-template-model"
|
||||
"npm:pi-subagents"
|
||||
"npm:pi-tool-display"
|
||||
"npm:pi-web-access"
|
||||
"git:github.com/hk-vk/pi-connect"
|
||||
];
|
||||
|
||||
defaultProvider = "minimax";
|
||||
defaultModel = "MiniMax-M2.7";
|
||||
defaultThinkingLevel = "high";
|
||||
};
|
||||
|
||||
# pi-guardrails: strict security config
|
||||
# NOTE: Path access checks are lexical (not symlink-safe).
|
||||
# NOTE: Local project .pi/extensions/guardrails.json can override same rule IDs.
|
||||
# For immutable global policies, consider a wrapper or upstream patch.
|
||||
guardrails = {
|
||||
enable = true;
|
||||
config = {
|
||||
enabled = true;
|
||||
applyBuiltinDefaults = true;
|
||||
|
||||
onboarding = {
|
||||
completed = true;
|
||||
};
|
||||
|
||||
features = {
|
||||
policies = true;
|
||||
permissionGate = true;
|
||||
pathAccess = true;
|
||||
};
|
||||
|
||||
pathAccess = {
|
||||
mode = "ask";
|
||||
allowedPaths = [
|
||||
"/nix/store/"
|
||||
"/tmp/"
|
||||
];
|
||||
};
|
||||
|
||||
policies = {
|
||||
rules = [
|
||||
# ── SSH keys ───────────────────────────────────────────
|
||||
{
|
||||
id = "home-ssh";
|
||||
enabled = true;
|
||||
protection = "noAccess";
|
||||
onlyIfExists = false;
|
||||
patterns = [
|
||||
{pattern = "~/.ssh/**";}
|
||||
{pattern = "~/.ssh/*_rsa";}
|
||||
{pattern = "~/.ssh/*_ed25519";}
|
||||
{pattern = "~/.ssh/*.pem";}
|
||||
];
|
||||
allowedPatterns = [
|
||||
{pattern = "~/.ssh/*.pub";}
|
||||
];
|
||||
}
|
||||
|
||||
# ── GPG keys ─────────────────────────────────────────
|
||||
{
|
||||
id = "home-gpg";
|
||||
enabled = true;
|
||||
protection = "noAccess";
|
||||
onlyIfExists = false;
|
||||
patterns = [
|
||||
{pattern = "~/.gnupg/**";}
|
||||
{pattern = "~/*.gpg";}
|
||||
{pattern = "~/.gpg-agent.conf";}
|
||||
];
|
||||
}
|
||||
|
||||
# ── AWS credentials ────────────────────────────────────
|
||||
{
|
||||
id = "home-aws";
|
||||
enabled = true;
|
||||
protection = "noAccess";
|
||||
onlyIfExists = false;
|
||||
patterns = [
|
||||
{pattern = "~/.aws/**";}
|
||||
{pattern = "~/.aws/credentials";}
|
||||
{pattern = "~/.aws/config";}
|
||||
];
|
||||
}
|
||||
|
||||
# ── Kubernetes configs ────────────────────────────────
|
||||
{
|
||||
id = "home-kube";
|
||||
enabled = true;
|
||||
protection = "noAccess";
|
||||
onlyIfExists = false;
|
||||
patterns = [
|
||||
{pattern = "~/.kube/**";}
|
||||
{pattern = "*kubeconfig*";}
|
||||
];
|
||||
}
|
||||
|
||||
# ── Cloud CLI configs ────────────────────────────────
|
||||
{
|
||||
id = "home-config";
|
||||
enabled = true;
|
||||
protection = "noAccess";
|
||||
onlyIfExists = false;
|
||||
patterns = [
|
||||
{pattern = "~/.config/gh/**";}
|
||||
{pattern = "~/.config/gcloud/**";}
|
||||
{pattern = "~/.config/op/**";}
|
||||
{pattern = "~/.config/sops/**";}
|
||||
];
|
||||
}
|
||||
|
||||
# ── agenix secrets ───────────────────────────────────
|
||||
{
|
||||
id = "agenix-secrets";
|
||||
enabled = true;
|
||||
protection = "noAccess";
|
||||
onlyIfExists = false;
|
||||
patterns = [
|
||||
{pattern = "/run/agenix/**";}
|
||||
];
|
||||
}
|
||||
|
||||
# ── Pi auth and sessions ────────────────────────────
|
||||
{
|
||||
id = "pi-auth-sessions";
|
||||
enabled = true;
|
||||
protection = "noAccess";
|
||||
onlyIfExists = false;
|
||||
patterns = [
|
||||
{pattern = "~/.pi/agent/auth.json";}
|
||||
{pattern = "~/.pi/agent/sessions/**";}
|
||||
];
|
||||
}
|
||||
|
||||
# ── Environment files ─────────────────────────────────
|
||||
{
|
||||
id = "secret-files";
|
||||
enabled = true;
|
||||
protection = "noAccess";
|
||||
onlyIfExists = true;
|
||||
patterns = [
|
||||
{pattern = ".env";}
|
||||
{pattern = ".env.*";}
|
||||
{pattern = ".dev.vars";}
|
||||
];
|
||||
allowedPatterns = [
|
||||
{pattern = "*.example.env";}
|
||||
{pattern = "*.sample.env";}
|
||||
{pattern = "*.test.env";}
|
||||
{pattern = ".env.example";}
|
||||
{pattern = ".env.sample";}
|
||||
{pattern = ".env.test";}
|
||||
];
|
||||
}
|
||||
|
||||
# ── Private keys and certificates ───────────────────
|
||||
{
|
||||
id = "private-keys";
|
||||
enabled = true;
|
||||
protection = "noAccess";
|
||||
onlyIfExists = false;
|
||||
patterns = [
|
||||
{pattern = "*.pem";}
|
||||
{pattern = "*.key";}
|
||||
{pattern = "*.p12";}
|
||||
{pattern = "*.pfx";}
|
||||
{pattern = "*id_rsa*";}
|
||||
{pattern = "*id_ed25519*";}
|
||||
{pattern = "*id_ecdsa*";}
|
||||
];
|
||||
allowedPatterns = [
|
||||
{pattern = "*.pub";}
|
||||
{pattern = "*.csr";}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
permissionGate = {
|
||||
explainCommands = false;
|
||||
# Auto-deny patterns: env leakage and credential dumping
|
||||
autoDenyPatterns = [
|
||||
{
|
||||
pattern = "\\benv\\b";
|
||||
regex = true;
|
||||
description = "env command (may dump environment)";
|
||||
}
|
||||
{
|
||||
pattern = "\\bprintenv\\b";
|
||||
regex = true;
|
||||
description = "printenv command (dumps environment variables)";
|
||||
}
|
||||
{
|
||||
pattern = "/proc/[0-9]+/environ";
|
||||
regex = true;
|
||||
description = "reading process environment files";
|
||||
}
|
||||
{
|
||||
pattern = "gpg\\s+--export-secret-keys";
|
||||
regex = true;
|
||||
description = "GPG secret key export";
|
||||
}
|
||||
{
|
||||
pattern = "gpg\\s+--export-secret-subkeys";
|
||||
regex = true;
|
||||
description = "GPG secret subkey export";
|
||||
}
|
||||
{
|
||||
pattern = "ssh-add\\s+-D";
|
||||
regex = true;
|
||||
description = "delete all SSH identities";
|
||||
}
|
||||
{
|
||||
pattern = "\\b(op|pass)\\s+(read|show|get)";
|
||||
regex = true;
|
||||
description = "password manager read operations";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# MCP servers auto-inherited from programs.mcp in default.nix
|
||||
};
|
||||
}
|
||||
16
profiles/sets/coding/core/default.nix
Normal file
16
profiles/sets/coding/core/default.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
# profiles/sets/coding/core/default.nix — Core coding tools (always loaded with coding set).
|
||||
#
|
||||
# Provides git (package + difftastic), direnv, and essential CLI dev tools.
|
||||
# Git USER SETTINGS (name, email, signing) are managed by the identity module,
|
||||
# NOT here — this module only handles git tooling.
|
||||
#
|
||||
# Note: git.nix is copied from nixos-config/home/coding/git/git.nix
|
||||
# It handles git.enable, difftastic, jujutsu, etc. but identity-specific
|
||||
# settings (user.name, user.email) should be set by the identity module.
|
||||
{...}: {
|
||||
imports = [
|
||||
./git.nix
|
||||
./direnv.nix
|
||||
./packages.nix
|
||||
];
|
||||
}
|
||||
8
profiles/sets/coding/core/direnv.nix
Normal file
8
profiles/sets/coding/core/direnv.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
# profiles/sets/coding/core/direnv.nix
|
||||
# direnv + nix-direnv for automatic per-project environments.
|
||||
{...}: {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
}
|
||||
41
profiles/sets/coding/core/git.nix
Normal file
41
profiles/sets/coding/core/git.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
# Git configuration with signing, aliases, and global ignore.
|
||||
# Identity and host-specific SSH keys are set per-host in home/m3tam3re/.
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
signing.format = null;
|
||||
settings = {
|
||||
user = {
|
||||
name = lib.mkDefault "m3tam3re";
|
||||
email = lib.mkDefault "p@m3ta.dev";
|
||||
};
|
||||
core.excludesfile = "~/.gitignore_global";
|
||||
init.defaultBranch = "master";
|
||||
alias = {
|
||||
st = "status";
|
||||
logd = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.difftastic.enable = true;
|
||||
|
||||
programs.jujutsu = {
|
||||
enable = true;
|
||||
settings = {
|
||||
user = {
|
||||
email = "m@m3tam3re.com";
|
||||
name = "Sascha Koenig";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
lazygit
|
||||
];
|
||||
}
|
||||
13
profiles/sets/coding/core/packages.nix
Normal file
13
profiles/sets/coding/core/packages.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
# profiles/sets/coding/core/packages.nix
|
||||
# Essential CLI dev tools — always available when coding set is active.
|
||||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
curl
|
||||
fd
|
||||
file
|
||||
hyperfine
|
||||
jq
|
||||
ripgrep
|
||||
tree
|
||||
];
|
||||
}
|
||||
22
profiles/sets/coding/default.nix
Normal file
22
profiles/sets/coding/default.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
# profiles/sets/coding/default.nix — Coding environment aggregator.
|
||||
#
|
||||
# Imports all coding sub-modules. Individual features are controlled
|
||||
# via enable options (e.g. coding.editors.neovim.enable = true).
|
||||
#
|
||||
# Structure:
|
||||
# core/ — Always-on when coding set is active (git, direnv, core packages)
|
||||
# editor/ — Neovim (both contexts), Zed (desktop only)
|
||||
# lsp/ — Language server protocol tools
|
||||
# languages/ — Python, JS, Rust, Go, TypeScript (each with enable option)
|
||||
# agents/ — AI coding agents (opencode, etc.)
|
||||
# packages — Optional extra packages (bruno, insomnia)
|
||||
{...}: {
|
||||
imports = [
|
||||
./core
|
||||
./editor
|
||||
./lsp
|
||||
./agents/agents.nix
|
||||
./languages
|
||||
./packages.nix
|
||||
];
|
||||
}
|
||||
6
profiles/sets/coding/editor/default.nix
Normal file
6
profiles/sets/coding/editor/default.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
# Editor aggregator — delegates to m3ta-nixpkgs editor modules.
|
||||
{...}: {
|
||||
imports = [
|
||||
./neovim.nix
|
||||
];
|
||||
}
|
||||
7
profiles/sets/coding/editor/neovim.nix
Normal file
7
profiles/sets/coding/editor/neovim.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
# NeoVim base configuration via m3ta-nixpkgs coding.editors module.
|
||||
# The option `coding.editors.neovim.enable` is declared by
|
||||
# inputs.m3ta-nixpkgs.homeManagerModules.default — no re-declaration here.
|
||||
{...}: {
|
||||
# Placeholder for host-agnostic NeoVim overrides.
|
||||
# Set coding.editors.neovim.enable = true in per-host files to activate.
|
||||
}
|
||||
10
profiles/sets/coding/languages/default.nix
Normal file
10
profiles/sets/coding/languages/default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
# Language runtimes — Python, JavaScript, Rust, Go, TypeScript.
|
||||
{...}: {
|
||||
imports = [
|
||||
./python.nix
|
||||
./javascript.nix
|
||||
./rust-toolchain.nix
|
||||
./go.nix
|
||||
./typescript.nix
|
||||
];
|
||||
}
|
||||
19
profiles/sets/coding/languages/go.nix
Normal file
19
profiles/sets/coding/languages/go.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
# Go toolchain — compiler and language server.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.coding.languages.go;
|
||||
in {
|
||||
options.coding.languages.go.enable = mkEnableOption "Go toolchain";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
go
|
||||
gopls
|
||||
];
|
||||
};
|
||||
}
|
||||
25
profiles/sets/coding/languages/javascript.nix
Normal file
25
profiles/sets/coding/languages/javascript.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
# JavaScript/TypeScript runtime — Node.js and Bun.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.coding.languages.javascript;
|
||||
npmGlobalPrefix = "${config.home.homeDirectory}/.npm-global";
|
||||
in {
|
||||
options.coding.languages.javascript.enable = mkEnableOption "JavaScript runtime (Node.js + Bun)";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
nodejs
|
||||
bun
|
||||
];
|
||||
|
||||
home.file.".npmrc".text = ''
|
||||
prefix=${npmGlobalPrefix}
|
||||
'';
|
||||
home.sessionVariables.NPM_CONFIG_PREFIX = npmGlobalPrefix;
|
||||
};
|
||||
}
|
||||
35
profiles/sets/coding/languages/python.nix
Normal file
35
profiles/sets/coding/languages/python.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
# Python runtime with pip and uv.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.coding.languages.python;
|
||||
in {
|
||||
options.coding.languages.python = {
|
||||
enable = mkEnableOption "Python runtime with pip and uv";
|
||||
extraPackages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [];
|
||||
example = literalExpression "[ pkgs.python3Packages.numpy ]";
|
||||
description = "Additional Python packages to include";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
(pkgs.python3.withPackages (ps:
|
||||
with ps;
|
||||
[
|
||||
uv
|
||||
]
|
||||
++ cfg.extraPackages))
|
||||
(writeShellScriptBin "pip" "exec uv pip $@")
|
||||
(writeShellScriptBin "pip3" "exec uv pip $@")
|
||||
pyrefly
|
||||
ruff
|
||||
];
|
||||
};
|
||||
}
|
||||
20
profiles/sets/coding/languages/rust-toolchain.nix
Normal file
20
profiles/sets/coding/languages/rust-toolchain.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
# Rust toolchain — compiler, package manager, and language server.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.coding.languages.rustToolchain;
|
||||
in {
|
||||
options.coding.languages.rustToolchain.enable = mkEnableOption "Rust toolchain";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
rustc
|
||||
cargo
|
||||
rust-analyzer
|
||||
];
|
||||
};
|
||||
}
|
||||
19
profiles/sets/coding/languages/typescript.nix
Normal file
19
profiles/sets/coding/languages/typescript.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
# TypeScript support — language server and type checking tools.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.coding.languages.typescript;
|
||||
in {
|
||||
options.coding.languages.typescript.enable = mkEnableOption "TypeScript support";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
typescript
|
||||
typescript-language-server
|
||||
];
|
||||
};
|
||||
}
|
||||
6
profiles/sets/coding/lsp/default.nix
Normal file
6
profiles/sets/coding/lsp/default.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
# LSP aggregator — language server protocol tooling.
|
||||
{...}: {
|
||||
imports = [
|
||||
./servers.nix
|
||||
];
|
||||
}
|
||||
23
profiles/sets/coding/lsp/servers.nix
Normal file
23
profiles/sets/coding/lsp/servers.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
# LSP server configuration — language servers for the development environment.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.coding.lsp;
|
||||
in {
|
||||
options.coding.lsp.enable = mkEnableOption "enable LSP servers";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
# Nix
|
||||
nixd
|
||||
# General
|
||||
typescript-language-server
|
||||
tailwindcss-language-server
|
||||
pyrefly
|
||||
];
|
||||
};
|
||||
}
|
||||
20
profiles/sets/coding/packages.nix
Normal file
20
profiles/sets/coding/packages.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
# Additional coding packages — API clients and GUI development tools.
|
||||
# Opt-in since not all coding hosts need these desktop-oriented tools.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.coding.packages;
|
||||
in {
|
||||
options.coding.packages.enable = mkEnableOption "additional coding packages (bruno, insomnia)";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [
|
||||
pkgs.bruno
|
||||
pkgs.insomnia
|
||||
];
|
||||
};
|
||||
}
|
||||
8
profiles/sets/gaming/default.nix
Normal file
8
profiles/sets/gaming/default.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
# Gaming profile aggregator — Steam platform, Gamescope session, and AMD GPU tools.
|
||||
{...}: {
|
||||
imports = [
|
||||
./steam.nix
|
||||
./gamescope.nix
|
||||
./gpu.nix
|
||||
];
|
||||
}
|
||||
16
profiles/sets/gaming/gamescope.nix
Normal file
16
profiles/sets/gaming/gamescope.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
# Gamescope — Valve's micro-compositor for Steam gaming sessions.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.profiles.gaming.gamescope;
|
||||
in {
|
||||
options.profiles.gaming.gamescope.enable = mkEnableOption "enable Gamescope session";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [pkgs.gamescope];
|
||||
};
|
||||
}
|
||||
21
profiles/sets/gaming/gpu.nix
Normal file
21
profiles/sets/gaming/gpu.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
# AMD GPU tools — ROCm runtime, monitoring, and Vulkan utilities for gaming.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.profiles.gaming.gpu;
|
||||
in {
|
||||
options.profiles.gaming.gpu.enable = mkEnableOption "enable AMD GPU tools";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
rocmPackages.rocm-runtime
|
||||
rocmPackages.rocm-smi
|
||||
rocmPackages.rocminfo
|
||||
vulkan-tools
|
||||
];
|
||||
};
|
||||
}
|
||||
21
profiles/sets/gaming/steam.nix
Normal file
21
profiles/sets/gaming/steam.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
# Steam gaming platform with Steam Deck compatibility tools and gaming utilities.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.profiles.gaming.steam;
|
||||
in {
|
||||
options.profiles.gaming.steam.enable = mkEnableOption "enable Steam gaming";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
gamemode
|
||||
goverlay
|
||||
mangohud
|
||||
protonplus
|
||||
];
|
||||
};
|
||||
}
|
||||
10
profiles/sets/media/default.nix
Normal file
10
profiles/sets/media/default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
# Media profile aggregator — OBS, FFmpeg, yt-dlp, Kdenlive, and HandBrake.
|
||||
{...}: {
|
||||
imports = [
|
||||
./obs.nix
|
||||
./ffmpeg.nix
|
||||
./yt-dlp.nix
|
||||
./kdenlive.nix
|
||||
./handbrake.nix
|
||||
];
|
||||
}
|
||||
24
profiles/sets/media/ffmpeg.nix
Normal file
24
profiles/sets/media/ffmpeg.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
# FFmpeg — full-featured multimedia processing toolchain.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.profiles.media.ffmpeg;
|
||||
in {
|
||||
options.profiles.media.ffmpeg.enable = mkEnableOption "enable FFmpeg tools";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
amf
|
||||
ffmpeg_6-full
|
||||
gst_all_1.gstreamer
|
||||
gst_all_1.gst-vaapi
|
||||
pamixer
|
||||
pavucontrol
|
||||
qpwgraph
|
||||
];
|
||||
};
|
||||
}
|
||||
21
profiles/sets/media/handbrake.nix
Normal file
21
profiles/sets/media/handbrake.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
# HandBrake — open-source video transcoder.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.profiles.media.handbrake;
|
||||
in {
|
||||
options.profiles.media.handbrake.enable = mkEnableOption "enable HandBrake transcoder";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
handbrake
|
||||
gimp
|
||||
inkscape
|
||||
libation
|
||||
];
|
||||
};
|
||||
}
|
||||
16
profiles/sets/media/kdenlive.nix
Normal file
16
profiles/sets/media/kdenlive.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
# Kdenlive — KDE non-linear video editor.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.profiles.media.kdenlive;
|
||||
in {
|
||||
options.profiles.media.kdenlive.enable = mkEnableOption "enable Kdenlive video editor";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [pkgs.kdePackages.kdenlive];
|
||||
};
|
||||
}
|
||||
21
profiles/sets/media/obs.nix
Normal file
21
profiles/sets/media/obs.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
# OBS Studio — open broadcaster software for streaming and recording.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.profiles.media.obs;
|
||||
in {
|
||||
options.profiles.media.obs.enable = mkEnableOption "enable OBS Studio";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
v4l-utils
|
||||
];
|
||||
|
||||
# OBS is managed via NixOS programs.obs-studio at the system level.
|
||||
# Home-manager only installs supporting tools.
|
||||
};
|
||||
}
|
||||
32
profiles/sets/media/yt-dlp.nix
Normal file
32
profiles/sets/media/yt-dlp.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
# yt-dlp and media playback — YouTube downloader with MPV integration.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.profiles.media.ytDlp;
|
||||
in {
|
||||
options.profiles.media.ytDlp.enable = mkEnableOption "enable yt-dlp and media playback";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
plexamp
|
||||
unimatrix
|
||||
webcord
|
||||
];
|
||||
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
bindings = {
|
||||
WHEEL_UP = "seek 10";
|
||||
WHEEL_DOWN = "seek -10";
|
||||
};
|
||||
config = {
|
||||
profile = "gpu-hq";
|
||||
ytdl-format = "bestvideo+bestaudio";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user