aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--flake.lock55
-rw-r--r--flake.nix10
-rw-r--r--modules/darwin/homebrew.nix3
-rw-r--r--modules/home/claude.nix53
-rw-r--r--modules/home/default.nix3
5 files changed, 105 insertions, 19 deletions
diff --git a/flake.lock b/flake.lock
index e2f3fe7..38365c2 100644
--- a/flake.lock
+++ b/flake.lock
@@ -16,6 +16,45 @@
"type": "github"
}
},
+ "dina": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1774856023,
+ "narHash": "sha256-Y7+3p4Wu5thX2L2ol5rQD1uys76aR7D+5pC5slXVh4k=",
+ "owner": "dinacomputer",
+ "repo": "cli",
+ "rev": "299df0757dc12e1347b40960a1b09834d780755a",
+ "type": "github"
+ },
+ "original": {
+ "owner": "dinacomputer",
+ "repo": "cli",
+ "type": "github"
+ }
+ },
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1731533236,
+ "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -75,10 +114,26 @@
"root": {
"inputs": {
"config-nvim": "config-nvim",
+ "dina": "dina",
"home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs"
}
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
}
},
"root": "root",
diff --git a/flake.nix b/flake.nix
index 479e958..db317d9 100644
--- a/flake.nix
+++ b/flake.nix
@@ -18,6 +18,11 @@
url = "github:simenandre/config.nvim";
flake = false;
};
+
+ dina = {
+ url = "github:dinacomputer/cli";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
};
outputs =
@@ -27,6 +32,7 @@
nix-darwin,
home-manager,
config-nvim,
+ dina,
}:
let
mkHomeModules = username: [
@@ -47,6 +53,7 @@
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "bak";
+ home-manager.extraSpecialArgs = { inherit dina; };
home-manager.users.cobraz = { imports = mkHomeModules "cobraz"; };
}
];
@@ -62,6 +69,7 @@
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "bak";
+ home-manager.extraSpecialArgs = { inherit dina; };
home-manager.users.simenandre = { imports = mkHomeModules "simenandre"; };
}
];
@@ -69,11 +77,13 @@
homeConfigurations."simenandre" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux";
+ extraSpecialArgs = { inherit dina; };
modules = mkHomeModules "simenandre";
};
homeConfigurations."simenandre@aarch64-linux" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."aarch64-linux";
+ extraSpecialArgs = { inherit dina; };
modules = mkHomeModules "simenandre";
};
};
diff --git a/modules/darwin/homebrew.nix b/modules/darwin/homebrew.nix
index dd54571..ada2229 100644
--- a/modules/darwin/homebrew.nix
+++ b/modules/darwin/homebrew.nix
@@ -16,7 +16,6 @@
"go-task/tap"
"tursodatabase/tap"
"simenandre/tools"
- "dinacomputer/tap"
"anomalyco/tap"
"siderolabs/tap"
];
@@ -95,8 +94,6 @@
"talosctl"
"tektoncd-cli"
"runpodctl"
- "dina"
-
# Container tools
"docker"
"docker-buildx"
diff --git a/modules/home/claude.nix b/modules/home/claude.nix
index fd73963..7f29801 100644
--- a/modules/home/claude.nix
+++ b/modules/home/claude.nix
@@ -1,6 +1,23 @@
{ ... }:
{
+ home.file.".claude/CLAUDE.md".text = ''
+ # Code Style
+
+ - ONLY use comments to explain weird code or non-obvious behaviour, never to explain simple code.
+
+ # Git & PRs
+
+ - ALWAYS write short and concise git commit messages and pull request messages.
+ - NEVER include a Co-Authored-By: line in commits.
+ - NEVER include "Generated with [Claude Code]" in PRs.
+
+ # Docker & Runtimes
+
+ - ALWAYS use the latest LTS version for base Docker images, Node.js engine requirements and similar.
+ - ALWAYS strive to use base Docker images with common ancestors in multi-stage builds: a stage based on `debian:trixie-slim` strongly suggests using `node:24-trixie-slim`.
+ '';
+
home.file.".claude/skills/push/SKILL.md".text = ''
---
name: push
@@ -22,27 +39,22 @@
Stage the relevant files. Prefer `git add <specific files>` over `git add -A`.
Never stage files that look like secrets (.env, credentials, tokens).
- ## Step 3: Create Commit
+ ## Step 3: Ask — Branch or Main?
- - Analyze the staged diff and recent `git log --oneline -10` to match the repo's commit style.
- - Write a concise, meaningful commit message (1-2 sentences) focusing on the "why".
- - **Do NOT add a Co-Authored-By line. Never include any co-author trailer.**
- - Create the commit using a HEREDOC for the message.
-
- ## Step 4: Ask — Branch or Main?
-
- Ask the user:
-
- > Push directly to the current branch, or create a new branch and open a PR?
+ Use the **AskUserQuestion** tool to ask the user how to push. Example:
- Present the two options clearly and wait for a response.
+ - question: "How should this be pushed?"
+ - header: "Push target"
+ - options:
+ - label: "Current branch", description: "Push directly to the current branch"
+ - label: "New branch + PR", description: "Create a new branch and open a pull request"
- ### Option A: Push to current branch
+ ### If "Current branch":
- Run `git push` (with `-u` if needed).
- Done.
- ### Option B: New branch + PR
+ ### If "New branch + PR":
1. Create a descriptive branch name based on the changes (e.g., `feat/add-logging`, `fix/null-check-user`).
2. Check out the new branch and push with `-u`.
@@ -50,11 +62,22 @@
- Run `git log --format='%an' -50 | sort | uniq -c | sort -rn | head -10` to find active contributors.
- Cross-reference with files changed: run `git log --format='%an' -- <changed-files> | sort | uniq -c | sort -rn | head -5` to find who has context on the modified code.
- Pick the most relevant reviewer (not the current user — check with `git config user.name`).
- - Present your choice to the user and ask for confirmation before proceeding.
+ - Build a list of up to 4 candidate reviewers and use **AskUserQuestion** to let the user pick. Example:
+ - question: "Who should review this PR?"
+ - header: "Reviewer"
+ - options: one per candidate, with description showing their commit count / relevance to changed files.
4. Create the PR using `gh pr create`:
- Short title (under 70 chars).
- Body with a `## Summary` section (2-3 bullet points) and a `## Test plan` section.
- Add the confirmed reviewer with `--reviewer`.
5. Return the PR URL to the user.
+
+ ## Step 4: Create Commit
+
+ - Analyze the staged diff.
+ - Write a concise commit message using **conventional commit format** (e.g., `feat:`, `fix:`, `refactor:`, `chore:`, `docs:`, `test:`, `ci:`). Include a scope when it adds clarity (e.g., `feat(auth):`, `fix(api):`).
+ - Output ONLY the raw commit message — no markdown, no code blocks, no backticks, no explanations.
+ - **Do NOT add a Co-Authored-By line. Never include any co-author trailer.**
+ - Create the commit using a HEREDOC for the message.
'';
}
diff --git a/modules/home/default.nix b/modules/home/default.nix
index 3ab9f5e..f1159a9 100644
--- a/modules/home/default.nix
+++ b/modules/home/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, lib, config, ... }:
+{ pkgs, lib, config, dina, ... }:
{
imports = [
@@ -24,6 +24,7 @@
home.packages = with pkgs; [
claude-code
+ dina.packages.${pkgs.stdenv.hostPlatform.system}.default
delta
fzf
gh