summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/network-filesystems/a2boot.nix
blob: 7c2670700f893b6958c288f3327b7f4d8e261b55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
  config,
  pkgs,
  lib,
  ...
}:
let
  cfg = config.services.a2boot;
in
{
  options.services.a2boot = {
    enable = lib.mkEnableOption "the a2boot daemon";
  };

  config = lib.mkIf cfg.enable {
    systemd.services.netatalk.partOf = [ "a2boot.service" ];
    systemd.services.a2boot = {
      description = "a2boot daemon";
      unitConfig.Documentation = "man:a2boot(8)";
      after = [
        "network.target"
        "netatalk.service"
      ];
      wantedBy = [ "multi-user.target" ];

      path = [ pkgs.netatalk ];

      serviceConfig = {
        Type = "forking";
        DynamicUser = true;
        RuntimeDirectory = "a2boot";
        ExecStart = "${pkgs.netatalk}/bin/a2boot";
        Restart = "always";
      };
    };
  };
  meta.maintainers = with lib.maintainers; [ matthewcroughan ];
}