diff --git a/flake.nix b/flake.nix index ac97f6e..55cd00f 100644 --- a/flake.nix +++ b/flake.nix @@ -85,11 +85,40 @@ patagia-agent = buildCrate "patagia-agent" ./agent; patagia-controller = buildCrate "patagia-controller" ./controller; + hostd = buildCrate "hostd" ./hostd; xtask = buildCrate "xtask" ./xtask; in { packages = { - inherit patagia-agent patagia-controller xtask; + inherit + hostd + patagia-agent + patagia-controller + xtask + ; + + hostd-service = + let + hostd-service = pkgs.writeText "hostd.service" '' + [Unit] + Description=Patagia Hostd + + [Service] + Environment=RUST_LOG=debug + ExecStart=${hostd}/bin/hostd + Restart=always + RestartSec=30s + + [Install] + WantedBy=multi-user.target + ''; + in + pkgs.portableService { + pname = "hostd"; + version = "v0.0.1"; + units = [ hostd-service ]; + }; + }; checks = { diff --git a/hostd/src/bin/hostd-controller.rs b/hostd/src/bin/hostd.rs similarity index 100% rename from hostd/src/bin/hostd-controller.rs rename to hostd/src/bin/hostd.rs