Added all configuration parameters to nix flake

This commit is contained in:
rzuasti
2026-01-27 13:13:02 -05:00
parent 9a2227bb07
commit b1184d16ee
4 changed files with 80 additions and 20 deletions
+41 -2
View File
@@ -16,6 +16,11 @@ in {
Whether to run the oott service
'';
};
database.path = mkOption {
type = types.path;
description = "Full path to store the database at";
default = "/var/lib/oott.db";
};
networking.interface = mkOption {
type = types.str;
description = "Network interface to use for scans";
@@ -26,6 +31,41 @@ in {
description = "Log level for the oott service";
default = "info";
};
timings.wait_between_scans = mkOption {
type = types.str;
description = "Wait time between scans. This does not include the scan time.";
default = "15m";
};
timings.arp_sender_timeout = mkOption {
type = types.str;
description = "If the ARP sender process takes longer than this it will be stopped (for a class C network - 254 IPs - it should take less than a minute).";
default = "1m";
};
timings.arp_scan_duration = mkOption {
type = types.str;
description = "How long to wait for response packets on each scan (5m to 10m is a good timeframe for a class B or C network).";
default = "10m";
};
notifications.method = mkOption {
type = types.str;
description = "For now just pushover, you can set this to none to avoid sending notifications (it will just log).";
default = "pushover";
};
notifications.notify_when_not_seen_for = mkOption {
type = types.str;
description = "Send a notification if a device comes back online after not being seen for this timeframe.";
default = "1w";
};
notifications.pushover.token = mkOption {
type = types.str;
description = "Your pushover token goes here, just copy&paste from their website after creating the app.";
default = "";
};
notifications.pushover.user_key = mkOption {
type = types.str;
description = "User key goes here, this is the account wide code for pushover.";
default = "";
};
};
# Service implementation
@@ -36,11 +76,10 @@ in {
wantedBy = ["multi-user.target"];
serviceConfig = {
ExecStart = "${pkgs.oott}/bin/oott ${
ExecStart = "${pkgs.oott}/bin/oott --config ${
builtins.toFile "oott.json"
(generators.toJSON {} cfg)
}";
# ExecStart = "${pkgs.oott}/bin/oott";
ProtectHome = "read-only";
Restart = "on-failure";
Type = "exec";