clan-vm-manager: Add install-desktop.sh. Fix incorrect doku link
This commit is contained in:
@@ -84,7 +84,7 @@ Open the `flake.nix` file and set a unique `clanName` if you want you can also s
|
|||||||
|
|
||||||
**Right now clan assumes that you already have NixOS running on the target machine.**
|
**Right now clan assumes that you already have NixOS running on the target machine.**
|
||||||
|
|
||||||
If that is not the case you can use our [installer image](./03-install-iso.md) that automatically generates an endpoint reachable over TOR with a random ssh password.
|
If that is not the case you can use our [installer image](./05-install-iso.md) that automatically generates an endpoint reachable over TOR with a random ssh password.
|
||||||
|
|
||||||
On the remote execute:
|
On the remote execute:
|
||||||
1. Generate a hardware-config.nix
|
1. Generate a hardware-config.nix
|
||||||
|
|||||||
23
pkgs/clan-vm-manager/install-desktop.sh
Executable file
23
pkgs/clan-vm-manager/install-desktop.sh
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
CLAN=$(nix build .#clan-vm-manager --print-out-paths)
|
||||||
|
|
||||||
|
if ! command -v xdg-mime &> /dev/null; then
|
||||||
|
echo "Warning: 'xdg-mime' is not available. The desktop file cannot be installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install desktop file
|
||||||
|
set -eou pipefail
|
||||||
|
DESKTOP_FILE_NAME=org.clan.vm-manager.desktop
|
||||||
|
DESKTOP_DST=~/.local/share/applications/"$DESKTOP_FILE_NAME"
|
||||||
|
DESKTOP_SRC="$CLAN/share/applications/$DESKTOP_FILE_NAME"
|
||||||
|
UI_BIN="$CLAN/bin/clan-vm-manager"
|
||||||
|
|
||||||
|
cp -f "$DESKTOP_SRC" "$DESKTOP_DST"
|
||||||
|
sleep 2
|
||||||
|
sed -i "s|Exec=.*clan-vm-manager|Exec=$UI_BIN|" "$DESKTOP_DST"
|
||||||
|
xdg-mime default "$DESKTOP_FILE_NAME" x-scheme-handler/clan
|
||||||
|
echo "==== Validating desktop file installation ===="
|
||||||
|
set -x
|
||||||
|
desktop-file-validate "$DESKTOP_DST"
|
||||||
|
set +xeou pipefail
|
||||||
Reference in New Issue
Block a user