mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 04:05:40 +03:00

After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
110 lines
2.4 KiB
Nix
110 lines
2.4 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
inherit (lib)
|
|
mkEnableOption
|
|
mkIf
|
|
mkOption
|
|
types
|
|
literalExpression
|
|
;
|
|
|
|
cfg = config.services.isso;
|
|
|
|
settingsFormat = pkgs.formats.ini { };
|
|
configFile = settingsFormat.generate "isso.conf" cfg.settings;
|
|
in
|
|
{
|
|
|
|
options = {
|
|
services.isso = {
|
|
enable = mkEnableOption ''
|
|
isso, a commenting server similar to Disqus.
|
|
|
|
Note: The application's author suppose to run isso behind a reverse proxy.
|
|
The embedded solution offered by NixOS is also only suitable for small installations
|
|
below 20 requests per second
|
|
'';
|
|
|
|
settings = mkOption {
|
|
description = ''
|
|
Configuration for `isso`.
|
|
|
|
See [Isso Server Configuration](https://posativ.org/isso/docs/configuration/server/)
|
|
for supported values.
|
|
'';
|
|
|
|
type = types.submodule {
|
|
freeformType = settingsFormat.type;
|
|
};
|
|
|
|
example = literalExpression ''
|
|
{
|
|
general = {
|
|
host = "http://localhost";
|
|
};
|
|
}
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.isso.settings.general.dbpath = lib.mkDefault "/var/lib/isso/comments.db";
|
|
|
|
systemd.services.isso = {
|
|
description = "isso, a commenting server similar to Disqus";
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
User = "isso";
|
|
Group = "isso";
|
|
|
|
DynamicUser = true;
|
|
|
|
StateDirectory = "isso";
|
|
|
|
ExecStart = ''
|
|
${pkgs.isso}/bin/isso -c ${configFile}
|
|
'';
|
|
|
|
Restart = "on-failure";
|
|
RestartSec = 1;
|
|
|
|
# Hardening
|
|
CapabilityBoundingSet = [ "" ];
|
|
DeviceAllow = [ "" ];
|
|
LockPersonality = true;
|
|
PrivateDevices = true;
|
|
PrivateUsers = true;
|
|
ProcSubset = "pid";
|
|
ProtectClock = true;
|
|
ProtectControlGroups = true;
|
|
ProtectHome = true;
|
|
ProtectHostname = true;
|
|
ProtectKernelLogs = true;
|
|
ProtectKernelModules = true;
|
|
ProtectKernelTunables = true;
|
|
ProtectProc = "invisible";
|
|
RestrictAddressFamilies = [
|
|
"AF_INET"
|
|
"AF_INET6"
|
|
];
|
|
RestrictNamespaces = true;
|
|
RestrictRealtime = true;
|
|
SystemCallArchitectures = "native";
|
|
SystemCallFilter = [
|
|
"@system-service"
|
|
"~@privileged"
|
|
"~@resources"
|
|
];
|
|
UMask = "0077";
|
|
};
|
|
};
|
|
};
|
|
}
|