mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-06-08 18:09:06 +02:00
feat: init codeberg-pages
This commit is contained in:
parent
fcf3a99814
commit
c4c476f56e
4 changed files with 1632 additions and 0 deletions
66
modules/codeberg-pages/default.nix
Normal file
66
modules/codeberg-pages/default.nix
Normal file
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.codeberg-pages;
|
||||
in
|
||||
{
|
||||
|
||||
options = {
|
||||
services.codeberg-pages = {
|
||||
enable = mkEnableOption "Codeberg pages server";
|
||||
|
||||
package = mkPackageOption pkgs "codeberg-pages" { };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = lib.types.submodule { freeformType = with lib.types; attrsOf str; };
|
||||
default = { };
|
||||
example = { };
|
||||
description = ''
|
||||
Configuration for the codeberg page server, see
|
||||
<https://codeberg.org/Codeberg/pages-server>
|
||||
for supported values.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
systemd.services.codeberg-pages = {
|
||||
description = "Codeberg pages server";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
environment = cfg.settings;
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
StateDirectory = "codeberg-pages";
|
||||
WorkingDirectory = "/var/lib/codeberg-pages";
|
||||
DynamicUser = true;
|
||||
ExecStart = "${cfg.package}/bin/pages";
|
||||
Restart = "on-failure";
|
||||
ProtectHome = true;
|
||||
ProtectSystem = "strict";
|
||||
PrivateTmp = true;
|
||||
PrivateDevices = true;
|
||||
ProtectHostname = true;
|
||||
ProtectClock = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectKernelLogs = true;
|
||||
ProtectControlGroups = true;
|
||||
NoNewPrivileges = true;
|
||||
RestrictRealtime = true;
|
||||
RestrictSUIDSGID = true;
|
||||
RemoveIPC = true;
|
||||
PrivateMounts = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue