Lauti: Difference between revisions

Klinger (talk | contribs)
m Removed the "will be stable stable starting from 24.11" notice
Onny (talk | contribs)
Add Radar sync script example
Line 50: Line 50:


}
}
</syntaxhighlight>
== Tips and tricks ==
=== Sync events from Radar to Eintopf ===
The following script can be imported into the NixOS system configuration and will runs every half an hour to sync events from a given Radar group id to a specific target Eintopf instance.
Import the module and script into your system <code>flake.nix</code> file<syntaxhighlight lang="nix">
{
  inputs = {
    eintopf-radar-sync.url = "git+https://git.project-insanity.org/onny/eintopf-radar-sync.git";
    [...]
  };
  outputs = {self, nixpkgs, ...}@inputs: {
    nixosConfigurations.my_system = inputs.nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      specialArgs.inputs = inputs;
      modules = [
        inputs.eintopf-radar-sync.nixosModule
        ({ pkgs, ... }:{
          nixpkgs.overlays = [
            inputs.eintopf-radar-sync.overlay
          ];
        })
        ./configuration.nix
      ];
    };
  };
}
</syntaxhighlight>Enable the sync service in your system configuration by adding following snippet. Replace the setting variables according to your setup<syntaxhighlight lang="nix">
services.eintopf-radar-sync = {
  enable = true;
  settings = {
    eintopfUrl = "karlsunruh.project-insanity.org";
    eintopfAuthorizationToken = "SECRET TOKEN";
    radarGroupId = "436012";
  };
};
</syntaxhighlight>
</syntaxhighlight>
[[Category:Server]]
[[Category:Server]]
[[Category:Web Applications]]
[[Category:Web Applications]]