containers/ledstripes: deploy ledball
This commit is contained in:
parent
95ceac2061
commit
95c33dc243
|
@ -20,7 +20,18 @@
|
||||||
# Required for krops
|
# Required for krops
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
environment.systemPackages = [ pkgs.git ];
|
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
|
# This value determines the NixOS release with which your system is to be
|
||||||
# compatible, in order to avoid breaking some software such as database
|
# compatible, in order to avoid breaking some software such as database
|
||||||
|
|
|
@ -27,7 +27,6 @@ let
|
||||||
target = "root@${host}";
|
target = "root@${host}";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
x = hostSource "scrape";
|
|
||||||
scrape = deployContainer "scrape" "172.20.73.28";
|
scrape = deployContainer "scrape" "172.20.73.28";
|
||||||
ledstripes = deployContainer "ledstripes" "172.22.99.168";
|
ledstripes = deployContainer "ledstripes" "172.22.99.168";
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue