Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eddyb opened this issue Jan 10, 2021 · 0 comments
Open

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

eddyb opened this issue Jan 10, 2021 · 0 comments

Comments

@eddyb
Copy link

eddyb commented Jan 10, 2021

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant