pleblee on Nostr: Got cashu running on my nix laptop. This is a basic FHS environment that lets python ...
Got cashu running on my nix laptop. This is a basic FHS environment that lets python build secp256k1:
```
{ pkgs ? import <nixpkgs> {} }:
(pkgs.buildFHSEnv {
name = "nutshell-fhs-env";
targetPkgs = pkgs: with pkgs; [
autoconf
automake
gcc
libtool
pkg-config
tmux
];
runScript = "./run-cashu.sh";
}).env
```
`run-cashu.sh`:
```
#!/usr/bin/env bash
set -e
# Default values (can be overridden by command-line arguments)
SESSION_NAME="${1:-cashu}"
if tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
echo "Session '$SESSION_NAME' already exists. No action taken."
exit 0
fi
# Create new detached session, specifying fish as the default shell
#tmux new-session -d -s "$SESSION_NAME" -x "$(tput cols)" -y "$(tput lines)" "fish"
tmux new-session -d -s "$SESSION_NAME" "fish"
# Activate virtual environment inside the tmux session
tmux send-keys -t "$SESSION_NAME" "source .venv/bin/activate.fish" C-m
# Source the configuration for cashu
#tmux send-keys -t "$SESSION_NAME" "source .env" C-m
# Start the open-webui server in the new fish shell
tmux send-keys -t "$SESSION_NAME" "cashu --help" C-m
# Attach to the session
tmux attach-session -t "$SESSION_NAME"
```
Published at
2024-10-26 18:44:16Event JSON
{
"id": "e32c0e43eef4735f30f3cfdb33ebe3769f55c0d49a35e3a69748c2acdd0aecf9",
"pubkey": "69a0a0910b49a1dbfbc4e4f10df22b5806af5403a228267638f2e908c968228d",
"created_at": 1729968256,
"kind": 1,
"tags": [
[
"t",
"tmux"
],
[
"r",
"run-cashu.sh"
],
[
"r",
"activate.fish"
]
],
"content": "Got cashu running on my nix laptop. This is a basic FHS environment that lets python build secp256k1:\n\n```\n{ pkgs ? import \u003cnixpkgs\u003e {} }:\n(pkgs.buildFHSEnv {\n name = \"nutshell-fhs-env\";\n targetPkgs = pkgs: with pkgs; [\n autoconf\n automake\n gcc \n libtool\n pkg-config\n tmux\n ]; \n runScript = \"./run-cashu.sh\";\n}).env\n```\n\n`run-cashu.sh`:\n\n```\n#!/usr/bin/env bash\nset -e\n\n# Default values (can be overridden by command-line arguments)\nSESSION_NAME=\"${1:-cashu}\"\n\nif tmux has-session -t \"$SESSION_NAME\" 2\u003e/dev/null; then\n echo \"Session '$SESSION_NAME' already exists. No action taken.\"\n exit 0\nfi\n\n# Create new detached session, specifying fish as the default shell\n#tmux new-session -d -s \"$SESSION_NAME\" -x \"$(tput cols)\" -y \"$(tput lines)\" \"fish\"\ntmux new-session -d -s \"$SESSION_NAME\" \"fish\"\n\n# Activate virtual environment inside the tmux session\ntmux send-keys -t \"$SESSION_NAME\" \"source .venv/bin/activate.fish\" C-m \n\n# Source the configuration for cashu\n#tmux send-keys -t \"$SESSION_NAME\" \"source .env\" C-m\n\n# Start the open-webui server in the new fish shell\ntmux send-keys -t \"$SESSION_NAME\" \"cashu --help\" C-m \n\n# Attach to the session\ntmux attach-session -t \"$SESSION_NAME\"\n```",
"sig": "20e81f4eaf1db2f00234352dc03af358fb646aa0919e6f41d674cf0b1144c63f93639c84ad38abacc432c416dcc95cc719ab08a7f2173baa40c36fd91afeb350"
}