Use portable hostname - macos doesn't have /etc/hostname
This commit is contained in:
2
.envrc
2
.envrc
@@ -1,5 +1,5 @@
|
|||||||
use flake
|
use flake
|
||||||
|
|
||||||
export RELEASE_NODE=frajtano-test@$(cat /etc/hostname)
|
export RELEASE_NODE=frajtano-test@$(hostname -s)
|
||||||
export FRAJTANO_DIR=$PWD/.frajtano_state
|
export FRAJTANO_DIR=$PWD/.frajtano_state
|
||||||
export FRAJTANO_CONFIG=$PWD/config/config.exs
|
export FRAJTANO_CONFIG=$PWD/config/config.exs
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
file="$FRAJTANO_DIR/cookie"
|
file="$FRAJTANO_DIR/cookie"
|
||||||
(umask 077; [ -f "$file" ] || ${pkgs.coreutils}/bin/head -c 128 /dev/urandom | ${pkgs.coreutils}/bin/base64 -w0 > "$file")
|
(umask 077; [ -f "$file" ] || ${pkgs.coreutils}/bin/head -c 128 /dev/urandom | ${pkgs.coreutils}/bin/base64 -w0 > "$file")
|
||||||
export RELEASE_COOKIE=$(${pkgs.coreutils}/bin/cat "$file")
|
export RELEASE_COOKIE=$(${pkgs.coreutils}/bin/cat "$file")
|
||||||
[ -z $RELEASE_NODE ] && export RELEASE_NODE="frajtano-$(${pkgs.coreutils}/bin/whoami)@$(${pkgs.coreutils}/bin/cat /etc/hostname)"
|
[ -z $RELEASE_NODE ] && export RELEASE_NODE="frajtano-$(${pkgs.coreutils}/bin/whoami)@$(${pkgs.toybox}/bin/hostname -s)"
|
||||||
run() {
|
run() {
|
||||||
exec ${lib.getExe pkg} "$@"
|
exec ${lib.getExe pkg} "$@"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user