Skip to content

Commit

Permalink
Merge pull request #341 from ElementsProject/devcontainer
Browse files Browse the repository at this point in the history
other: configuration for devcontainer
  • Loading branch information
YusukeShimizu authored Jan 6, 2025
2 parents 4350878 + 65175b5 commit d2eff5e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/go
{
"name": "peerswap",
"image": "mcr.microsoft.com/devcontainers/go:dev-1.22",
"features": {
"ghcr.io/devcontainers/features/nix:1": {},
"ghcr.io/devcontainers-contrib/features/direnv:1": {}
},
"postCreateCommand": "echo 'experimental-features = nix-command flakes' | sudo tee -a /etc/nix/nix.conf > /dev/null && nix-env -iA nixpkgs.nixpkgs-fmt && nix-env -iA cachix -f https://cachix.org/api/v1/install", // Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"jnoortheen.nix-ide",
"mkhl.direnv"
]
}
},
"containerEnv": {
"RUN_INTEGRATION_TESTS": "1",
"hardeningDisable": "all",
"GOROOT": "",
"CACHIX_AUTH_TOKEN": "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJmNTg3ZjViZi00ZWJiLTRhYmQtYmYzOC0xYzFlZGE3ZGE4NTQiLCJzY29wZXMiOiJjYWNoZSJ9.pzmsXqBwHFAExdVFhbdrtN1mpc4h3U3JWnej7PC-NAA"
}
}
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,13 @@ For a LND Bitcoin signet / Liquid testnet setup guide see this [guide](./docs/si
### Development

PeerSwap uses the [nix](https://nixos.org/download.html) package manager for a simple development environment. In order to start hacking, install nix, [golang](https://golang.org/doc/install) and run `nix-shell`. This will fetch all dependencies (except golang).

#### Using Devcontainer

To use devcontainer for development, follow these steps:

1. Install [Visual Studio Code](https://code.visualstudio.com/) and the [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension.
2. Open the PeerSwap repository in Visual Studio Code.
3. When prompted to reopen the repository in a container, click "Reopen in Container".
4. The development environment will be set up automatically inside the container.
5. Hit `direnv allow`.

0 comments on commit d2eff5e

Please sign in to comment.