containers/ledstripes: deploy ledball

This commit is contained in:
Astro 2020-04-04 00:56:53 +02:00
parent 95ceac2061
commit 95c33dc243
3 changed files with 35 additions and 2 deletions

View File

@ -20,7 +20,18 @@
# Required for krops
services.openssh.enable = true;
environment.systemPackages = [ pkgs.git ];
systemd.services.ledball =
let
pile = import (toString <lib/pkgs/pile.nix>) { inherit pkgs; };
in {
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pile.ledball}/bin/rows";
Restart = "always";
};
};
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database

View File

@ -27,7 +27,6 @@ let
target = "root@${host}";
};
in {
x = hostSource "scrape";
scrape = deployContainer "scrape" "172.20.73.28";
ledstripes = deployContainer "ledstripes" "172.22.99.168";
}

23
lib/pkgs/pile.nix Normal file
View File

@ -0,0 +1,23 @@
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
pile = builtins.fetchGit "https://github.com/astro/pile.git";
in {
ledball = rustPlatform.buildRustPackage {
name = "ledball";
version = "0.0.0";
src = "${pile}/ledball";
cargoSha256 = "0zyfbf3gph8gqab07fmm5a7x5slapsqn8ck6isp53fsa7ljnagjy";
cargoBuildFlags = [ "--examples" ];
postInstall = ''
mkdir -p $out/bin
for f in target/*/release/examples/*; do
if [ -f $f ] && [ -x $f ]; then
cp $f $out/bin/
fi
done
'';
};
}