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: Arne Keller <arne.keller@posteo.de>

Changed files
+51
nixos
modules
services
security
+1
nixos/modules/module-list.nix
···
./services/security/certmgr.nix
./services/security/cfssl.nix
./services/security/clamav.nix
./services/security/endlessh-go.nix
./services/security/endlessh.nix
./services/security/esdm.nix
···
./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
nixos/modules/services/security/e-imzo.nix
···
···
+
{
+
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 ];
+
}