What is Nostr?
bleetube
npub1dxs…n4st
2024-10-26 18:44:16

bleetube 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"
```
Author Public Key
npub1dxs2pygtfxsah77yuncsmu3ttqr274qr5g5zva3c7t5s3jtgy2xszsn4st