nushell, helium + pwas, niri session management

This commit is contained in:
atagen 2026-03-03 00:26:21 +11:00
parent cb72b47661
commit 3b3bfb6b39
21 changed files with 816 additions and 464 deletions

View file

@ -1,23 +1,25 @@
{
pkgs,
lib,
inputs,
mainUser,
...
}:
let
claude-code =
clodTools = with pkgs; [
bash
procps
ripgrep
socat
bubblewrap
];
mkClod =
{
confDir ? null,
suffix ? null,
}:
let
version = "2.1.52";
runtimeDeps = lib.makeBinPath (
[
pkgs.procps
pkgs.ripgrep
]
++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [
pkgs.bubblewrap
pkgs.socat
]
);
version = "2.1.62";
runtimeDeps = lib.makeBinPath clodTools;
patchScript = pkgs.writeScript "patch-claude-src" ''
#!${pkgs.python3}/bin/python3
@ -110,7 +112,7 @@ let
open(sys.argv[1], "wb").write(data)
'';
in
pkgs.writeShellScriptBin "claude" ''
pkgs.writeShellScriptBin "claude${lib.optionalString (suffix != null) "-${suffix}"}" ''
set -euo pipefail
export DISABLE_AUTOUPDATER=1
export DISABLE_INSTALLATION_CHECKS=1
@ -119,6 +121,7 @@ let
CACHE="''${XDG_CACHE_HOME:-$HOME/.cache}/claude-code"
BIN="$CACHE/claude-${version}"
${lib.optionalString (confDir != null) "export CLAUDE_CONFIG_DIR=\"$HOME/${confDir}\""}
if [ ! -x "$BIN" ]; then
mkdir -p "$CACHE"
@ -132,12 +135,48 @@ let
exec "$BIN" "$@"
'';
claude-code = mkClod { };
claude-koss = mkClod {
suffix = "koss";
confDir = ".clod-koss";
};
in
(scope "apps.slopcode" <| claude-code)
(scope "apps" {
"slop" = claude-code;
"temp-slop" = claude-koss;
})
// {
# required for loaderslop
# required for loader
programs.nix-ld = {
enable = true;
libraries = [ pkgs.stdenv.cc.cc.lib ];
};
# experiment with our own sandboxing
# security.yoke.wrappers =
# let
# basePaths = [
# "wrx=/home/${mainUser}/.claude.json:/home/${mainUser}/.claude-code:/home/${mainUser}/.cache/claude-code:$PWD/.claude"
# "rx=/"
# ];
# base = {
# package = claude-code;
# executable = "claude";
# retainEnv = true;
# unrestrictTcp = true;
# extraPackages = clodTools;
# };
# in
# {
# clod-cuck = base // {
# pathRules = basePaths + [ "rx=$PWD" ];
# };
# clod = base // {
# pathRules = basePaths ++ [
# "wrx=/home/${mainUser}"
# ];
# addPwd = true;
# unrestrictSockets = true;
# unrestrictSignals = true;
# };
# };
}