i take back what i said, it should be relevant now, though
Some checks failed
/ nix fmt (push) Has been cancelled

This commit is contained in:
Ittihadyya 2024-11-26 15:30:26 +02:00
parent 321f72f070
commit abd6c558a2
43 changed files with 929 additions and 978 deletions

View file

@ -1,50 +1,52 @@
{
aspartame.modules = [
(
{ pkgs, lib, ... }:
{
pkgs,
lib,
...
}: {
nixpkgs.overlays = [
(
final: prev:
let
caddy-custom = pkgs.callPackage ./caddy-custom.nix { };
in
let
final: prev: let
caddy-custom = pkgs.callPackage ./caddy-custom.nix {};
in let
# Caddy Layer4 modules
l4CaddyModules =
lib.lists.map
(name: {
inherit name;
repo = "github.com/mholt/caddy-l4";
version = "3d22d6da412883875f573ee4ecca3dbb3fdf0fd0";
})
[
"layer4"
"modules/l4proxy"
"modules/l4tls"
"modules/l4proxyprotocol"
];
in
{
(name: {
inherit name;
repo = "github.com/mholt/caddy-l4";
version = "3d22d6da412883875f573ee4ecca3dbb3fdf0fd0";
})
[
"layer4"
"modules/l4proxy"
"modules/l4tls"
"modules/l4proxyprotocol"
];
in {
caddy-default = caddy-custom;
caddy-base = caddy-custom.withPlugins { caddyModules = [ ]; };
caddy-base = caddy-custom.withPlugins {caddyModules = [];};
caddy-l4 = caddy-custom.withPlugins {
caddyModules = l4CaddyModules;
vendorHash = "sha256-Bz2tR1/a2okARCWFEeSEeVUx2mdBe0QKUh5qzKUOF8s=";
};
caddy-many = caddy-custom.withPlugins {
caddyModules = [
{
name = "transform-encoder";
repo = "github.com/caddyserver/transform-encoder";
version = "f627fc4f76334b7aef8d4ed8c99c7e2bcf94ac7d";
}
{
name = "connegmatcher";
repo = "github.com/mpilhlt/caddy-conneg";
version = "v0.1.4";
}
] ++ l4CaddyModules;
caddyModules =
[
{
name = "transform-encoder";
repo = "github.com/caddyserver/transform-encoder";
version = "f627fc4f76334b7aef8d4ed8c99c7e2bcf94ac7d";
}
{
name = "connegmatcher";
repo = "github.com/mpilhlt/caddy-conneg";
version = "v0.1.4";
}
]
++ l4CaddyModules;
vendorHash = "sha256-OjyJdcbLMSvgkHKR4xMF0BgsuA5kdKgDgV+ocuNHUf4=";
};
}
@ -52,21 +54,21 @@
];
}
)
({
{
nixpkgs.overlays = [
(final: prev: {
gts = final.callPackage ./gts.nix { };
gts = final.callPackage ./gts.nix {};
})
];
})
}
];
personal.modules = [
({
{
nixpkgs.overlays = [
(final: prev: {
beeref = final.callPackage ./beeref.nix { }; # I'M GOING TO TRUNCATE *YOU*, BEEREF.
beeref = final.callPackage ./beeref.nix {}; # I'M GOING TO TRUNCATE *YOU*, BEEREF.
})
];
})
}
];
}

View file

@ -3,9 +3,7 @@
fetchurl,
lib,
...
}:
let
}: let
name = "beeref";
version = "0.3.3";
src = fetchurl {
@ -13,13 +11,13 @@ let
hash = "sha256-pavXKtjOvKY2IUPp+UP0v8WkrpPeNEcNDhqoQtFYszo=";
};
in
appimageTools.wrapType2 {
inherit name version src;
extraPkgs = pkgs: [ pkgs.python311 ];
meta = with lib; {
description = "A Simple Reference Image Viewer";
homepage = "https://github.com/rbreu/beeref";
license = licenses.gpl3Only;
mainProgram = "beeref";
};
}
appimageTools.wrapType2 {
inherit name version src;
extraPkgs = pkgs: [pkgs.python311];
meta = with lib; {
description = "A Simple Reference Image Viewer";
homepage = "https://github.com/rbreu/beeref";
license = licenses.gpl3Only;
mainProgram = "beeref";
};
}

View file

@ -8,8 +8,7 @@
caddy,
testers,
stdenv,
}:
let
}: let
attrsToModule = map (plugin: plugin.repo);
attrsToVersionedModule = map (
{
@ -17,7 +16,7 @@ let
version,
...
}:
lib.escapeShellArg "${repo}@${version}"
lib.escapeShellArg "${repo}@${version}"
);
pname = "caddy";
@ -37,7 +36,7 @@ let
hash = "sha256-CBfyqtWp3gYsYwaIxbfXO3AYaBiM7LutLC7uZgYXfkQ=";
};
subPackages = [ "cmd/caddy" ];
subPackages = ["cmd/caddy"];
ldflags = [
"-s"
@ -46,7 +45,7 @@ let
];
# matches upstream since v2.8.0
tags = [ "nobadger" ];
tags = ["nobadger"];
nativeBuildInputs = [
gnused
@ -87,72 +86,71 @@ let
];
};
in
buildGoModule {
inherit
pname
version
src
subPackages
ldflags
tags
nativeBuildInputs
postInstall
meta
;
buildGoModule {
inherit
pname
version
src
subPackages
ldflags
tags
nativeBuildInputs
postInstall
meta
;
vendorHash = "sha256-1Api8bBZJ1/oYk4ZGIiwWCSraLzK9L+hsKXkFtk6iVM=";
vendorHash = "sha256-1Api8bBZJ1/oYk4ZGIiwWCSraLzK9L+hsKXkFtk6iVM=";
passthru = {
withPlugins =
{
passthru = {
withPlugins = {
caddyModules,
vendorHash ? lib.fakeHash,
}:
buildGoModule {
pname = "${caddy.pname}-with-plugins";
buildGoModule {
pname = "${caddy.pname}-with-plugins";
inherit
version
src
subPackages
ldflags
tags
nativeBuildInputs
postInstall
meta
;
inherit
version
src
subPackages
ldflags
tags
nativeBuildInputs
postInstall
meta
;
modBuildPhase = ''
for module in ${toString (attrsToModule caddyModules)}; do
sed -i "/standard/a _ \"$module\"" ./cmd/caddy/main.go
done
for plugin in ${toString (attrsToVersionedModule caddyModules)}; do
go get $plugin
done
go mod vendor
'';
modBuildPhase = ''
for module in ${toString (attrsToModule caddyModules)}; do
sed -i "/standard/a _ \"$module\"" ./cmd/caddy/main.go
done
for plugin in ${toString (attrsToVersionedModule caddyModules)}; do
go get $plugin
done
go mod vendor
'';
modInstallPhase = ''
mv -t vendor go.mod go.sum
cp -r vendor "$out"
'';
modInstallPhase = ''
mv -t vendor go.mod go.sum
cp -r vendor "$out"
'';
preBuild = ''
chmod -R u+w vendor
[ -f vendor/go.mod ] && mv -t . vendor/go.{mod,sum}
for module in ${toString (attrsToModule caddyModules)}; do
sed -i "/standard/a _ \"$module\"" ./cmd/caddy/main.go
done
'';
preBuild = ''
chmod -R u+w vendor
[ -f vendor/go.mod ] && mv -t . vendor/go.{mod,sum}
for module in ${toString (attrsToModule caddyModules)}; do
sed -i "/standard/a _ \"$module\"" ./cmd/caddy/main.go
done
'';
inherit vendorHash;
};
tests = {
inherit (nixosTests) caddy;
version = testers.testVersion {
command = "${caddy}/bin/caddy version";
package = caddy;
inherit vendorHash;
};
tests = {
inherit (nixosTests) caddy;
version = testers.testVersion {
command = "${caddy}/bin/caddy version";
package = caddy;
};
};
};
};
}
}

View file

@ -4,8 +4,7 @@
fetchFromGitHub,
buildGoModule,
nixosTests,
}:
let
}: let
owner = "superseriousbusiness";
repo = "gotosocial";
@ -16,63 +15,61 @@ let
hash = "sha256-85CmcWjcX8a+hZxkyRTfXErmkIx64R2scaaS2Fpf668=";
};
in
buildGoModule rec {
inherit version;
pname = repo;
buildGoModule rec {
inherit version;
pname = repo;
src = fetchFromGitHub {
inherit owner repo;
rev = "refs/tags/v${version}";
hash = "sha256-ql0tDaMc/1NgsLUpPHZB6GoXJj9DwUpadTX3AYufR/o=";
};
src = fetchFromGitHub {
inherit owner repo;
rev = "refs/tags/v${version}";
hash = "sha256-ql0tDaMc/1NgsLUpPHZB6GoXJj9DwUpadTX3AYufR/o=";
};
vendorHash = null;
vendorHash = null;
ldflags = [
"-s"
"-w"
"-X main.Version=${version}"
];
ldflags = [
"-s"
"-w"
"-X main.Version=${version}"
];
tags = [
"kvformat"
];
tags = [
"kvformat"
];
postInstall = ''
tar xf ${web-assets}
mkdir -p $out/share/gotosocial
mv web $out/share/gotosocial/
'';
postInstall = ''
tar xf ${web-assets}
mkdir -p $out/share/gotosocial
mv web $out/share/gotosocial/
'';
# tests are working only on x86_64-linux
# doCheck = stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64;
# checks are currently very unstable in our setup, so we should test manually for now
doCheck = false;
# tests are working only on x86_64-linux
# doCheck = stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64;
# checks are currently very unstable in our setup, so we should test manually for now
doCheck = false;
checkFlags =
let
checkFlags = let
# flaky / broken tests
skippedTests = [
# See: https://github.com/superseriousbusiness/gotosocial/issues/2651
"TestPage/minID,_maxID_and_limit_set"
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
in ["-skip=^${builtins.concatStringsSep "$|^" skippedTests}$"];
passthru.tests.gotosocial = nixosTests.gotosocial;
passthru.tests.gotosocial = nixosTests.gotosocial;
meta = with lib; {
homepage = "https://gotosocial.org";
changelog = "https://github.com/superseriousbusiness/gotosocial/releases/tag/v${version}";
description = "Fast, fun, ActivityPub server, powered by Go";
longDescription = ''
ActivityPub social network server, written in Golang.
You can keep in touch with your friends, post, read, and
share images and articles. All without being tracked or
advertised to! A light-weight alternative to Mastodon
and Pleroma, with support for clients!
'';
maintainers = with maintainers; [ blakesmith ];
license = licenses.agpl3Only;
};
}
meta = with lib; {
homepage = "https://gotosocial.org";
changelog = "https://github.com/superseriousbusiness/gotosocial/releases/tag/v${version}";
description = "Fast, fun, ActivityPub server, powered by Go";
longDescription = ''
ActivityPub social network server, written in Golang.
You can keep in touch with your friends, post, read, and
share images and articles. All without being tracked or
advertised to! A light-weight alternative to Mastodon
and Pleroma, with support for clients!
'';
maintainers = with maintainers; [blakesmith];
license = licenses.agpl3Only;
};
}