1
0
Fork 0
mirror of https://github.com/ciderale/nixos-utm.git synced 2024-12-14 11:37:37 +00:00

improve documentation uf utmConfiguration

This commit is contained in:
Alain Lehmann 2024-10-11 01:57:26 +02:00
parent e603f75ca5
commit e43cd6ffd1
2 changed files with 12 additions and 9 deletions

View file

@ -28,7 +28,7 @@ export VM_NAME=myVM
nix run github:ciderale/nixos-utm#nixosCreate .#utm
```
## Retrieve the VMs IP address
## Retrieve the VMs IP/Mac address and other UTM configuration
```
VM_NAME=myVM nix run github:ciderale/nixos-utm#utmConfiguration ip
@ -37,6 +37,8 @@ VM_NAME=myVM nix run github:ciderale/nixos-utm#utmConfiguration ip
This command uses the arp cache to lookup the ip address based on the mac
address that is found in the VMs configuration folder.
The command `utmConfiguration` alone provides usage for other UTM configuration related information
## How to rebuild the configuration for an existing configuration
```

View file

@ -163,17 +163,14 @@
};
packages.utmConfiguration = pkgs.writeShellApplication {
name = "utmConfiguration";
runtimeInputs = [pkgs.jq];
runtimeInputs = [pkgs.jq pkgs.coreutils pkgs.gnused];
text = ''
# INPUTS: VM_NAME
UTM_DATA_DIR="$HOME/Library/Containers/com.utmapp.UTM/Data/Documents";
VM_FOLDER="$UTM_DATA_DIR/$VM_NAME.utm"
PLIST_FILE="$VM_FOLDER"/config.plist
CMD=$1
shift
case "$CMD" in
case "''${1:-usage}" in
show)
plutil -convert json -o - "$PLIST_FILE" | jq .
;;
@ -195,6 +192,7 @@
;;
update)
shift
NIX_PATCH=$1
# CREATE TEMPORARY FILES
@ -214,9 +212,12 @@
;;
*)
echo "usage: VM_NAME=your-vm $0 show "
echo "usage: VM_NAME=your-vm $0 update patch-config.nix"
usage | *)
SCRIPT=$(basename "$0")
echo "usage: VM_NAME=your-vm $SCRIPT show"
echo "usage: VM_NAME=your-vm $SCRIPT mac"
echo "usage: VM_NAME=your-vm $SCRIPT ip"
echo "usage: VM_NAME=your-vm $SCRIPT update patch-config.nix"
;;
esac
'';