Browse Source

add portable service docs

Signed-off-by: Xe <[email protected]>
main v0.3.1
Cadey Ratio 4 weeks ago
  1. 59


@ -0,0 +1,59 @@
# Portable Service
To run this service as a [portable
service](, you either need to build it
from source or fetch a premade image from my server. Then you need to activate
the portable service and manage it like any other systemd service.
## Getting Image
### Building From Source
To build from source, install Nix and enable flakes. Then run this command:
nix build "git+"
Copy this to somewhere on your target server:
scp $(readlink ./result) target:printerfacts_0.3.1.raw
### Downloading From My Server
Visit [my portable services
repository]( server and download the
most recent `printerfacts` `.raw` file. Put it somewhere on the target machine.
## Installing and Activating
If you are running Ubuntu 22.04, you will need to install `systemd-portabled`:
sudo apt -y install systemd-container
This may work on other distros, but I have only tested this on Ubuntu 22.04.
Then attach the service image:
sudo portablectl attach ./printerfacts_0.3.1.raw
And activate it like any other systemd service:
sudo systemctl enable --now printerfacts.service
And then fetch a printer fact:
$ curl http://[::1]:32042/fact
On average, a printer will sleep for 16 hours a day.
Or open it in your browser: http://target:32042