packages/hyprspace: init: print simple config snippet for peer entry
This commit is contained in:
parent
ed3d8fd7ab
commit
15261f5aa8
2 changed files with 13 additions and 1 deletions
|
@ -9,6 +9,7 @@ import (
|
||||||
"github.com/DataDrake/cli-ng/v2/cmd"
|
"github.com/DataDrake/cli-ng/v2/cmd"
|
||||||
"github.com/hyprspace/hyprspace/config"
|
"github.com/hyprspace/hyprspace/config"
|
||||||
"github.com/libp2p/go-libp2p/core/crypto"
|
"github.com/libp2p/go-libp2p/core/crypto"
|
||||||
|
"github.com/libp2p/go-libp2p/core/peer"
|
||||||
"github.com/multiformats/go-multibase"
|
"github.com/multiformats/go-multibase"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -66,4 +67,15 @@ func InitRun(r *cmd.Root, c *cmd.Sub) {
|
||||||
checkErr(err)
|
checkErr(err)
|
||||||
|
|
||||||
fmt.Printf("Initialized new config at %s\n", configPath)
|
fmt.Printf("Initialized new config at %s\n", configPath)
|
||||||
|
peerId, err := peer.IDFromPrivateKey(privKey)
|
||||||
|
if err == nil {
|
||||||
|
fmt.Println("Add this entry to your other peers:")
|
||||||
|
fmt.Println("{")
|
||||||
|
hostname, err := os.Hostname()
|
||||||
|
if err == nil {
|
||||||
|
fmt.Printf(" \"name\": \"%s\",\n", hostname)
|
||||||
|
}
|
||||||
|
fmt.Printf(" \"id\": \"%s\"\n", peerId)
|
||||||
|
fmt.Println("}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
};
|
};
|
||||||
packages.hyprspace = with pkgs; buildGo120Module rec {
|
packages.hyprspace = with pkgs; buildGo120Module rec {
|
||||||
pname = "hyprspace";
|
pname = "hyprspace";
|
||||||
version = "0.8.1";
|
version = "0.8.2";
|
||||||
|
|
||||||
src = with inputs.nix-filter.lib; let
|
src = with inputs.nix-filter.lib; let
|
||||||
dirs = map inDirectory;
|
dirs = map inDirectory;
|
||||||
|
|
Loading…
Reference in a new issue