From 075dd8e01179398c6691f834ada181d28456ead5 Mon Sep 17 00:00:00 2001 From: Rei Meliesie Date: Wed, 23 Sep 2026 12:16:23 +0200 Subject: [PATCH] Create Claude Code config with system config --- ruysch.nix | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/ruysch.nix b/ruysch.nix index 48b4bd4..3b9c5f2 100644 --- a/ruysch.nix +++ b/ruysch.nix @@ -123,6 +123,48 @@ "/var/lib/garage" "/var/lib/postgresql" ]; + + etc."claude/settings.json".text = lib.concatStringsSep "\n" [ + "{" + + # Required by TandemDrive security policy. + + '' + "permissions": { + "deny": [ + "Read(.env)", + "Read(.env.*)", + "Read(~/.ssh/**)", + "Read(~/.gnupg/**)", + "Read(~/.config/**)", + "Read(~/Documents/**)", + "Bash(* | bash)", + "Bash(* | sh)", + "Bash(sudo *)", + "Bash(ssh *)", + "Bash(git push *)", + "Bash(git commit *)" + ], + "ask": [ + "Bash(curl *)", + "Bash(wget *)" + ], + "disableBypassPermissionsMode": "disable" + }, + '' + + # Personal config. + + '' + "disableAutoMode": "disable", + "env": { + "CLAUDE_CODE_ENABLE_AWAY_SUMMARY": "0", + "CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION": "false" + } + '' + + "}" + ]; }; services = { @@ -207,6 +249,11 @@ redis.serviceConfig.RuntimeDirectoryMode = lib.mkForce "0755"; }; + systemd.user.tmpfiles.rules = [ + # TODO: Don't persist entire .claude directory. + "L /home/rei/.claude/settings.json - - - - /etc/claude/settings.json" + ]; + systemd.tmpfiles.rules = [ "L+ /tmp/.s.PGSQL.5432 - - - - /run/postgresql/.s.PGSQL.5432" ];