sourcehut.*: update (#404203)
This commit is contained in:
@@ -97,13 +97,14 @@ let
|
||||
# Those paths are mounted using BindPaths= or BindReadOnlyPaths=
|
||||
# for services needing access to them.
|
||||
"builds.sr.ht::worker".buildlogs = "/var/log/sourcehut/buildsrht-worker";
|
||||
"git.sr.ht".post-update-script = "/usr/bin/gitsrht-update-hook";
|
||||
"git.sr.ht".post-update-script = "/usr/bin/git.sr.ht-update-hook";
|
||||
"git.sr.ht".repos = cfg.settings."git.sr.ht".repos;
|
||||
"hg.sr.ht".changegroup-script = "/usr/bin/hgsrht-hook-changegroup";
|
||||
"hg.sr.ht".changegroup-script = "/usr/bin/hg.sr.ht-hook-changegroup";
|
||||
"hg.sr.ht".repos = cfg.settings."hg.sr.ht".repos;
|
||||
# Making this a per service option despite being in a global section,
|
||||
# so that it uses the redis-server used by the service.
|
||||
"sr.ht".redis-host = cfg.${srv}.redis.host;
|
||||
"sr.ht".assets = "${cfg.${srv}.package}/share/sourcehut";
|
||||
}
|
||||
)
|
||||
)
|
||||
@@ -376,7 +377,7 @@ in
|
||||
redis = mkOption {
|
||||
description = "The Redis connection used for the Celery worker.";
|
||||
type = types.str;
|
||||
default = "redis+socket:///run/redis-sourcehut-buildsrht/redis.sock?virtual_host=2";
|
||||
default = "redis+socket:///run/redis-sourcehut-builds.sr.ht/redis.sock?virtual_host=2";
|
||||
};
|
||||
shell = mkOption {
|
||||
description = ''
|
||||
@@ -436,8 +437,8 @@ in
|
||||
This setting is propagated to newer and existing repositories.
|
||||
'';
|
||||
type = types.path;
|
||||
default = "${pkgs.sourcehut.gitsrht}/bin/gitsrht-update-hook";
|
||||
defaultText = "\${pkgs.sourcehut.gitsrht}/bin/gitsrht-update-hook";
|
||||
default = "${cfg.git.package}/bin/git.sr.ht-update-hook";
|
||||
defaultText = "\${pkgs.sourcehut.gitsrht}/bin/git.sr.ht-update-hook";
|
||||
};
|
||||
repos = mkOption {
|
||||
description = ''
|
||||
@@ -446,12 +447,12 @@ in
|
||||
the gitsrht's user as read and write access to it.
|
||||
'';
|
||||
type = types.str;
|
||||
default = "/var/lib/sourcehut/gitsrht/repos";
|
||||
default = "/var/lib/sourcehut/git.sr.ht/repos";
|
||||
};
|
||||
webhooks = mkOption {
|
||||
description = "The Redis connection used for the webhooks worker.";
|
||||
type = types.str;
|
||||
default = "redis+socket:///run/redis-sourcehut-gitsrht/redis.sock?virtual_host=1";
|
||||
default = "redis+socket:///run/redis-sourcehut-git.sr.ht/redis.sock?virtual_host=1";
|
||||
};
|
||||
};
|
||||
options."git.sr.ht::api" = {
|
||||
@@ -477,8 +478,8 @@ in
|
||||
This setting is propagated to newer and existing repositories.
|
||||
'';
|
||||
type = types.str;
|
||||
default = "${pkgs.sourcehut.hgsrht}/bin/hgsrht-hook-changegroup";
|
||||
defaultText = "\${pkgs.sourcehut.hgsrht}/bin/hgsrht-hook-changegroup";
|
||||
default = "${cfg.hg.package}/bin/hg.sr.ht-hook-changegroup";
|
||||
defaultText = "\${pkgs.sourcehut.hgsrht}/bin/hg.sr.ht-hook-changegroup";
|
||||
};
|
||||
repos = mkOption {
|
||||
description = ''
|
||||
@@ -487,7 +488,7 @@ in
|
||||
the hgsrht's user as read and write access to it.
|
||||
'';
|
||||
type = types.str;
|
||||
default = "/var/lib/sourcehut/hgsrht/repos";
|
||||
default = "/var/lib/sourcehut/hg.sr.ht/repos";
|
||||
};
|
||||
srhtext = mkOptionNullOrStr ''
|
||||
Path to the srht mercurial extension
|
||||
@@ -507,7 +508,7 @@ in
|
||||
webhooks = mkOption {
|
||||
description = "The Redis connection used for the webhooks worker.";
|
||||
type = types.str;
|
||||
default = "redis+socket:///run/redis-sourcehut-hgsrht/redis.sock?virtual_host=1";
|
||||
default = "redis+socket:///run/redis-sourcehut-hg.sr.ht/redis.sock?virtual_host=1";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -529,12 +530,12 @@ in
|
||||
redis = mkOption {
|
||||
description = "The Redis connection used for the Celery worker.";
|
||||
type = types.str;
|
||||
default = "redis+socket:///run/redis-sourcehut-listssrht/redis.sock?virtual_host=2";
|
||||
default = "redis+socket:///run/redis-sourcehut-lists.sr.ht/redis.sock?virtual_host=2";
|
||||
};
|
||||
webhooks = mkOption {
|
||||
description = "The Redis connection used for the webhooks worker.";
|
||||
type = types.str;
|
||||
default = "redis+socket:///run/redis-sourcehut-listssrht/redis.sock?virtual_host=1";
|
||||
default = "redis+socket:///run/redis-sourcehut-lists.sr.ht/redis.sock?virtual_host=1";
|
||||
};
|
||||
};
|
||||
options."lists.sr.ht::worker" = {
|
||||
@@ -584,7 +585,7 @@ in
|
||||
webhooks = mkOption {
|
||||
description = "The Redis connection used for the webhooks worker.";
|
||||
type = types.str;
|
||||
default = "redis+socket:///run/redis-sourcehut-metasrht/redis.sock?virtual_host=1";
|
||||
default = "redis+socket:///run/redis-sourcehut-meta.sr.ht/redis.sock?virtual_host=1";
|
||||
};
|
||||
welcome-emails = mkEnableOption "sending stock sourcehut welcome emails after signup";
|
||||
};
|
||||
@@ -691,7 +692,7 @@ in
|
||||
webhooks = mkOption {
|
||||
description = "The Redis connection used for the webhooks worker.";
|
||||
type = types.str;
|
||||
default = "redis+socket:///run/redis-sourcehut-todosrht/redis.sock?virtual_host=1";
|
||||
default = "redis+socket:///run/redis-sourcehut-todo.sr.ht/redis.sock?virtual_host=1";
|
||||
};
|
||||
};
|
||||
options."todo.sr.ht::mail" = {
|
||||
@@ -763,7 +764,7 @@ in
|
||||
};
|
||||
|
||||
git = {
|
||||
package = mkPackageOption pkgs "git" {
|
||||
gitPackage = mkPackageOption pkgs "git" {
|
||||
example = "gitFull";
|
||||
};
|
||||
fcgiwrap.preforkProcess = mkOption {
|
||||
@@ -774,7 +775,7 @@ in
|
||||
};
|
||||
|
||||
hg = {
|
||||
package = mkPackageOption pkgs "mercurial" { };
|
||||
mercurialPackage = mkPackageOption pkgs "mercurial" { };
|
||||
cloneBundles = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
@@ -806,6 +807,7 @@ in
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
# TODO: make configurable
|
||||
environment.systemPackages = [ pkgs.sourcehut.coresrht ];
|
||||
|
||||
services.sourcehut.settings = {
|
||||
@@ -875,14 +877,14 @@ in
|
||||
set -e
|
||||
set -x
|
||||
cd /etc/ssh/sourcehut/subdir
|
||||
${pkgs.sourcehut.gitsrht}/bin/gitsrht-dispatch "$@"
|
||||
${cfg.git.package}/bin/git.sr.ht-dispatch "$@"
|
||||
'';
|
||||
};
|
||||
systemd.tmpfiles.settings."10-sourcehut-gitsrht" = mkIf cfg.git.enable (mkMerge [
|
||||
(builtins.listToAttrs (
|
||||
map
|
||||
(name: {
|
||||
name = "/var/log/sourcehut/gitsrht-${name}";
|
||||
name = "/var/log/sourcehut/git.sr.ht-${name}";
|
||||
value.f = {
|
||||
inherit (cfg.git) user group;
|
||||
mode = "0644";
|
||||
@@ -903,7 +905,7 @@ in
|
||||
]);
|
||||
systemd.services.sshd = {
|
||||
preStart = mkIf cfg.hg.enable ''
|
||||
chown ${cfg.hg.user}:${cfg.hg.group} /var/log/sourcehut/hgsrht-keys
|
||||
chown ${cfg.hg.user}:${cfg.hg.group} /var/log/sourcehut/hg.sr.ht-keys
|
||||
'';
|
||||
serviceConfig = {
|
||||
LogsDirectory = "sourcehut";
|
||||
@@ -919,62 +921,62 @@ in
|
||||
"${pkgs.writeShellScript "buildsrht-keys-wrapper" ''
|
||||
set -e
|
||||
cd /run/sourcehut/buildsrht/subdir
|
||||
exec -a "$0" ${pkgs.sourcehut.buildsrht}/bin/buildsrht-keys "$@"
|
||||
exec -a "$0" ${cfg.builds.package}/bin/builds.sr.ht-keys "$@"
|
||||
''}:/usr/bin/buildsrht-keys"
|
||||
"${pkgs.sourcehut.buildsrht}/bin/master-shell:/usr/bin/master-shell"
|
||||
"${pkgs.sourcehut.buildsrht}/bin/runner-shell:/usr/bin/runner-shell"
|
||||
"${cfg.builds.package}/bin/master-shell:/usr/bin/master-shell"
|
||||
"${cfg.builds.package}/bin/runner-shell:/usr/bin/runner-shell"
|
||||
]
|
||||
++ optionals cfg.git.enable [
|
||||
# /path/to/gitsrht-keys calls /path/to/gitsrht-shell,
|
||||
# or [git.sr.ht] shell= if set.
|
||||
"${pkgs.writeShellScript "gitsrht-keys-wrapper" ''
|
||||
set -e
|
||||
cd /run/sourcehut/gitsrht/subdir
|
||||
exec -a "$0" ${pkgs.sourcehut.gitsrht}/bin/gitsrht-keys "$@"
|
||||
''}:/usr/bin/gitsrht-keys"
|
||||
cd /run/sourcehut/git.sr.ht/subdir
|
||||
exec -a "$0" ${cfg.git.package}/bin/git.sr.ht-keys "$@"
|
||||
''}:/usr/bin/git.sr.ht-keys"
|
||||
"${pkgs.writeShellScript "gitsrht-shell-wrapper" ''
|
||||
set -e
|
||||
cd /run/sourcehut/gitsrht/subdir
|
||||
export PATH="${cfg.git.package}/bin:$PATH"
|
||||
export SRHT_CONFIG=/run/sourcehut/gitsrht/config.ini
|
||||
exec -a "$0" ${pkgs.sourcehut.gitsrht}/bin/gitsrht-shell "$@"
|
||||
''}:/usr/bin/gitsrht-shell"
|
||||
cd /run/sourcehut/git.sr.ht/subdir
|
||||
export PATH="${cfg.git.gitPackage}/bin:$PATH"
|
||||
export SRHT_CONFIG=/run/sourcehut/git.sr.ht/config.ini
|
||||
exec -a "$0" ${cfg.git.package}/bin/git.sr.ht-shell "$@"
|
||||
''}:/usr/bin/git.sr.ht-shell"
|
||||
"${pkgs.writeShellScript "gitsrht-update-hook" ''
|
||||
set -e
|
||||
export SRHT_CONFIG=/run/sourcehut/gitsrht/config.ini
|
||||
export SRHT_CONFIG=/run/sourcehut/git.sr.ht/config.ini
|
||||
# hooks/post-update calls /usr/bin/gitsrht-update-hook as hooks/stage-3
|
||||
# but this wrapper being a bash script, it overrides $0 with /usr/bin/gitsrht-update-hook
|
||||
# hence this hack to put hooks/stage-3 back into gitsrht-update-hook's $0
|
||||
if test "''${STAGE3:+set}"
|
||||
then
|
||||
exec -a hooks/stage-3 ${pkgs.sourcehut.gitsrht}/bin/gitsrht-update-hook "$@"
|
||||
exec -a hooks/stage-3 ${cfg.git.package}/bin/git.sr.ht-update-hook "$@"
|
||||
else
|
||||
export STAGE3=set
|
||||
exec -a "$0" ${pkgs.sourcehut.gitsrht}/bin/gitsrht-update-hook "$@"
|
||||
exec -a "$0" ${cfg.git.package}/bin/git.sr.ht-update-hook "$@"
|
||||
fi
|
||||
''}:/usr/bin/gitsrht-update-hook"
|
||||
''}:/usr/bin/git.sr.ht-update-hook"
|
||||
]
|
||||
++ optionals cfg.hg.enable [
|
||||
# /path/to/hgsrht-keys calls /path/to/hgsrht-shell,
|
||||
# or [hg.sr.ht] shell= if set.
|
||||
"${pkgs.writeShellScript "hgsrht-keys-wrapper" ''
|
||||
set -e
|
||||
cd /run/sourcehut/hgsrht/subdir
|
||||
exec -a "$0" ${pkgs.sourcehut.hgsrht}/bin/hgsrht-keys "$@"
|
||||
''}:/usr/bin/hgsrht-keys"
|
||||
"${pkgs.writeShellScript "hgsrht-shell-wrapper" ''
|
||||
cd /run/sourcehut/hg.sr.ht/subdir
|
||||
exec -a "$0" ${cfg.hg.package}/bin/hg.sr.ht-keys "$@"
|
||||
''}:/usr/bin/hg.sr.ht-keys"
|
||||
"${pkgs.writeShellScript "hg.sr.ht-shell-wrapper" ''
|
||||
set -e
|
||||
cd /run/sourcehut/hgsrht/subdir
|
||||
exec -a "$0" ${pkgs.sourcehut.hgsrht}/bin/hgsrht-shell "$@"
|
||||
''}:/usr/bin/hgsrht-shell"
|
||||
cd /run/sourcehut/hg.sr.ht/subdir
|
||||
exec -a "$0" ${cfg.hg.package}/bin/hg.sr.ht-shell "$@"
|
||||
''}:/usr/bin/hg.sr.ht-shell"
|
||||
# Mercurial's changegroup hooks are run relative to their repository's directory,
|
||||
# but hgsrht-hook-changegroup looks up ./config.ini
|
||||
"${pkgs.writeShellScript "hgsrht-hook-changegroup" ''
|
||||
set -e
|
||||
test -e "''$PWD"/config.ini ||
|
||||
ln -s /run/sourcehut/hgsrht/config.ini "''$PWD"/config.ini
|
||||
exec -a "$0" ${pkgs.sourcehut.hgsrht}/bin/hgsrht-hook-changegroup "$@"
|
||||
''}:/usr/bin/hgsrht-hook-changegroup"
|
||||
ln -s /run/sourcehut/hg.sr.ht/config.ini "''$PWD"/config.ini
|
||||
exec -a "$0" ${cfg.hg.package}/bin/hg.sr.ht-hook-changegroup "$@"
|
||||
''}:/usr/bin/hg.sr.ht-hook-changegroup"
|
||||
];
|
||||
};
|
||||
};
|
||||
@@ -985,17 +987,17 @@ in
|
||||
|
||||
(import ./service.nix "builds" {
|
||||
inherit configIniOfService;
|
||||
srvsrht = "buildsrht";
|
||||
pkgname = "buildsrht";
|
||||
port = 5002;
|
||||
extraServices.buildsrht-api = {
|
||||
extraServices."build.sr.ht-api" = {
|
||||
serviceConfig.Restart = "always";
|
||||
serviceConfig.RestartSec = "5s";
|
||||
serviceConfig.ExecStart = "${pkgs.sourcehut.buildsrht}/bin/buildsrht-api -b ${cfg.listenAddress}:${
|
||||
serviceConfig.ExecStart = "${cfg.builds.package}/bin/builds.sr.ht-api -b ${cfg.listenAddress}:${
|
||||
toString (cfg.builds.port + 100)
|
||||
}";
|
||||
};
|
||||
# TODO: a celery worker on the master and worker are apparently needed
|
||||
extraServices.buildsrht-worker =
|
||||
extraServices."build.sr.ht-worker" =
|
||||
let
|
||||
qemuPackage = pkgs.qemu_kvm;
|
||||
serviceName = "buildsrht-worker";
|
||||
@@ -1024,7 +1026,7 @@ in
|
||||
fi
|
||||
'';
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.sourcehut.buildsrht}/bin/buildsrht-worker";
|
||||
ExecStart = "${cfg.builds.package}/bin/builds.sr.ht-worker";
|
||||
BindPaths = [ cfg.settings."builds.sr.ht::worker".buildlogs ];
|
||||
LogsDirectory = [ "sourcehut/${serviceName}" ];
|
||||
RuntimeDirectory = [ "sourcehut/${serviceName}/subdir" ];
|
||||
@@ -1055,7 +1057,7 @@ in
|
||||
name = "buildsrht-worker-images-pre";
|
||||
paths = image_dirs;
|
||||
# FIXME: not working, apparently because ubuntu/latest is a broken link
|
||||
# ++ [ "${pkgs.sourcehut.buildsrht}/lib/images" ];
|
||||
# ++ [ "${cfg.builds.package}/lib/images" ];
|
||||
};
|
||||
image_dir = pkgs.runCommand "buildsrht-worker-images" { } ''
|
||||
mkdir -p $out/images
|
||||
@@ -1072,7 +1074,7 @@ in
|
||||
{
|
||||
# Note that git.sr.ht::dispatch is not a typo,
|
||||
# gitsrht-dispatch always use this section
|
||||
"git.sr.ht::dispatch"."/usr/bin/buildsrht-keys" =
|
||||
"git.sr.ht::dispatch"."/usr/bin/builds.sr.ht-keys" =
|
||||
mkDefault "${cfg.builds.user}:${cfg.builds.group}";
|
||||
}
|
||||
(mkIf cfg.builds.enableWorker {
|
||||
@@ -1113,8 +1115,10 @@ in
|
||||
(import ./service.nix "git" (
|
||||
let
|
||||
baseService = {
|
||||
path = [ cfg.git.package ];
|
||||
serviceConfig.BindPaths = [ "${cfg.settings."git.sr.ht".repos}:/var/lib/sourcehut/gitsrht/repos" ];
|
||||
path = [ cfg.git.gitPackage ];
|
||||
serviceConfig.BindPaths = [
|
||||
"${cfg.settings."git.sr.ht".repos}:/var/lib/sourcehut/git.sr.ht/repos"
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
@@ -1123,23 +1127,23 @@ in
|
||||
baseService
|
||||
{
|
||||
serviceConfig.StateDirectory = [
|
||||
"sourcehut/gitsrht"
|
||||
"sourcehut/gitsrht/repos"
|
||||
"sourcehut/git.sr.ht"
|
||||
"sourcehut/git.sr.ht/repos"
|
||||
];
|
||||
preStart = mkIf (versionOlder config.system.stateVersion "22.05") (mkBefore ''
|
||||
# Fix Git hooks of repositories pre-dating https://github.com/NixOS/nixpkgs/pull/133984
|
||||
(
|
||||
set +f
|
||||
shopt -s nullglob
|
||||
for h in /var/lib/sourcehut/gitsrht/repos/~*/*/hooks/{pre-receive,update,post-update}
|
||||
do ln -fnsv /usr/bin/gitsrht-update-hook "$h"; done
|
||||
for h in /var/lib/sourcehut/git.sr.ht/repos/~*/*/hooks/{pre-receive,update,post-update}
|
||||
do ln -fnsv /usr/bin/git.sr.ht-update-hook "$h"; done
|
||||
)
|
||||
'');
|
||||
}
|
||||
];
|
||||
port = 5001;
|
||||
webhooks = true;
|
||||
extraTimers.gitsrht-periodic = {
|
||||
extraTimers."git.sr.ht-periodic" = {
|
||||
service = baseService;
|
||||
timerConfig.OnCalendar = [ "*:0/20" ];
|
||||
};
|
||||
@@ -1149,7 +1153,7 @@ in
|
||||
# Probably could use gitsrht-shell if output is restricted to just parameters...
|
||||
users.users.${cfg.git.user}.shell = pkgs.bash;
|
||||
services.sourcehut.settings = {
|
||||
"git.sr.ht::dispatch"."/usr/bin/gitsrht-keys" = mkDefault "${cfg.git.user}:${cfg.git.group}";
|
||||
"git.sr.ht::dispatch"."/usr/bin/git.sr.ht-keys" = mkDefault "${cfg.git.user}:${cfg.git.group}";
|
||||
};
|
||||
systemd.services.sshd = baseService;
|
||||
}
|
||||
@@ -1164,49 +1168,50 @@ in
|
||||
'';
|
||||
};
|
||||
locations."~ ^/([^/]+)/([^/]+)/(HEAD|info/refs|objects/info/.*|git-upload-pack).*$" = {
|
||||
root = "/var/lib/sourcehut/gitsrht/repos";
|
||||
root = "/var/lib/sourcehut/git.sr.ht/repos";
|
||||
fastcgiParams = {
|
||||
GIT_HTTP_EXPORT_ALL = "";
|
||||
GIT_PROJECT_ROOT = "$document_root";
|
||||
PATH_INFO = "$uri";
|
||||
SCRIPT_FILENAME = "${cfg.git.package}/bin/git-http-backend";
|
||||
SCRIPT_FILENAME = "${cfg.git.gitPackage}/bin/git-http-backend";
|
||||
};
|
||||
extraConfig = ''
|
||||
auth_request /authorize;
|
||||
fastcgi_read_timeout 500s;
|
||||
fastcgi_pass unix:/run/gitsrht-fcgiwrap.sock;
|
||||
fastcgi_pass unix:/run/git.sr.ht-fcgiwrap.sock;
|
||||
gzip off;
|
||||
'';
|
||||
};
|
||||
};
|
||||
systemd.sockets.gitsrht-fcgiwrap = {
|
||||
systemd.sockets."git.sr.ht-fcgiwrap" = {
|
||||
before = [ "nginx.service" ];
|
||||
wantedBy = [
|
||||
"sockets.target"
|
||||
"gitsrht.service"
|
||||
"git.sr.ht.service"
|
||||
];
|
||||
# This path remains accessible to nginx.service, which has no RootDirectory=
|
||||
socketConfig.ListenStream = "/run/gitsrht-fcgiwrap.sock";
|
||||
socketConfig.ListenStream = "/run/git.sr.ht-fcgiwrap.sock";
|
||||
socketConfig.SocketUser = nginx.user;
|
||||
socketConfig.SocketMode = "600";
|
||||
};
|
||||
})
|
||||
];
|
||||
extraServices.gitsrht-api.serviceConfig = {
|
||||
extraServices."git.sr.ht-api".serviceConfig = {
|
||||
Restart = "always";
|
||||
RestartSec = "5s";
|
||||
ExecStart = "${pkgs.sourcehut.gitsrht}/bin/gitsrht-api -b ${cfg.listenAddress}:${toString (cfg.git.port + 100)}";
|
||||
BindPaths = [ "${cfg.settings."git.sr.ht".repos}:/var/lib/sourcehut/gitsrht/repos" ];
|
||||
ExecStart = "${cfg.git.package}/bin/git.sr.ht-api -b ${cfg.listenAddress}:${toString (cfg.git.port + 100)}";
|
||||
BindPaths = [ "${cfg.settings."git.sr.ht".repos}:/var/lib/sourcehut/git.sr.ht/repos" ];
|
||||
};
|
||||
extraServices.gitsrht-fcgiwrap = mkIf cfg.nginx.enable {
|
||||
extraServices."git.sr.ht-fcgiwrap" = mkIf cfg.nginx.enable {
|
||||
serviceConfig = {
|
||||
# Socket is passed by gitsrht-fcgiwrap.socket
|
||||
ExecStart = "${pkgs.fcgiwrap}/sbin/fcgiwrap -c ${toString cfg.git.fcgiwrap.preforkProcess}";
|
||||
ExecStart = "${pkgs.fcgiwrap}/bin/fcgiwrap -c ${toString cfg.git.fcgiwrap.preforkProcess}";
|
||||
# No need for config.ini
|
||||
ExecStartPre = mkForce [ ];
|
||||
User = null;
|
||||
DynamicUser = true;
|
||||
BindReadOnlyPaths = [ "${cfg.settings."git.sr.ht".repos}:/var/lib/sourcehut/gitsrht/repos" ];
|
||||
# FIXME: Fails to start with dynamic user
|
||||
# User = null;
|
||||
# DynamicUser = true;
|
||||
BindReadOnlyPaths = [ "${cfg.settings."git.sr.ht".repos}:/var/lib/sourcehut/git.sr.ht/repos" ];
|
||||
IPAddressDeny = "any";
|
||||
InaccessiblePaths = [
|
||||
"-+/run/postgresql"
|
||||
@@ -1232,8 +1237,8 @@ in
|
||||
(import ./service.nix "hg" (
|
||||
let
|
||||
baseService = {
|
||||
path = [ cfg.hg.package ];
|
||||
serviceConfig.BindPaths = [ "${cfg.settings."hg.sr.ht".repos}:/var/lib/sourcehut/hgsrht/repos" ];
|
||||
path = [ cfg.hg.mercurialPackage ];
|
||||
serviceConfig.BindPaths = [ "${cfg.settings."hg.sr.ht".repos}:/var/lib/sourcehut/hg.sr.ht/repos" ];
|
||||
};
|
||||
in
|
||||
{
|
||||
@@ -1242,26 +1247,26 @@ in
|
||||
baseService
|
||||
{
|
||||
serviceConfig.StateDirectory = [
|
||||
"sourcehut/hgsrht"
|
||||
"sourcehut/hgsrht/repos"
|
||||
"sourcehut/hg.sr.ht"
|
||||
"sourcehut/hg.sr.ht/repos"
|
||||
];
|
||||
}
|
||||
];
|
||||
port = 5010;
|
||||
webhooks = true;
|
||||
extraTimers.hgsrht-periodic = {
|
||||
extraTimers."hg.sr.ht-periodic" = {
|
||||
service = baseService;
|
||||
timerConfig.OnCalendar = [ "*:0/20" ];
|
||||
};
|
||||
extraTimers.hgsrht-clonebundles = mkIf cfg.hg.cloneBundles {
|
||||
extraTimers."hg.sr.ht-clonebundles" = mkIf cfg.hg.cloneBundles {
|
||||
service = baseService;
|
||||
timerConfig.OnCalendar = [ "daily" ];
|
||||
timerConfig.AccuracySec = "1h";
|
||||
};
|
||||
extraServices.hgsrht-api = {
|
||||
extraServices."hg.sr.ht-api" = {
|
||||
serviceConfig.Restart = "always";
|
||||
serviceConfig.RestartSec = "5s";
|
||||
serviceConfig.ExecStart = "${pkgs.sourcehut.hgsrht}/bin/hgsrht-api -b ${cfg.listenAddress}:${toString (cfg.hg.port + 100)}";
|
||||
serviceConfig.ExecStart = "${cfg.hgsrht.package}/bin/hg.sr.ht-api -b ${cfg.listenAddress}:${toString (cfg.hg.port + 100)}";
|
||||
};
|
||||
extraConfig = mkMerge [
|
||||
{
|
||||
@@ -1269,7 +1274,7 @@ in
|
||||
services.sourcehut.settings = {
|
||||
# Note that git.sr.ht::dispatch is not a typo,
|
||||
# gitsrht-dispatch always uses this section.
|
||||
"git.sr.ht::dispatch"."/usr/bin/hgsrht-keys" = mkDefault "${cfg.hg.user}:${cfg.hg.group}";
|
||||
"git.sr.ht::dispatch"."/usr/bin/hg.sr.ht-keys" = mkDefault "${cfg.hg.user}:${cfg.hg.group}";
|
||||
};
|
||||
systemd.services.sshd = baseService;
|
||||
}
|
||||
@@ -1290,7 +1295,7 @@ in
|
||||
# so someone would need to know or guess a SHA value to download anything.
|
||||
# TODO: proxyPass to an hg serve service?
|
||||
locations."~ ^/[~^][a-z0-9_]+/[a-zA-Z0-9_.-]+/\\.hg/bundles/.*$" = {
|
||||
root = "/var/lib/nginx/hgsrht/repos";
|
||||
root = "/var/lib/nginx/hg.sr.ht/repos";
|
||||
extraConfig = ''
|
||||
auth_request /authorize;
|
||||
gzip off;
|
||||
@@ -1299,7 +1304,7 @@ in
|
||||
};
|
||||
systemd.services.nginx = {
|
||||
serviceConfig.BindReadOnlyPaths = [
|
||||
"${cfg.settings."hg.sr.ht".repos}:/var/lib/nginx/hgsrht/repos"
|
||||
"${cfg.settings."hg.sr.ht".repos}:/var/lib/nginx/hg.sr.ht/repos"
|
||||
];
|
||||
};
|
||||
})
|
||||
@@ -1330,23 +1335,23 @@ in
|
||||
inherit configIniOfService;
|
||||
port = 5006;
|
||||
webhooks = true;
|
||||
extraServices.listssrht-api = {
|
||||
extraServices."lists.sr.ht-api" = {
|
||||
serviceConfig.Restart = "always";
|
||||
serviceConfig.RestartSec = "5s";
|
||||
serviceConfig.ExecStart = "${pkgs.sourcehut.listssrht}/bin/listssrht-api -b ${cfg.listenAddress}:${
|
||||
serviceConfig.ExecStart = "${cfg.lists.package}/bin/lists.sr.ht-api -b ${cfg.listenAddress}:${
|
||||
toString (cfg.lists.port + 100)
|
||||
}";
|
||||
};
|
||||
# Receive the mail from Postfix and enqueue them into Redis and PostgreSQL
|
||||
extraServices.listssrht-lmtp = {
|
||||
extraServices."lists.sr.ht-lmtp" = {
|
||||
wants = [ "postfix.service" ];
|
||||
unitConfig.JoinsNamespaceOf = optional cfg.postfix.enable "postfix.service";
|
||||
serviceConfig.ExecStart = "${pkgs.sourcehut.listssrht}/bin/listssrht-lmtp";
|
||||
serviceConfig.ExecStart = "${cfg.lists.package}/bin/lists.sr.ht-lmtp";
|
||||
# Avoid crashing: os.chown(sock, os.getuid(), sock_gid)
|
||||
serviceConfig.PrivateUsers = mkForce false;
|
||||
};
|
||||
# Dequeue the mails from Redis and dispatch them
|
||||
extraServices.listssrht-process = {
|
||||
extraServices."lists.sr.ht-process" = {
|
||||
serviceConfig = {
|
||||
preStart = ''
|
||||
cp ${pkgs.writeText "${srvsrht}-webhooks-celeryconfig.py" cfg.lists.process.celeryConfig} \
|
||||
@@ -1392,7 +1397,7 @@ in
|
||||
OnCalendar = [ "daily" ];
|
||||
AccuracySec = "1h";
|
||||
};
|
||||
extraServices.metasrht-api = {
|
||||
extraServices."meta.sr.ht-api" = {
|
||||
serviceConfig.Restart = "always";
|
||||
serviceConfig.RestartSec = "5s";
|
||||
preStart =
|
||||
@@ -1414,7 +1419,7 @@ in
|
||||
) cfg.settings
|
||||
)
|
||||
);
|
||||
serviceConfig.ExecStart = "${pkgs.sourcehut.metasrht}/bin/metasrht-api -b ${cfg.listenAddress}:${toString (cfg.meta.port + 100)}";
|
||||
serviceConfig.ExecStart = "${cfg.meta.package}/bin/meta.sr.ht-api -b ${cfg.listenAddress}:${toString (cfg.meta.port + 100)}";
|
||||
};
|
||||
extraConfig = {
|
||||
assertions = [
|
||||
@@ -1428,14 +1433,14 @@ in
|
||||
}
|
||||
];
|
||||
environment.systemPackages = optional cfg.meta.enable (
|
||||
pkgs.writeShellScriptBin "metasrht-manageuser" ''
|
||||
pkgs.writeShellScriptBin "meta.sr.ht-manageuser" ''
|
||||
set -eux
|
||||
if test "$(${pkgs.coreutils}/bin/id -n -u)" != '${cfg.meta.user}'
|
||||
then exec sudo -u '${cfg.meta.user}' "$0" "$@"
|
||||
else
|
||||
# In order to load config.ini
|
||||
if cd /run/sourcehut/metasrht
|
||||
then exec ${pkgs.sourcehut.metasrht}/bin/metasrht-manageuser "$@"
|
||||
if cd /run/sourcehut/meta.sr.ht
|
||||
then exec ${cfg.meta.package}/bin/meta.sr.ht-manageuser "$@"
|
||||
else cat <<EOF
|
||||
Please run: sudo systemctl start metasrht
|
||||
EOF
|
||||
@@ -1452,8 +1457,9 @@ in
|
||||
port = 5112;
|
||||
mainService =
|
||||
let
|
||||
package = cfg.pages.package;
|
||||
srvsrht = "pagessrht";
|
||||
version = pkgs.sourcehut.${srvsrht}.version;
|
||||
version = package.version;
|
||||
stateDir = "/var/lib/sourcehut/${srvsrht}";
|
||||
iniKey = "pages.sr.ht";
|
||||
in
|
||||
@@ -1467,13 +1473,13 @@ in
|
||||
if test ! -e ${stateDir}/db; then
|
||||
${postgresql.package}/bin/psql '${
|
||||
cfg.settings.${iniKey}.connection-string
|
||||
}' -f ${pkgs.sourcehut.pagessrht}/share/sql/schema.sql
|
||||
}' -f ${cfg.pages.package}/share/sql/schema.sql
|
||||
echo ${version} >${stateDir}/db
|
||||
fi
|
||||
|
||||
${optionalString cfg.settings.${iniKey}.migrate-on-upgrade ''
|
||||
# Just try all the migrations because they're not linked to the version
|
||||
for sql in ${pkgs.sourcehut.pagessrht}/share/sql/migrations/*.sql; do
|
||||
for sql in ${package}/share/sql/migrations/*.sql; do
|
||||
${postgresql.package}/bin/psql '${cfg.settings.${iniKey}.connection-string}' -f "$sql" || true
|
||||
done
|
||||
''}
|
||||
@@ -1482,7 +1488,7 @@ in
|
||||
touch ${stateDir}/webhook
|
||||
'';
|
||||
serviceConfig = {
|
||||
ExecStart = mkForce "${pkgs.sourcehut.pagessrht}/bin/pages.sr.ht -b ${cfg.listenAddress}:${toString cfg.pages.port}";
|
||||
ExecStart = mkForce "${cfg.pages.package}/bin/pages.sr.ht -b ${cfg.listenAddress}:${toString cfg.pages.port}";
|
||||
};
|
||||
};
|
||||
})
|
||||
@@ -1490,10 +1496,10 @@ in
|
||||
(import ./service.nix "paste" {
|
||||
inherit configIniOfService;
|
||||
port = 5011;
|
||||
extraServices.pastesrht-api = {
|
||||
extraServices."paste.sr.ht-api" = {
|
||||
serviceConfig.Restart = "always";
|
||||
serviceConfig.RestartSec = "5s";
|
||||
serviceConfig.ExecStart = "${pkgs.sourcehut.pastesrht}/bin/pastesrht-api -b ${cfg.listenAddress}:${
|
||||
serviceConfig.ExecStart = "${cfg.paste.package}/bin/paste.sr.ht-api -b ${cfg.listenAddress}:${
|
||||
toString (cfg.paste.port + 100)
|
||||
}";
|
||||
};
|
||||
@@ -1503,15 +1509,15 @@ in
|
||||
inherit configIniOfService;
|
||||
port = 5003;
|
||||
webhooks = true;
|
||||
extraServices.todosrht-api = {
|
||||
extraServices."todo.sr.ht-api" = {
|
||||
serviceConfig.Restart = "always";
|
||||
serviceConfig.RestartSec = "5s";
|
||||
serviceConfig.ExecStart = "${pkgs.sourcehut.todosrht}/bin/todosrht-api -b ${cfg.listenAddress}:${toString (cfg.todo.port + 100)}";
|
||||
serviceConfig.ExecStart = "${cfg.todo.package}/bin/todo.sr.ht-api -b ${cfg.listenAddress}:${toString (cfg.todo.port + 100)}";
|
||||
};
|
||||
extraServices.todosrht-lmtp = {
|
||||
extraServices."todo.sr.ht-lmtp" = {
|
||||
wants = [ "postfix.service" ];
|
||||
unitConfig.JoinsNamespaceOf = optional cfg.postfix.enable "postfix.service";
|
||||
serviceConfig.ExecStart = "${pkgs.sourcehut.todosrht}/bin/todosrht-lmtp";
|
||||
serviceConfig.ExecStart = "${cfg.todo.package}/bin/todo.sr.ht-lmtp";
|
||||
# Avoid crashing: os.chown(sock, os.getuid(), sock_gid)
|
||||
serviceConfig.PrivateUsers = mkForce false;
|
||||
};
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
srv:
|
||||
{
|
||||
configIniOfService,
|
||||
srvsrht ? "${srv}srht", # Because "buildsrht" does not follow that pattern (missing an "s").
|
||||
pkgname ? "${srv}srht", # Because "buildsrht" does not follow that pattern (missing an "s").
|
||||
srvsrht ? "${srv}.sr.ht",
|
||||
iniKey ? "${srv}.sr.ht",
|
||||
webhooks ? false,
|
||||
extraTimers ? { },
|
||||
@@ -28,7 +29,7 @@ let
|
||||
mkIf
|
||||
mkMerge
|
||||
;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.options) mkEnableOption mkOption mkPackageOption;
|
||||
inherit (lib.strings) concatStringsSep hasSuffix optionalString;
|
||||
inherit (config.services) postgresql;
|
||||
redis = config.services.redis.servers."sourcehut-${srvsrht}";
|
||||
@@ -162,6 +163,8 @@ in
|
||||
{
|
||||
enable = mkEnableOption "${srv} service";
|
||||
|
||||
package = mkPackageOption pkgs [ "sourcehut" pkgname ] { };
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = srvsrht;
|
||||
@@ -276,7 +279,7 @@ in
|
||||
forceSSL = mkDefault true;
|
||||
locations."/".proxyPass = "http://${cfg.listenAddress}:${toString srvCfg.port}";
|
||||
locations."/static" = {
|
||||
root = "${pkgs.sourcehut.${srvsrht}}/${pkgs.sourcehut.python.sitePackages}/${srvsrht}";
|
||||
root = "${srvCfg.package}/${pkgs.sourcehut.python.sitePackages}/${srvsrht}";
|
||||
extraConfig = mkDefault ''
|
||||
expires 30d;
|
||||
'';
|
||||
@@ -367,12 +370,12 @@ in
|
||||
StateDirectory = [ "sourcehut/${srvsrht}" ];
|
||||
StateDirectoryMode = "2750";
|
||||
ExecStart =
|
||||
"${cfg.python}/bin/gunicorn ${srvsrht}.app:app --name ${srvsrht} --bind ${cfg.listenAddress}:${toString srvCfg.port} "
|
||||
"${cfg.python}/bin/gunicorn ${pkgname}.app:app --name ${srvsrht} --bind ${cfg.listenAddress}:${toString srvCfg.port} "
|
||||
+ concatStringsSep " " srvCfg.gunicorn.extraArgs;
|
||||
};
|
||||
preStart =
|
||||
let
|
||||
package = pkgs.sourcehut.${srvsrht};
|
||||
package = srvCfg.package;
|
||||
version = package.version;
|
||||
stateDir = "/var/lib/sourcehut/${srvsrht}";
|
||||
in
|
||||
@@ -385,7 +388,7 @@ in
|
||||
if test ! -e ${stateDir}/db; then
|
||||
# Setup the initial database.
|
||||
# Note that it stamps the alembic head afterward
|
||||
${package}/bin/${srvsrht}-initdb
|
||||
${postgresql.package}/bin/psql -d ${srvsrht} -f ${package}/share/sourcehut/${srvsrht}-schema.sql
|
||||
echo ${version} >${stateDir}/db
|
||||
fi
|
||||
|
||||
@@ -401,7 +404,7 @@ in
|
||||
# See https://lists.sr.ht/~sircmpwn/sr.ht-admins/<20190302181207.GA13778%40cirno.my.domain>
|
||||
if test ! -e ${stateDir}/webhook; then
|
||||
# Update ${iniKey}'s users' profile copy to the latest
|
||||
${cfg.python}/bin/srht-update-profiles ${iniKey}
|
||||
${cfg.python}/bin/sr.ht-update-profiles ${iniKey}
|
||||
touch ${stateDir}/webhook
|
||||
fi
|
||||
'';
|
||||
@@ -424,7 +427,7 @@ in
|
||||
Type = "simple";
|
||||
Restart = "always";
|
||||
ExecStart =
|
||||
"${cfg.python}/bin/celery --app ${srvsrht}.webhooks worker --hostname ${srvsrht}-webhooks@%%h "
|
||||
"${cfg.python}/bin/celery --app ${pkgname}.webhooks worker --hostname ${srvsrht}-webhooks@%%h "
|
||||
+ concatStringsSep " " srvCfg.webhooks.extraArgs;
|
||||
# Avoid crashing: os.getloadavg()
|
||||
ProcSubset = mkForce "all";
|
||||
@@ -443,7 +446,7 @@ in
|
||||
];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.sourcehut.${srvsrht}}/bin/${timerName}";
|
||||
ExecStart = "${srvCfg.package}/bin/${timerName}";
|
||||
};
|
||||
}
|
||||
(timer.service or { })
|
||||
|
||||
@@ -49,15 +49,15 @@ import ../make-test-python.nix (
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
|
||||
with subtest("Check whether meta comes up"):
|
||||
machine.wait_for_unit("metasrht-api.service")
|
||||
machine.wait_for_unit("metasrht.service")
|
||||
machine.wait_for_unit("metasrht-webhooks.service")
|
||||
machine.wait_for_unit("meta.sr.ht-api.service")
|
||||
machine.wait_for_unit("meta.sr.ht.service")
|
||||
machine.wait_for_unit("meta.sr.ht-webhooks.service")
|
||||
machine.wait_for_open_port(5000)
|
||||
machine.succeed("curl -sL http://localhost:5000 | grep meta.${domain}")
|
||||
machine.succeed("curl -sL http://meta.${domain} | grep meta.${domain}")
|
||||
|
||||
with subtest("Check whether builds comes up"):
|
||||
machine.wait_for_unit("buildsrht.service")
|
||||
machine.wait_for_unit("builds.sr.ht.service")
|
||||
machine.wait_for_open_port(5002)
|
||||
machine.succeed("curl -sL http://localhost:5002 | grep builds.${domain}")
|
||||
#machine.wait_for_unit("buildsrht-worker.service")
|
||||
|
||||
@@ -63,25 +63,26 @@ import ../make-test-python.nix (
|
||||
machine.wait_for_unit("sshd.service")
|
||||
|
||||
with subtest("Check whether meta comes up"):
|
||||
machine.wait_for_unit("metasrht-api.service")
|
||||
machine.wait_for_unit("metasrht.service")
|
||||
machine.wait_for_unit("metasrht-webhooks.service")
|
||||
machine.wait_for_unit("meta.sr.ht-api.service")
|
||||
machine.wait_for_unit("meta.sr.ht.service")
|
||||
machine.wait_for_unit("meta.sr.ht-webhooks.service")
|
||||
machine.wait_for_open_port(5000)
|
||||
machine.succeed("curl -sL http://localhost:5000 | grep meta.${domain}")
|
||||
machine.succeed("curl -sL http://meta.${domain} | grep meta.${domain}")
|
||||
|
||||
with subtest("Create a new user account and OAuth access key"):
|
||||
machine.succeed("echo ${userPass} | metasrht-manageuser -ps -e ${userName}@${domain}\
|
||||
-t active_paying ${userName}");
|
||||
machine.succeed("echo ${userPass} | meta.sr.ht-manageuser -ps -e ${userName}@${domain}\
|
||||
-t USER ${userName}");
|
||||
cmd = "srht-gen-oauth-tok -i ${domain} -q ${userName} ${userPass}"
|
||||
(_, token) = machine.execute("srht-gen-oauth-tok -i ${domain} -q ${userName} ${userPass}")
|
||||
token = token.strip().replace("/", r"\\/") # Escape slashes in token before passing it to sed
|
||||
machine.execute("mkdir -p ~/.config/hut/")
|
||||
machine.execute("sed s/OAUTH-TOKEN/" + token + "/ ${hutConfig} > ~/.config/hut/config")
|
||||
|
||||
with subtest("Check whether git comes up"):
|
||||
machine.wait_for_unit("gitsrht-api.service")
|
||||
machine.wait_for_unit("gitsrht.service")
|
||||
machine.wait_for_unit("gitsrht-webhooks.service")
|
||||
machine.wait_for_unit("git.sr.ht-api.service")
|
||||
machine.wait_for_unit("git.sr.ht.service")
|
||||
machine.wait_for_unit("git.sr.ht-webhooks.service")
|
||||
machine.succeed("curl -sL http://git.${domain} | grep git.${domain}")
|
||||
|
||||
with subtest("Add an SSH key for Git access"):
|
||||
@@ -95,7 +96,7 @@ import ../make-test-python.nix (
|
||||
machine.execute("cd test && git add .")
|
||||
machine.execute("cd test && git commit -m \"Initial commit\"")
|
||||
machine.execute("cd test && git tag v0.1")
|
||||
machine.succeed("cd test && git remote add origin gitsrht@git.${domain}:~${userName}/test")
|
||||
machine.succeed("cd test && git remote add origin git.sr.ht@git.${domain}:~${userName}/test")
|
||||
machine.execute("( echo -n 'git.${domain} '; cat /etc/ssh/ssh_host_ed25519_key.pub ) > ~/.ssh/known_hosts")
|
||||
machine.succeed("hut git create test")
|
||||
machine.succeed("cd test && git push --tags --set-upstream origin master")
|
||||
|
||||
@@ -14,57 +14,54 @@
|
||||
unzip,
|
||||
pip,
|
||||
pythonOlder,
|
||||
setuptools,
|
||||
setuptools-scm,
|
||||
}:
|
||||
let
|
||||
version = "0.89.15";
|
||||
version = "0.95.1";
|
||||
gqlgen = import ./fix-gqlgen-trimpath.nix {
|
||||
inherit unzip;
|
||||
gqlgenVersion = "0.17.39";
|
||||
gqlgenVersion = "0.17.64";
|
||||
};
|
||||
|
||||
patches = [ ./patches/core-go-update/builds/patch-deps.patch ];
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~sircmpwn";
|
||||
repo = "builds.sr.ht";
|
||||
rev = version;
|
||||
hash = "sha256-rmNaBnTPDDQO/ImkGkMwW8fyjQyBUBchTEnbtAK24pw=";
|
||||
hash = "sha256-On/dKqIuqsCLAgYkJQOeYL7Ne983JzEYKhuLpD5vNu4=";
|
||||
};
|
||||
|
||||
buildsrht-api = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "buildsrht-api";
|
||||
modRoot = "api";
|
||||
vendorHash = "sha256-dwpuB+aYqzhGSdGVq/F9FTdHWMBkGMtVuZ7I3hB3b+Q=";
|
||||
vendorHash = "sha256-GOM7fmJvfPJW3+XzvlwQZ9hBknlXwBKjGSmtIiapleY=";
|
||||
}
|
||||
// gqlgen
|
||||
);
|
||||
|
||||
buildsrht-worker = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "buildsrht-worker";
|
||||
modRoot = "worker";
|
||||
vendorHash = "sha256-dwpuB+aYqzhGSdGVq/F9FTdHWMBkGMtVuZ7I3hB3b+Q=";
|
||||
vendorHash = "sha256-nEXnCeUxlUMNUqhe82MKREXcaC9pvqZqyqhyQW+jQjQ=";
|
||||
}
|
||||
// gqlgen
|
||||
);
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "buildsrht";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "all: api worker" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pip
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@@ -78,9 +75,14 @@ buildPythonPackage rec {
|
||||
lxml
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export PKGVER=${version}
|
||||
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
||||
env = {
|
||||
PKGVER = version;
|
||||
SRHT_PATH = "${srht}/${python.sitePackages}/srht";
|
||||
PREFIX = placeholder "out";
|
||||
};
|
||||
|
||||
postBuild = ''
|
||||
make SASSC_INCLUDE=-I${srht}/share/sourcehut/scss/ all-share
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
@@ -89,8 +91,10 @@ buildPythonPackage rec {
|
||||
|
||||
cp -r images $out/lib
|
||||
cp contrib/submit_image_build $out/bin/builds.sr.ht
|
||||
ln -s ${buildsrht-api}/bin/api $out/bin/buildsrht-api
|
||||
ln -s ${buildsrht-worker}/bin/worker $out/bin/buildsrht-worker
|
||||
ln -s ${buildsrht-api}/bin/api $out/bin/builds.sr.ht-api
|
||||
ln -s ${buildsrht-worker}/bin/worker $out/bin/builds.sr.ht-worker
|
||||
install -Dm644 schema.sql $out/share/sourcehut/builds.sr.ht-schema.sql
|
||||
make install-share
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "buildsrht" ];
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
sassc,
|
||||
pythonOlder,
|
||||
minify,
|
||||
setuptools,
|
||||
setuptools-scm,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "srht";
|
||||
version = "0.71.8";
|
||||
version = "0.76.1";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
@@ -38,7 +38,7 @@ buildPythonPackage rec {
|
||||
owner = "~sircmpwn";
|
||||
repo = "core.sr.ht";
|
||||
rev = version;
|
||||
hash = "sha256-rDpm2HJOWScvIxOmHcat6y4CWdBE9T2gE/jZskYAFB0=";
|
||||
hash = "sha256-lAN1JZXQuN2zxi/BdBtbNj52LPj9iYn0WB2OpyQcyuU=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
@@ -48,7 +48,7 @@ buildPythonPackage rec {
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedNativeBuildInputs = [
|
||||
@@ -81,12 +81,19 @@ buildPythonPackage rec {
|
||||
importlib-metadata
|
||||
];
|
||||
|
||||
PKGVER = version;
|
||||
env = {
|
||||
PREFIX = placeholder "out";
|
||||
PKGVER = version;
|
||||
};
|
||||
|
||||
postInstall = ''
|
||||
make install
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "srht" ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://git.sr.ht/~sircmpwn/srht";
|
||||
homepage = "https://git.sr.ht/~sircmpwn/core.sr.ht";
|
||||
description = "Core modules for sr.ht";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
recurseIntoAttrs,
|
||||
nixosTests,
|
||||
config,
|
||||
fetchPypi,
|
||||
fetchpatch,
|
||||
}:
|
||||
|
||||
# To expose the *srht modules, they have to be a python module so we use `buildPythonModule`
|
||||
@@ -29,75 +27,6 @@ let
|
||||
todosrht = self.callPackage ./todo.nix { };
|
||||
|
||||
scmsrht = self.callPackage ./scm.nix { };
|
||||
|
||||
# sourcehut is not (yet) compatible with SQLAlchemy 2.x
|
||||
sqlalchemy = super.sqlalchemy_1_4;
|
||||
|
||||
# sourcehut is not (yet) compatible with flask-sqlalchemy 3.x
|
||||
flask-sqlalchemy = super.flask-sqlalchemy.overridePythonAttrs (oldAttrs: rec {
|
||||
version = "2.5.1";
|
||||
format = "setuptools";
|
||||
src = fetchPypi {
|
||||
pname = "Flask-SQLAlchemy";
|
||||
inherit version;
|
||||
hash = "sha256-K9pEtD58rLFdTgX/PMH4vJeTbMRkYjQkECv8LDXpWRI=";
|
||||
};
|
||||
propagatedBuildInputs = with self; [
|
||||
flask
|
||||
sqlalchemy
|
||||
];
|
||||
disabledTests = [ "test_persist_selectable" ];
|
||||
});
|
||||
|
||||
# flask-sqlalchemy 2.x requires flask 2.x
|
||||
flask = super.flask.overridePythonAttrs (oldAttrs: rec {
|
||||
version = "2.3.3";
|
||||
src = fetchPypi {
|
||||
inherit (oldAttrs) pname;
|
||||
inherit version;
|
||||
hash = "sha256-CcNHqSqn/0qOfzIGeV8w2CZlS684uHPQdEzVccpgnvw=";
|
||||
};
|
||||
});
|
||||
|
||||
# flask 2.x requires werkzeug 2.x
|
||||
werkzeug = super.werkzeug.overridePythonAttrs (oldAttrs: rec {
|
||||
version = "2.3.8";
|
||||
src = fetchPypi {
|
||||
inherit (oldAttrs) pname;
|
||||
inherit version;
|
||||
hash = "sha256-VUslfHS763oNJUFgpPj/4YUkP1KlIDUGC3Ycpi2XfwM=";
|
||||
};
|
||||
# Fixes a test failure with Pytest 8
|
||||
patches = (oldAttrs.patches or [ ]) ++ [
|
||||
(fetchpatch {
|
||||
url = "https://github.com/pallets/werkzeug/commit/4e5bdca7f8227d10cae828f8064fb98190ace4aa.patch";
|
||||
hash = "sha256-83doVvfdpymlAB0EbfrHmuoKE5B2LJbFq+AY2xGpnl4=";
|
||||
})
|
||||
];
|
||||
nativeCheckInputs = oldAttrs.nativeCheckInputs or [ ] ++ [ self.pytest-xprocess ];
|
||||
});
|
||||
|
||||
# sourcehut is not (yet) compatible with factory-boy 3.x
|
||||
factory-boy = super.factory-boy.overridePythonAttrs (oldAttrs: rec {
|
||||
version = "2.12.0";
|
||||
src = fetchPypi {
|
||||
pname = "factory_boy";
|
||||
inherit version;
|
||||
hash = "sha256-+vSNYIoXNfDQo8nL9TbWT5EytUfa57pFLE2Zp56Eo3A=";
|
||||
};
|
||||
nativeCheckInputs =
|
||||
(with super; [
|
||||
django
|
||||
mongoengine
|
||||
pytestCheckHook
|
||||
])
|
||||
++ (with self; [
|
||||
sqlalchemy
|
||||
flask
|
||||
flask-sqlalchemy
|
||||
]);
|
||||
postPatch = "";
|
||||
});
|
||||
};
|
||||
};
|
||||
in
|
||||
|
||||
@@ -11,42 +11,44 @@
|
||||
pythonOlder,
|
||||
unzip,
|
||||
pip,
|
||||
setuptools,
|
||||
setuptools-scm,
|
||||
}:
|
||||
let
|
||||
version = "0.85.9";
|
||||
version = "0.88.10";
|
||||
gqlgen = import ./fix-gqlgen-trimpath.nix {
|
||||
inherit unzip;
|
||||
gqlgenVersion = "0.17.42";
|
||||
gqlgenVersion = "0.17.64";
|
||||
};
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~sircmpwn";
|
||||
repo = "git.sr.ht";
|
||||
rev = version;
|
||||
hash = "sha256-tmbBw6x3nqN9nRIR3xOXQ+L5EACXLQYLXQYK3lsOsAI=";
|
||||
hash = "sha256-o7d2EIx9oJAQSIrMMG/TYjAo7PJwT6rE8kcVMKoYenY=";
|
||||
};
|
||||
|
||||
patches = [ ./patches/core-go-update/git/patch-deps.patch ];
|
||||
|
||||
gitApi = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "gitsrht-api";
|
||||
modRoot = "api";
|
||||
vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
|
||||
vendorHash = "sha256-20SxOZrvj41L8A5nuOro9DYiK6FyhwJK5cNAvxPB7qw=";
|
||||
}
|
||||
// gqlgen
|
||||
);
|
||||
|
||||
gitDispatch = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "gitsrht-dispatch";
|
||||
modRoot = "gitsrht-dispatch";
|
||||
vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
|
||||
modRoot = "dispatch";
|
||||
vendorHash = "sha256-MXLF7vO8SmUkU1nOxhObuzjT2ZRQQluIX7TRrxL7/3Y=";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace gitsrht-dispatch/main.go \
|
||||
--replace /var/log/gitsrht-dispatch /var/log/sourcehut/gitsrht-dispatch
|
||||
substituteInPlace dispatch/main.go \
|
||||
--replace-fail /var/log/git.sr.ht-dispatch /var/log/sourcehut/git.sr.ht-dispatch
|
||||
'';
|
||||
}
|
||||
// gqlgen
|
||||
@@ -54,14 +56,14 @@ let
|
||||
|
||||
gitKeys = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "gitsrht-keys";
|
||||
modRoot = "gitsrht-keys";
|
||||
vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
|
||||
modRoot = "keys";
|
||||
vendorHash = "sha256-MXLF7vO8SmUkU1nOxhObuzjT2ZRQQluIX7TRrxL7/3Y=";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace gitsrht-keys/main.go \
|
||||
--replace /var/log/gitsrht-keys /var/log/sourcehut/gitsrht-keys
|
||||
substituteInPlace keys/main.go \
|
||||
--replace-fail /var/log/git.sr.ht-keys /var/log/sourcehut/git.sr.ht-keys
|
||||
'';
|
||||
}
|
||||
// gqlgen
|
||||
@@ -69,14 +71,14 @@ let
|
||||
|
||||
gitShell = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "gitsrht-shell";
|
||||
modRoot = "gitsrht-shell";
|
||||
vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
|
||||
modRoot = "shell";
|
||||
vendorHash = "sha256-MXLF7vO8SmUkU1nOxhObuzjT2ZRQQluIX7TRrxL7/3Y=";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace gitsrht-shell/main.go \
|
||||
--replace /var/log/gitsrht-shell /var/log/sourcehut/gitsrht-shell
|
||||
substituteInPlace shell/main.go \
|
||||
--replace-fail /var/log/git.sr.ht-shell /var/log/sourcehut/git.sr.ht-shell
|
||||
'';
|
||||
}
|
||||
// gqlgen
|
||||
@@ -84,34 +86,29 @@ let
|
||||
|
||||
gitUpdateHook = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "gitsrht-update-hook";
|
||||
modRoot = "gitsrht-update-hook";
|
||||
vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
|
||||
modRoot = "update-hook";
|
||||
vendorHash = "sha256-MXLF7vO8SmUkU1nOxhObuzjT2ZRQQluIX7TRrxL7/3Y=";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace gitsrht-update-hook/main.go \
|
||||
--replace /var/log/gitsrht-update-hook /var/log/sourcehut/gitsrht-update-hook
|
||||
substituteInPlace update-hook/main.go \
|
||||
--replace-fail /var/log/git.sr.ht-update-hook /var/log/sourcehut/git.sr.ht-update-hook
|
||||
'';
|
||||
}
|
||||
// gqlgen
|
||||
);
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "gitsrht";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "all: api gitsrht-dispatch gitsrht-keys gitsrht-shell gitsrht-update-hook" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pip
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@@ -121,18 +118,25 @@ buildPythonPackage rec {
|
||||
minio
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export PKGVER=${version}
|
||||
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
||||
env = {
|
||||
PKGVER = version;
|
||||
SRHT_PATH = "${srht}/${python.sitePackages}/srht";
|
||||
PREFIX = placeholder "out";
|
||||
};
|
||||
|
||||
postBuild = ''
|
||||
make SASSC_INCLUDE=-I${srht}/share/sourcehut/scss/ all-share
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/bin
|
||||
ln -s ${gitApi}/bin/api $out/bin/gitsrht-api
|
||||
ln -s ${gitDispatch}/bin/gitsrht-dispatch $out/bin/gitsrht-dispatch
|
||||
ln -s ${gitKeys}/bin/gitsrht-keys $out/bin/gitsrht-keys
|
||||
ln -s ${gitShell}/bin/gitsrht-shell $out/bin/gitsrht-shell
|
||||
ln -s ${gitUpdateHook}/bin/gitsrht-update-hook $out/bin/gitsrht-update-hook
|
||||
ln -s ${gitApi}/bin/api $out/bin/git.sr.ht-api
|
||||
ln -s ${gitDispatch}/bin/dispatch $out/bin/git.sr.ht-dispatch
|
||||
ln -s ${gitKeys}/bin/keys $out/bin/git.sr.ht-keys
|
||||
ln -s ${gitShell}/bin/shell $out/bin/git.sr.ht-shell
|
||||
ln -s ${gitUpdateHook}/bin/update-hook $out/bin/git.sr.ht-update-hook
|
||||
install -Dm644 schema.sql $out/share/sourcehut/git.sr.ht-schema.sql
|
||||
make PREFIX=$out install-share
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "gitsrht" ];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
lib,
|
||||
fetchFromSourcehut,
|
||||
fetchpatch,
|
||||
buildGoModule,
|
||||
buildPythonPackage,
|
||||
srht,
|
||||
@@ -11,65 +12,71 @@
|
||||
unzip,
|
||||
pip,
|
||||
pythonOlder,
|
||||
setuptools,
|
||||
setuptools-scm,
|
||||
}:
|
||||
|
||||
let
|
||||
version = "0.33.0";
|
||||
version = "0.36.1";
|
||||
gqlgen = import ./fix-gqlgen-trimpath.nix {
|
||||
inherit unzip;
|
||||
gqlgenVersion = "0.17.45";
|
||||
gqlgenVersion = "0.17.64";
|
||||
};
|
||||
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
patches = [
|
||||
(fetchpatch {
|
||||
name = "update-core-go-and-gqlgen.patch";
|
||||
url = "https://hg.sr.ht/~sircmpwn/hg.sr.ht/rev/2765f086c3a67e00219cabe9a1dd01b2012c5c12.patch";
|
||||
hash = "sha256-MLZG07tD7vrfvx2GDRUvFd/7VxxZLrAa/C3bB/IvQpI=";
|
||||
})
|
||||
./patches/core-go-update/hg/patch-deps.patch
|
||||
];
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~sircmpwn";
|
||||
repo = "hg.sr.ht";
|
||||
rev = version;
|
||||
hash = "sha256-+BYeE+8dXY/MLLYyBBLD+eKqmrPiKyyCGIZLkCPzNYM=";
|
||||
hash = "sha256-EeWRUb/BZ+KJXNqmzCFYHkvWUaPvF/F7ZaOYM0IEYwk=";
|
||||
vc = "hg";
|
||||
};
|
||||
|
||||
hgsrht-api = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "hgsrht-api";
|
||||
modRoot = "api";
|
||||
vendorHash = "sha256-K+KMhcvkG/qeQTnlHS4xhLCcvBQNNp2DcScJPm8Dbic=";
|
||||
vendorHash = "sha256-elaVmyaO5IbzsnBYRjJvmoOFR8gx1xCfzd3z01KNXVA=";
|
||||
}
|
||||
// gqlgen
|
||||
);
|
||||
|
||||
hgsrht-keys = buildGoModule {
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "hgsrht-keys";
|
||||
modRoot = "hgsrht-keys";
|
||||
vendorHash = "sha256-7ti8xCjSrxsslF7/1X/GY4FDl+69hPL4UwCDfjxmJLU=";
|
||||
modRoot = "keys";
|
||||
vendorHash = "sha256-U5NtgyUgVqI25XBg51U7glNRpR5MZBCcsuuR6f+gZc8=";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace hgsrht-keys/main.go \
|
||||
--replace /var/log/hgsrht-keys /var/log/sourcehut/hgsrht-keys
|
||||
substituteInPlace keys/main.go \
|
||||
--replace-fail /var/log/hg.sr.ht-keys /var/log/sourcehut/hg.sr.ht-keys
|
||||
'';
|
||||
};
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "hgsrht";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "all: api hgsrht-keys" ""
|
||||
pyproject = true;
|
||||
|
||||
substituteInPlace hgsrht-shell \
|
||||
--replace /var/log/hgsrht-shell /var/log/sourcehut/hgsrht-shell
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace hg.sr.ht-shell \
|
||||
--replace-fail /var/log/hg.sr.ht-shell /var/log/sourcehut/hg.sr.ht-shell
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pip
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@@ -79,20 +86,27 @@ buildPythonPackage rec {
|
||||
unidiff
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export PKGVER=${version}
|
||||
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
||||
env = {
|
||||
PKGVER = version;
|
||||
SRHT_PATH = "${srht}/${python.sitePackages}/srht";
|
||||
PREFIX = placeholder "out";
|
||||
};
|
||||
|
||||
postBuild = ''
|
||||
make SASSC_INCLUDE=-I${srht}/share/sourcehut/scss/ all-share
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
ln -s ${hgsrht-api}/bin/api $out/bin/hgsrht-api
|
||||
ln -s ${hgsrht-keys}/bin/hgsrht-keys $out/bin/hgsrht-keys
|
||||
ln -s ${hgsrht-api}/bin/api $out/bin/hg.sr.ht-api
|
||||
ln -s ${hgsrht-keys}/bin/hgsrht-keys $out/bin/hg.sr.ht-keys
|
||||
install -Dm644 schema.sql $out/share/sourcehut/hg.sr.ht-schema.sql
|
||||
make install-share
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "hgsrht" ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://git.sr.ht/~sircmpwn/hg.sr.ht";
|
||||
homepage = "https://hg.sr.ht/~sircmpwn/hg.sr.ht";
|
||||
description = "Mercurial repository hosting service for the sr.ht network";
|
||||
license = licenses.agpl3Only;
|
||||
maintainers = with maintainers; [
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
buildPythonPackage,
|
||||
python,
|
||||
srht,
|
||||
setuptools,
|
||||
setuptools-scm,
|
||||
pip,
|
||||
pyyaml,
|
||||
pythonOlder,
|
||||
@@ -13,43 +13,41 @@
|
||||
}:
|
||||
|
||||
let
|
||||
version = "0.17.7";
|
||||
version = "0.20.2";
|
||||
gqlgen = import ./fix-gqlgen-trimpath.nix {
|
||||
inherit unzip;
|
||||
gqlgenVersion = "0.17.43";
|
||||
gqlgenVersion = "0.17.64";
|
||||
};
|
||||
|
||||
patches = [ ./patches/core-go-update/hub/patch-deps.patch ];
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~sircmpwn";
|
||||
repo = "hub.sr.ht";
|
||||
rev = version;
|
||||
hash = "sha256-IyY7Niy/vZSAXjYZMlxY6uuQ8nH/4yT4+MaRjHtl6G4=";
|
||||
hash = "sha256-blaaJ7kQBkswmSpEVEsDm6vaxuMuCcW2wmeN+fbwzjg=";
|
||||
};
|
||||
|
||||
hubsrht-api = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "hubsrht-api";
|
||||
modRoot = "api";
|
||||
vendorHash = "sha256-GVN11nEJqIHh8MtKvIXe4zcUwJph9eTSkJ2R+ufD+ic=";
|
||||
vendorHash = "sha256-jKNHZrFydp3+cD8MR2izzE8bi4H2uT/7+x/wmPkEIIc=";
|
||||
}
|
||||
// gqlgen
|
||||
);
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "hubsrht";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile --replace "all: api" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pip
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@@ -57,13 +55,20 @@ buildPythonPackage rec {
|
||||
pyyaml
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export PKGVER=${version}
|
||||
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
||||
env = {
|
||||
PKGVER = version;
|
||||
SRHT_PATH = "${srht}/${python.sitePackages}/srht";
|
||||
PREFIX = placeholder "out";
|
||||
};
|
||||
|
||||
postBuild = ''
|
||||
make SASSC_INCLUDE=-I${srht}/share/sourcehut/scss/ all-share
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
ln -s ${hubsrht-api}/bin/api $out/bin/hubsrht-api
|
||||
ln -s ${hubsrht-api}/bin/api $out/bin/hub.sr.ht-api
|
||||
install -Dm644 schema.sql $out/share/sourcehut/hub.sr.ht-schema.sql
|
||||
make install-share
|
||||
'';
|
||||
|
||||
# Module has no tests
|
||||
|
||||
@@ -12,48 +12,45 @@
|
||||
unzip,
|
||||
pip,
|
||||
pythonOlder,
|
||||
setuptools,
|
||||
setuptools-scm,
|
||||
}:
|
||||
|
||||
let
|
||||
version = "0.57.18";
|
||||
version = "0.62.3";
|
||||
gqlgen = import ./fix-gqlgen-trimpath.nix {
|
||||
inherit unzip;
|
||||
gqlgenVersion = "0.17.45";
|
||||
gqlgenVersion = "0.17.64";
|
||||
};
|
||||
|
||||
patches = [ ./patches/core-go-update/lists/patch-deps.patch ];
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~sircmpwn";
|
||||
repo = "lists.sr.ht";
|
||||
rev = version;
|
||||
hash = "sha256-l+QPocnwHTjrU+M0wnm4tBrbz8KmSb6DovC+skuAnLc=";
|
||||
hash = "sha256-HU3hnKdIoseCo1/lt3GIOQ5d3joykN11/Bzvk4xvH4Y=";
|
||||
};
|
||||
|
||||
listssrht-api = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "listssrht-api";
|
||||
modRoot = "api";
|
||||
vendorHash = "sha256-UeVs/+uZNtv296bzXIBio2wcg3Uzu3fBM4APzF9O0hY=";
|
||||
vendorHash = "sha256-XKDEr8ESs9oBh7DKu2jgPEMDY99nN25inkNwU/rrza8=";
|
||||
}
|
||||
// gqlgen
|
||||
);
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "listssrht";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "all: api" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pip
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@@ -65,13 +62,20 @@ buildPythonPackage rec {
|
||||
emailthreads
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export PKGVER=${version}
|
||||
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
||||
env = {
|
||||
PKGVER = version;
|
||||
SRHT_PATH = "${srht}/${python.sitePackages}/srht";
|
||||
PREFIX = placeholder "out";
|
||||
};
|
||||
|
||||
postBuild = ''
|
||||
make SASSC_INCLUDE=-I${srht}/share/sourcehut/scss/ all-share
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
ln -s ${listssrht-api}/bin/api $out/bin/listssrht-api
|
||||
ln -s ${listssrht-api}/bin/api $out/bin/lists.sr.ht-api
|
||||
install -Dm644 schema.sql $out/share/sourcehut/lists.sr.ht-schema.sql
|
||||
make install-share
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "listssrht" ];
|
||||
|
||||
@@ -9,47 +9,45 @@
|
||||
unzip,
|
||||
pip,
|
||||
pythonOlder,
|
||||
setuptools,
|
||||
setuptools-scm,
|
||||
}:
|
||||
|
||||
let
|
||||
version = "0.16.5";
|
||||
version = "0.18.1";
|
||||
gqlgen = import ./fix-gqlgen-trimpath.nix {
|
||||
inherit unzip;
|
||||
gqlgenVersion = "0.17.43";
|
||||
gqlgenVersion = "0.17.64";
|
||||
};
|
||||
|
||||
patches = [ ./patches/core-go-update/man/patch-deps.patch ];
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~sircmpwn";
|
||||
repo = "man.sr.ht";
|
||||
rev = version;
|
||||
hash = "sha256-JFMtif2kIE/fs5PNcQtkJikAFNszgZTU7BG/8fTncTI=";
|
||||
hash = "sha256-c2xFC1pmOSGGMP4RVOmgFogj7CY2kHrADsWsm7M5ZK4=";
|
||||
};
|
||||
|
||||
mansrht-api = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "mansrht-api";
|
||||
modRoot = "api";
|
||||
vendorHash = "sha256-GVN11nEJqIHh8MtKvIXe4zcUwJph9eTSkJ2R+ufD+ic=";
|
||||
vendorHash = "sha256-jKNHZrFydp3+cD8MR2izzE8bi4H2uT/7+x/wmPkEIIc=";
|
||||
}
|
||||
// gqlgen
|
||||
);
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "mansrht";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile --replace "all: api" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pip
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@@ -57,13 +55,20 @@ buildPythonPackage rec {
|
||||
pygit2
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export PKGVER=${version}
|
||||
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
||||
env = {
|
||||
PKGVER = version;
|
||||
SRHT_PATH = "${srht}/${python.sitePackages}/srht";
|
||||
PREFIX = placeholder "out";
|
||||
};
|
||||
|
||||
postBuild = ''
|
||||
make SASSC_INCLUDE=-I${srht}/share/sourcehut/scss/ all-share
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
ln -s ${mansrht-api}/bin/api $out/bin/mansrht-api
|
||||
ln -s ${mansrht-api}/bin/api $out/bin/man.sr.ht-api
|
||||
install -Dm644 schema.sql $out/share/sourcehut/man.sr.ht-schema.sql
|
||||
make install-share
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "mansrht" ];
|
||||
|
||||
@@ -16,47 +16,44 @@
|
||||
unzip,
|
||||
pip,
|
||||
pythonOlder,
|
||||
setuptools,
|
||||
setuptools-scm,
|
||||
}:
|
||||
let
|
||||
version = "0.69.8";
|
||||
version = "0.72.11";
|
||||
gqlgen = import ./fix-gqlgen-trimpath.nix {
|
||||
inherit unzip;
|
||||
gqlgenVersion = "0.17.43";
|
||||
gqlgenVersion = "0.17.64";
|
||||
};
|
||||
|
||||
patches = [ ./patches/core-go-update/meta/patch-deps.patch ];
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~sircmpwn";
|
||||
repo = "meta.sr.ht";
|
||||
rev = version;
|
||||
hash = "sha256-K7p6cytkPYgUuYr7BVfU/+sVbSr2YEmreIDnTatUMyk=";
|
||||
hash = "sha256-dh+9wSQLL69xZ2Elmkyb9vEwpE7U7szz62VVS/0IM7Q=";
|
||||
};
|
||||
|
||||
metasrht-api = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "metasrht-api";
|
||||
modRoot = "api";
|
||||
vendorHash = "sha256-vIkUK1pigVU8vZL5xpHLeinOga5eXXHTuDkHxwUz6uM=";
|
||||
vendorHash = "sha256-z4gRqI05t3m7ANyDJHmBcOCW476IG/eTfLetPRPbqtg=";
|
||||
}
|
||||
// gqlgen
|
||||
);
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
pname = "metasrht";
|
||||
inherit version src;
|
||||
inherit version src patches;
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "all: api" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pip
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@@ -71,14 +68,21 @@ buildPythonPackage rec {
|
||||
zxcvbn
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export PKGVER=${version}
|
||||
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
||||
env = {
|
||||
PKGVER = version;
|
||||
SRHT_PATH = "${srht}/${python.sitePackages}/srht";
|
||||
PREFIX = placeholder "out";
|
||||
};
|
||||
|
||||
postBuild = ''
|
||||
make SASSC_INCLUDE=-I${srht}/share/sourcehut/scss/ all-share
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/bin
|
||||
ln -s ${metasrht-api}/bin/api $out/bin/metasrht-api
|
||||
ln -s ${metasrht-api}/bin/api $out/bin/meta.sr.ht-api
|
||||
install -Dm644 schema.sql $out/share/sourcehut/meta.sr.ht-schema.sql
|
||||
make install-share
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "metasrht" ];
|
||||
|
||||
@@ -8,25 +8,23 @@
|
||||
buildGoModule (
|
||||
rec {
|
||||
pname = "pagessrht";
|
||||
version = "0.15.7";
|
||||
version = "0.16.0";
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~sircmpwn";
|
||||
repo = "pages.sr.ht";
|
||||
rev = version;
|
||||
hash = "sha256-Lobuf12ybSO7Y4ztOLMFW0dmPFaBSEPCy4Nmh89tylI=";
|
||||
hash = "sha256-XnKNXYzg9wuL4U2twkAspaQJZy2HWLQQQl9AITtipVU=";
|
||||
};
|
||||
|
||||
patches = ./patches/core-go-update/pages/patch-deps.patch;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "all: server" ""
|
||||
|
||||
# fix build failure due to unused import
|
||||
substituteInPlace server.go \
|
||||
--replace-warn ' "fmt"' ""
|
||||
--replace-fail "all: server daily" ""
|
||||
'';
|
||||
|
||||
vendorHash = "sha256-9hpOkP6AYSZe7MW1mrwFEKq7TvVt6OcF6eHWY4jARuU=";
|
||||
vendorHash = "sha256-klDROxNvR7lk79ptckulImVVwsAfcnKtJJAaevlZSWU=";
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/sql/
|
||||
@@ -48,6 +46,6 @@ buildGoModule (
|
||||
}
|
||||
// import ./fix-gqlgen-trimpath.nix {
|
||||
inherit unzip;
|
||||
gqlgenVersion = "0.17.42";
|
||||
gqlgenVersion = "0.17.64";
|
||||
}
|
||||
)
|
||||
|
||||
@@ -8,49 +8,46 @@
|
||||
pyyaml,
|
||||
python,
|
||||
pythonOlder,
|
||||
setuptools,
|
||||
setuptools-scm,
|
||||
unzip,
|
||||
}:
|
||||
|
||||
let
|
||||
version = "0.15.4";
|
||||
version = "0.16.1";
|
||||
gqlgen = import ./fix-gqlgen-trimpath.nix {
|
||||
inherit unzip;
|
||||
gqlgenVersion = "0.17.45";
|
||||
gqlgenVersion = "0.17.64";
|
||||
};
|
||||
|
||||
patches = [ ./patches/core-go-update/paste/patch-deps.patch ];
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~sircmpwn";
|
||||
repo = "paste.sr.ht";
|
||||
rev = version;
|
||||
hash = "sha256-M38hAMRdMzcqxJv7j7foOIYEImr/ZYz/lbYOF9R9g2M=";
|
||||
hash = "sha256-SWtkE2/sTTJo0zAVFRfsA7fVF359OvgiHOT+yRaiads=";
|
||||
};
|
||||
|
||||
pastesrht-api = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "pastesrht-api";
|
||||
modRoot = "api";
|
||||
vendorHash = "sha256-vt5nSPcx+Y/SaWcqjV38DTL3ZtzmdjbkJYMv5Fhhnq4=";
|
||||
vendorHash = "sha256-uVqxPa1YggPgdSzGzXxVNdf4dM2DPGDXajkSXz4NhFM=";
|
||||
}
|
||||
// gqlgen
|
||||
);
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "pastesrht";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "all: api" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pip
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@@ -58,14 +55,20 @@ buildPythonPackage rec {
|
||||
pyyaml
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export PKGVER=${version}
|
||||
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
||||
env = {
|
||||
PKGVER = version;
|
||||
SRHT_PATH = "${srht}/${python.sitePackages}/srht";
|
||||
PREFIX = placeholder "out";
|
||||
};
|
||||
|
||||
postBuild = ''
|
||||
make SASSC_INCLUDE=-I${srht}/share/sourcehut/scss/ all-share
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/bin
|
||||
ln -s ${pastesrht-api}/bin/api $out/bin/pastesrht-api
|
||||
ln -s ${pastesrht-api}/bin/api $out/bin/paste.sr.ht-api
|
||||
make install-share
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "pastesrht" ];
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
diff --git a/go.mod b/go.mod
|
||||
index 07f7c64..972b258 100644
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -5,7 +5,7 @@ go 1.22.5
|
||||
toolchain go1.24.0
|
||||
|
||||
require (
|
||||
- git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b
|
||||
+ git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c
|
||||
github.com/99designs/gqlgen v0.17.64
|
||||
github.com/Masterminds/squirrel v1.5.4
|
||||
diff --git a/go.sum b/go.sum
|
||||
index aaccf89..73bfe7c 100644
|
||||
--- a/go.sum
|
||||
+++ b/go.sum
|
||||
@@ -1,5 +1,7 @@
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b h1:d76irAQODAtl5G1zmKfwf60544fyGz74YT9k+7yYVxc=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b h1:UuQxEJrh/NNdmaVcK34opEz7ypXnPyxeRcT7Aigz+7E=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c h1:v2opuaN0C5ZpuCifRNR9ZQ8V9IG+Ja80otK1MFj5RnI=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c/go.mod h1:8neHEO3503w/rNtttnR0JFpQgM/GFhaafVwvkPsFIDw=
|
||||
git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
diff --git a/go.mod b/go.mod
|
||||
index b1e0834..8299f9b 100644
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -5,7 +5,7 @@ go 1.22.5
|
||||
toolchain go1.24.0
|
||||
|
||||
require (
|
||||
- git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b
|
||||
+ git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c
|
||||
git.sr.ht/~sircmpwn/scm.sr.ht/srht-keys v0.0.0-20241202093706-8da5ec7e6b94
|
||||
git.sr.ht/~turminal/go-fnmatch v0.0.0-20211021204744-1a55764af6de
|
||||
diff --git a/go.sum b/go.sum
|
||||
index 193cce9..9b0bda4 100644
|
||||
--- a/go.sum
|
||||
+++ b/go.sum
|
||||
@@ -35,6 +35,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20240124105042-864816cfbc0c/go.mod h1:OovCpg5LsbYJjmDTpk5wUgHM4tUor736Pmxekm9BUcQ=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b h1:d76irAQODAtl5G1zmKfwf60544fyGz74YT9k+7yYVxc=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b h1:UuQxEJrh/NNdmaVcK34opEz7ypXnPyxeRcT7Aigz+7E=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20221010085743-46c4299d76a1/go.mod h1:8neHEO3503w/rNtttnR0JFpQgM/GFhaafVwvkPsFIDw=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c h1:v2opuaN0C5ZpuCifRNR9ZQ8V9IG+Ja80otK1MFj5RnI=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c/go.mod h1:8neHEO3503w/rNtttnR0JFpQgM/GFhaafVwvkPsFIDw=
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
diff --git a/go.mod b/go.mod
|
||||
index ba49458..3a31083 100644
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -5,7 +5,7 @@ go 1.22.5
|
||||
toolchain go1.24.0
|
||||
|
||||
require (
|
||||
- git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b
|
||||
+ git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c
|
||||
github.com/99designs/gqlgen v0.17.64
|
||||
github.com/Masterminds/squirrel v1.5.4
|
||||
diff --git a/go.sum b/go.sum
|
||||
index 61766aa..e01c045 100644
|
||||
--- a/go.sum
|
||||
+++ b/go.sum
|
||||
@@ -1,5 +1,7 @@
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b h1:d76irAQODAtl5G1zmKfwf60544fyGz74YT9k+7yYVxc=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b h1:UuQxEJrh/NNdmaVcK34opEz7ypXnPyxeRcT7Aigz+7E=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c h1:v2opuaN0C5ZpuCifRNR9ZQ8V9IG+Ja80otK1MFj5RnI=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c/go.mod h1:8neHEO3503w/rNtttnR0JFpQgM/GFhaafVwvkPsFIDw=
|
||||
git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
diff --git a/go.mod b/go.mod
|
||||
index ea624d5..3674152 100644
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -5,7 +5,7 @@ go 1.22.5
|
||||
toolchain go1.24.0
|
||||
|
||||
require (
|
||||
- git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b
|
||||
+ git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c
|
||||
github.com/99designs/gqlgen v0.17.64
|
||||
github.com/vektah/gqlparser/v2 v2.5.23
|
||||
diff --git a/go.sum b/go.sum
|
||||
index f67a555..a366a60 100644
|
||||
--- a/go.sum
|
||||
+++ b/go.sum
|
||||
@@ -1,5 +1,7 @@
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b h1:d76irAQODAtl5G1zmKfwf60544fyGz74YT9k+7yYVxc=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b h1:UuQxEJrh/NNdmaVcK34opEz7ypXnPyxeRcT7Aigz+7E=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c h1:v2opuaN0C5ZpuCifRNR9ZQ8V9IG+Ja80otK1MFj5RnI=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c/go.mod h1:8neHEO3503w/rNtttnR0JFpQgM/GFhaafVwvkPsFIDw=
|
||||
git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
diff --git a/go.mod b/go.mod
|
||||
index da34484..24757a0 100644
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -6,7 +6,7 @@ toolchain go1.24.0
|
||||
|
||||
require (
|
||||
git.sr.ht/~emersion/go-emailthreads v0.0.0-20230220165133-75c43015b6c2
|
||||
- git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b
|
||||
+ git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c
|
||||
github.com/99designs/gqlgen v0.17.64
|
||||
github.com/Masterminds/squirrel v1.5.4
|
||||
diff --git a/go.sum b/go.sum
|
||||
index 4590dd5..0c49985 100644
|
||||
--- a/go.sum
|
||||
+++ b/go.sum
|
||||
@@ -2,6 +2,8 @@ git.sr.ht/~emersion/go-emailthreads v0.0.0-20230220165133-75c43015b6c2 h1:5CkkRD
|
||||
git.sr.ht/~emersion/go-emailthreads v0.0.0-20230220165133-75c43015b6c2/go.mod h1:CQUF7XpyupxjwxlNX3PHRCYL+N2COXTRRRS4MgM49R4=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b h1:d76irAQODAtl5G1zmKfwf60544fyGz74YT9k+7yYVxc=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b h1:UuQxEJrh/NNdmaVcK34opEz7ypXnPyxeRcT7Aigz+7E=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c h1:v2opuaN0C5ZpuCifRNR9ZQ8V9IG+Ja80otK1MFj5RnI=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c/go.mod h1:8neHEO3503w/rNtttnR0JFpQgM/GFhaafVwvkPsFIDw=
|
||||
git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
diff --git a/go.mod b/go.mod
|
||||
index 21c7713..8f158a2 100644
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -5,7 +5,7 @@ go 1.22.5
|
||||
toolchain go1.24.0
|
||||
|
||||
require (
|
||||
- git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b
|
||||
+ git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c
|
||||
github.com/99designs/gqlgen v0.17.64
|
||||
github.com/vektah/gqlparser/v2 v2.5.23
|
||||
diff --git a/go.sum b/go.sum
|
||||
index f67a555..a366a60 100644
|
||||
--- a/go.sum
|
||||
+++ b/go.sum
|
||||
@@ -1,5 +1,7 @@
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b h1:d76irAQODAtl5G1zmKfwf60544fyGz74YT9k+7yYVxc=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b h1:UuQxEJrh/NNdmaVcK34opEz7ypXnPyxeRcT7Aigz+7E=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c h1:v2opuaN0C5ZpuCifRNR9ZQ8V9IG+Ja80otK1MFj5RnI=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c/go.mod h1:8neHEO3503w/rNtttnR0JFpQgM/GFhaafVwvkPsFIDw=
|
||||
git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
diff --git a/go.mod b/go.mod
|
||||
index 463f022..a7dc400 100644
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -8,7 +8,7 @@ require (
|
||||
git.sr.ht/~emersion/go-oauth2 v0.0.0-20240217160856-2e0d6e20b088
|
||||
git.sr.ht/~emersion/gqlclient v0.0.0-20230820050442-8873fe0204b9
|
||||
git.sr.ht/~sircmpwn/abused v0.0.0-20240216134550-21e8606c6f89
|
||||
- git.sr.ht/~sircmpwn/core-go v0.0.0-20250311090327-1e3cd785af1e
|
||||
+ git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c
|
||||
github.com/99designs/gqlgen v0.17.64
|
||||
github.com/Masterminds/squirrel v1.5.4
|
||||
diff --git a/go.sum b/go.sum
|
||||
index 9c08b1a..abf1a58 100644
|
||||
--- a/go.sum
|
||||
+++ b/go.sum
|
||||
@@ -6,6 +6,8 @@ git.sr.ht/~sircmpwn/abused v0.0.0-20240216134550-21e8606c6f89 h1:usW1i77LjfTfNzX
|
||||
git.sr.ht/~sircmpwn/abused v0.0.0-20240216134550-21e8606c6f89/go.mod h1:A+FTCDOSRA0naGMcM9OenO7kMhBxj+Kbd+4nBpg6NO4=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250311090327-1e3cd785af1e h1:epi/OdTKtazVbHHn1Qunx+nSHt96+xBBiNgs+SgRGwo=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250311090327-1e3cd785af1e/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b h1:UuQxEJrh/NNdmaVcK34opEz7ypXnPyxeRcT7Aigz+7E=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c h1:v2opuaN0C5ZpuCifRNR9ZQ8V9IG+Ja80otK1MFj5RnI=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c/go.mod h1:8neHEO3503w/rNtttnR0JFpQgM/GFhaafVwvkPsFIDw=
|
||||
git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
diff --git a/go.mod b/go.mod
|
||||
index 67aa15c..baffe8e 100644
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -6,7 +6,7 @@ toolchain go1.24.0
|
||||
|
||||
require (
|
||||
git.sr.ht/~adnano/go-gemini v0.2.3
|
||||
- git.sr.ht/~sircmpwn/core-go v0.0.0-20250326085317-29a3ebfee9d0
|
||||
+ git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c
|
||||
github.com/99designs/gqlgen v0.17.64
|
||||
github.com/CAFxX/httpcompression v0.0.9
|
||||
diff --git a/go.sum b/go.sum
|
||||
index ccd1f94..0945505 100644
|
||||
--- a/go.sum
|
||||
+++ b/go.sum
|
||||
@@ -1,5 +1,7 @@
|
||||
git.sr.ht/~adnano/go-gemini v0.2.3 h1:oJ+Y0/mheZ4Vg0ABjtf5dlmvq1yoONStiaQvmWWkofc=
|
||||
git.sr.ht/~adnano/go-gemini v0.2.3/go.mod h1:hQ75Y0i5jSFL+FQ7AzWVAYr5LQsaFC7v3ZviNyj46dY=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b h1:UuQxEJrh/NNdmaVcK34opEz7ypXnPyxeRcT7Aigz+7E=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250326085317-29a3ebfee9d0 h1:jFSTrW57GbcDoW850vw95zg0pLS1pe+cD5JtAQJ54ho=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250326085317-29a3ebfee9d0/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c h1:v2opuaN0C5ZpuCifRNR9ZQ8V9IG+Ja80otK1MFj5RnI=
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
diff --git a/go.mod b/go.mod
|
||||
index bc39fc4..bd01e53 100644
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -5,7 +5,7 @@ go 1.22.5
|
||||
toolchain go1.24.0
|
||||
|
||||
require (
|
||||
- git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b
|
||||
+ git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c
|
||||
github.com/99designs/gqlgen v0.17.64
|
||||
github.com/Masterminds/squirrel v1.5.4
|
||||
diff --git a/go.sum b/go.sum
|
||||
index 61766aa..e01c045 100644
|
||||
--- a/go.sum
|
||||
+++ b/go.sum
|
||||
@@ -1,5 +1,7 @@
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b h1:d76irAQODAtl5G1zmKfwf60544fyGz74YT9k+7yYVxc=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b h1:UuQxEJrh/NNdmaVcK34opEz7ypXnPyxeRcT7Aigz+7E=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c h1:v2opuaN0C5ZpuCifRNR9ZQ8V9IG+Ja80otK1MFj5RnI=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c/go.mod h1:8neHEO3503w/rNtttnR0JFpQgM/GFhaafVwvkPsFIDw=
|
||||
git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
diff --git a/go.mod b/go.mod
|
||||
index a352cfd..ab4beae 100644
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -5,7 +5,7 @@ go 1.22.5
|
||||
toolchain go1.24.0
|
||||
|
||||
require (
|
||||
- git.sr.ht/~sircmpwn/core-go v0.0.0-20250306104433-8e729e7539f4
|
||||
+ git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c
|
||||
github.com/99designs/gqlgen v0.17.64
|
||||
github.com/Masterminds/squirrel v1.5.4
|
||||
diff --git a/go.sum b/go.sum
|
||||
index 5342a85..50c87f1 100644
|
||||
--- a/go.sum
|
||||
+++ b/go.sum
|
||||
@@ -1,5 +1,7 @@
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250306104433-8e729e7539f4 h1:LvEcAyN0YDwqsa7QkFXne0bQEWAod6jAI2VIc+kk5sk=
|
||||
git.sr.ht/~sircmpwn/core-go v0.0.0-20250306104433-8e729e7539f4/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b h1:UuQxEJrh/NNdmaVcK34opEz7ypXnPyxeRcT7Aigz+7E=
|
||||
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c h1:v2opuaN0C5ZpuCifRNR9ZQ8V9IG+Ja80otK1MFj5RnI=
|
||||
git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c/go.mod h1:8neHEO3503w/rNtttnR0JFpQgM/GFhaafVwvkPsFIDw=
|
||||
git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
|
||||
+4
-3
@@ -23,16 +23,17 @@ diff --git a/srht/metrics.py b/srht/metrics.py
|
||||
index 68caf8e..2df5777 100644
|
||||
--- a/srht/metrics.py
|
||||
+++ b/srht/metrics.py
|
||||
@@ -1,11 +1,12 @@
|
||||
@@ -1,12 +1,12 @@
|
||||
import time
|
||||
+from celery import Celery
|
||||
from prometheus_client.metrics_core import GaugeMetricFamily
|
||||
from redis import Redis, ResponseError
|
||||
from redis import ResponseError
|
||||
-from srht.redis import from_url
|
||||
|
||||
|
||||
class RedisQueueCollector:
|
||||
def __init__(self, broker, name, documentation, queue_name="celery"):
|
||||
- self.redis = Redis.from_url(broker)
|
||||
- self.redis = from_url(broker)
|
||||
+ self.redis = Celery("collector", broker=broker).connection_for_read().channel().client
|
||||
self.queue_name = queue_name
|
||||
self.name = name
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
pyyaml,
|
||||
buildsrht,
|
||||
pythonOlder,
|
||||
setuptools,
|
||||
setuptools-scm,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "scmsrht";
|
||||
version = "0.22.24";
|
||||
version = "0.22.28";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
@@ -20,11 +20,11 @@ buildPythonPackage rec {
|
||||
owner = "~sircmpwn";
|
||||
repo = "scm.sr.ht";
|
||||
rev = version;
|
||||
hash = "sha256-9IgMmYzInfrten7z8bznlSFJlUjHf3k3z76lkP6tP50=";
|
||||
hash = "sha256-+zxqiz5yPpgTwAw7w8GqJFb3OCcJEH/UhS5u2Xs7pzo=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@@ -33,9 +33,7 @@ buildPythonPackage rec {
|
||||
buildsrht
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export PKGVER=${version}
|
||||
'';
|
||||
env.PKGVER = version;
|
||||
|
||||
pythonImportsCheck = [ "scmsrht" ];
|
||||
|
||||
|
||||
@@ -10,47 +10,44 @@
|
||||
python,
|
||||
unzip,
|
||||
pythonOlder,
|
||||
setuptools,
|
||||
setuptools-scm,
|
||||
}:
|
||||
|
||||
let
|
||||
version = "0.75.10";
|
||||
version = "0.77.5";
|
||||
gqlgen = import ./fix-gqlgen-trimpath.nix {
|
||||
inherit unzip;
|
||||
gqlgenVersion = "0.17.45";
|
||||
gqlgenVersion = "0.17.64";
|
||||
};
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~sircmpwn";
|
||||
repo = "todo.sr.ht";
|
||||
rev = version;
|
||||
hash = "sha256-3dVZdupsygM7/6T1Mn7yRc776aa9pKgwF0hgZX6uVQ0=";
|
||||
hash = "sha256-P+ypiW3GHoMClBmW5lUNAG6/sydHHnFGyGajmC3WARg=";
|
||||
};
|
||||
|
||||
patches = [ ./patches/core-go-update/todo/patch-deps.patch ];
|
||||
|
||||
todosrht-api = buildGoModule (
|
||||
{
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "todosrht-api";
|
||||
modRoot = "api";
|
||||
vendorHash = "sha256-fImOQLnQLHTrg5ikuYRZ+u+78exAiYA19DGQoUjQBOM=";
|
||||
vendorHash = "sha256-ny6cyUIgmupeU8SFP8+RSQU7DD3Lk+j+mZQBoXKv63I=";
|
||||
}
|
||||
// gqlgen
|
||||
);
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
inherit src version;
|
||||
inherit src version patches;
|
||||
pname = "todosrht";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "all: api" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@@ -58,13 +55,20 @@ buildPythonPackage rec {
|
||||
alembic
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export PKGVER=${version}
|
||||
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
||||
env = {
|
||||
PKGVER = version;
|
||||
SRHT_PATH = "${srht}/${python.sitePackages}/srht";
|
||||
PREFIX = placeholder "out";
|
||||
};
|
||||
|
||||
postBuild = ''
|
||||
make SASSC_INCLUDE=-I${srht}/share/sourcehut/scss/ all-share
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
ln -s ${todosrht-api}/bin/api $out/bin/todosrht-api
|
||||
ln -s ${todosrht-api}/bin/api $out/bin/todo.sr.ht-api
|
||||
install -Dm644 schema.sql $out/share/sourcehut/todo.sr.ht-schema.sql
|
||||
make install-share
|
||||
'';
|
||||
|
||||
# pytest tests fail
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
diff --git a/srht-gen-oauth-tok b/srht-gen-oauth-tok
|
||||
index a05e209..f2949b5 100755
|
||||
--- a/srht-gen-oauth-tok
|
||||
+++ b/srht-gen-oauth-tok
|
||||
@@ -78,7 +78,10 @@ $mech->submit_form( with_fields => { comment => $tok_comment } );
|
||||
|
||||
# Parse the response as XML and find the access token via an XPath expression
|
||||
my $xpc = XML::LibXML::XPathContext->new(
|
||||
- XML::LibXML->load_xml(string => $mech->content())
|
||||
+ XML::LibXML->load_html(
|
||||
+ string => $mech->content(),
|
||||
+ recover => 1,
|
||||
+ )
|
||||
);
|
||||
# The token is set as the description (<dd>) of a 'Personal Access Token' term (<dt>)
|
||||
my $token = $xpc->find("//dt[text() = 'Personal Access Token']/following-sibling::dd/*/node()");
|
||||
@@ -25,6 +25,8 @@ stdenv.mkDerivation rec {
|
||||
hash = "sha256-GcqP3XbVw2sR5n4+aLUmA4fthNkuVAGnhV1h7suJYdI=";
|
||||
};
|
||||
|
||||
patches = [ ./fix-html-parsing.patch ];
|
||||
|
||||
buildInputs = [ perl ];
|
||||
nativeBuildInputs = [ perl ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user