infra/services/nur-update/default.nix
zowoq 86ac03df56 add nur-update service
Flake lock file updates:

• Added input 'nur-update':
    'github:nix-community/nur-update/5e86794950e8061b6e19040f96cc2620c29e922e' (2022-12-10)
• Added input 'nur-update/nixpkgs':
    follows 'nixpkgs'
2022-12-23 09:18:49 +01:00

31 lines
965 B
Nix

{ nur-update }: { config, lib, pkgs, ... }:
{
services.nginx.virtualHosts."nur-update.nix-community.org" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://unix:/run/nur-update/gunicorn.sock";
};
sops.secrets.nur-update-github-token = { };
systemd.services.nur-update = {
description = "nur-update service";
script = ''
GITHUB_TOKEN="$(<$CREDENTIALS_DIRECTORY/github-token)" \
${lib.getExe pkgs.python3.pkgs.gunicorn} nur_update:app \
--bind unix:/run/nur-update/gunicorn.sock \
--log-level info \
--python-path ${nur-update.packages.${pkgs.system}.default} \
--timeout 30 \
--workers 3
'';
serviceConfig = {
DynamicUser = true;
LoadCredential = [ "github-token:${config.sops.secrets.nur-update-github-token.path}" ];
Restart = "always";
RuntimeDirectory = "nur-update";
};
wantedBy = [ "multi-user.target" ];
};
}