Update README.md

This commit is contained in:
James Andariese 2024-07-25 16:12:54 +00:00
parent 9bdcfb0f9b
commit eed14b5ada

View File

@ -9,18 +9,29 @@ Used to manage a lock and timing components of an at-most-once execution system.
Installing is accomplished with the included NixOS module. The included module Installing is accomplished with the included NixOS module. The included module
automatically enables the putex package system-wide so including it is sufficient. automatically enables the putex package system-wide so including it is sufficient.
Additionally, if you have the following setup:
* a NATS cluster reachable via 127.0.0.1
* a service named `routestar`
* unique hostnames for your hosts
* `systemctl is-failed` only shows failed when the host is truly ineligible to serve
then you have gained the following capability:
* the default setup for putex will control the service named `routestar`
```nix ```nix
{ inputs = { { inputs = {
nixpkgs.url = "nixpkgs"; nixpkgs.url = "nixpkgs";
putex.url = "git+https://git.strudelline.net/james/putex" <-- include the flake putex.url = "git+https://git.strudelline.net/james/putex" # <-- include the flake
}; };
outputs = { outputs = {
nixosConfigurations = { nixosConfigurations = {
container = nixpkgs.lib.nixosSystem { container = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
putex.nixosModules.default # <-- then include the module.
{ networking.useDHCP = false; boot.isContainer = true; system.stateVersion = "24.05"; } { networking.useDHCP = false; boot.isContainer = true; system.stateVersion = "24.05"; }
putex.nixosModules.default # <-- then include the module.
{ services.putexes."routestar" = { }; } # <-- and configure the putex with defaults.
]; ];
}; };
}; };
@ -28,6 +39,10 @@ automatically enables the putex package system-wide so including it is sufficien
} }
``` ```
There are additional configuration options including the `healthcheck`, `start`, and `stop` scripts
which must simply be `bash` scripts that run as fast as possible. More explicit requirements are
detailed below.
### NATS ### NATS