geeks-r-us / anbox-playstore-installer

Install script that automates installation of googles playstore in anbox
MIT License
655 stars 155 forks source link

More portable scripts (specifically, NixOS support). #62

Open eddyb opened 3 years ago

eddyb commented 3 years ago

In order for the scripts to run at all on as many systems as possible, this is ideal:

-#!/bin/bash
+#!/usr/bin/env bash

The only other hurdle I hit trying to get it to work on NixOS was that /var/lib/anbox/android.img was missing, the NixOS service uses --android-image to specify its path, so there's no need for a copy of it to exist in /var/lib.

Something like this seems to work: sudo ln -s $(systemctl show anbox-container-manager.service -P ExecStart | grep ' --android-image=' | sed 's/^.* --android-image=//;s/;.*//;s/ --.*//') /var/lib/anbox/android.img

But I doubt that's the cleanest way to extract the value of --android-image from the systemd unit file.

In any case, neither of these is specific to NixOS, and I wanted to leave this note here in case I don't get around making a PR (which would be easy for the shebang thing, but it's less obvious how to handle the --android-image).