update flake, add module

This commit is contained in:
Jonas Heinrich 2024-12-26 16:26:51 +01:00
parent 1c5b52eab0
commit 7ce1a3ab3a
5 changed files with 172 additions and 48 deletions

50
module.nix Normal file
View file

@ -0,0 +1,50 @@
{config, lib, pkgs, ...}:
with lib;
let
cfg = config.services.eintopf-radar-sync;
in
{
options = {
services.eintopf-radar-sync = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Enable eintopf-radar-sync daemon.
'';
};
};
};
config = mkIf cfg.enable {
systemd.services."eintopf-radar-sync" = {
description = "eintopf-radar-sync script";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
environment.PYTHONUNBUFFERED = "1";
serviceConfig = {
ExecStart = "${pkgs.iwd-autocaptiveauth}/bin/iwd-autocaptiveauth --profileDir ${pkgs.iwd-autocaptiveauth}/profiles";
Restart = "on-failure";
User = "iwd-autocaptiveauth";
RestartSec = 30;
WorkingDirectory = ''${pkgs.iwd-autocaptiveauth}/'';
};
restartIfChanged = true;
};
};
meta = {
maintainers = with lib.maintainers; [ onny ];
};
}