Unverified Commit 20396156 authored by Sokhibjon Orzikulov's avatar Sokhibjon Orzikulov
Browse files

e-imzo: initialize module



e-imzo: (fix, to be squashed) formatted accordingly using `nixfmt`
e-imzo: (fix, to be squashed) removed lib from options by @ FliegendeWurst
e-imzo: (fix, to be squashed) use lib.getExe as mainProgram is defined by @FliegendeWurst
e-imzo: (fix, to be squashed) formatted with `nixfmt-rfc-style` suggestion by @FliegendeWurst
Co-Authored-By: default avatarArne Keller <arne.keller@posteo.de>
parent 9f208a0d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1394,6 +1394,7 @@
  ./services/security/certmgr.nix
  ./services/security/cfssl.nix
  ./services/security/clamav.nix
  ./services/security/e-imzo.nix
  ./services/security/endlessh-go.nix
  ./services/security/endlessh.nix
  ./services/security/esdm.nix
+50 −0
Original line number Diff line number Diff line
{
  config,
  lib,
  pkgs,
  ...
}:
let
  cfg = config.services.e-imzo;
in
{
  options = {
    services.e-imzo = {
      enable = lib.mkEnableOption "E-IMZO";

      package = lib.mkPackageOption pkgs "e-imzo" {
        extraDescription = "Official mirror deletes old versions as soon as they release new one. Feel free to use either unstable or your own custom e-imzo package and ping maintainer.";
      };
    };
  };

  config = lib.mkIf cfg.enable {
    systemd.user.services.e-imzo = {
      enable = true;
      description = "E-IMZO, uzbek state web signing service";
      documentation = [ "https://github.com/xinux-org/e-imzo" ];

      after = [
        "network-online.target"
        "graphical.target"
      ];
      wants = [
        "network-online.target"
        "graphical.target"
      ];
      wantedBy = [ "default.target" ];

      serviceConfig = {
        Type = "simple";
        Restart = "always";
        RestartSec = 1;
        ExecStart = lib.getExe cfg.package;

        NoNewPrivileges = true;
        SystemCallArchitectures = "native";
      };
    };
  };

  meta.maintainers = with lib.maintainers; [ orzklv ];
}