summaryrefslogtreecommitdiff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/bookwyrm.nix142
-rw-r--r--pkgs/bookwyrm/default.nix94
-rw-r--r--pkgs/bookwyrm/unwrapped.nix80
-rw-r--r--pkgs/hikari.nix3
-rw-r--r--pkgs/mollysocket.nix2
-rw-r--r--pkgs/nomsring/nomsring.cabal2
-rw-r--r--pkgs/overlay.nix19
-rw-r--r--pkgs/patches/akkoma-fe-toki-pona-2.patch13
-rw-r--r--pkgs/patches/akkoma-fe-toki-pona.patch14
-rw-r--r--pkgs/wlroots_0_15.nix9
10 files changed, 212 insertions, 166 deletions
diff --git a/pkgs/bookwyrm.nix b/pkgs/bookwyrm.nix
deleted file mode 100644
index 92764ce..0000000
--- a/pkgs/bookwyrm.nix
+++ /dev/null
@@ -1,142 +0,0 @@
-{ lib
-, fetchFromGitHub
-, python
-, writeShellScriptBin
-, writeText
-, settings ? { }
-}:
-
-let
- # set some dummy values to make the package build
- settingsWithDefaults = {
- DOMAIN = "localhost";
- DEBUG = false;
- USE_HTTPS = false;
- EMAIL = "your@email.here";
- PGPORT = 5432;
- POSTGRES_USER = "bookwyrm";
- POSTGRES_DB = "bookwyrm";
- POSTGRES_HOST = "localhost";
- REDIS_ACTIVITY_HOST = "localhost";
- REDIS_ACTIVITY_PORT = 6379;
- REDIS_BROKER_HOST = "localhost";
- REDIS_BROKER_PORT = 6379;
- EMAIL_HOST = "smtp.example.com";
- EMAIL_PORT = 587;
- EMAIL_HOST_USER = "mail@example.org";
- EMAIL_HOST_PASSWORD = "blub";
- MEDIA_ROOT = "/var/lib/bookwyrm/images";
- } // settings;
-
- # toShellVar produces "" for false, which bookwyrm rejects
- toDjangoVar = name: value: lib.toShellVar name
- (if value == false then "false" else
- (if value == true then "true" else value));
-
- envfile = writeText "bookwyrm.env"
- (lib.strings.concatLines
- (lib.mapAttrsToList toDjangoVar settingsWithDefaults));
-
- bookwyrm = python.pkgs.buildPythonApplication rec {
- pname = "bookwyrm";
- version = "0.7.5";
-
- format = "other";
-
- src = fetchFromGitHub {
- owner = "bookwyrm-social";
- repo = "bookwyrm";
- rev = "refs/tags/v${version}";
- hash = "sha256-/oak9dEB2rR2z8b9oXVQ6+F2H7s0F5hVxmAlPdpaA0w=";
- };
-
- propagatedBuildInputs = with python.pkgs; [
- aiohttp
- bleach
- celery
- colorthief
- django
- django-celery-beat
- bw-file-resubmit
- django-compressor
- django-imagekit
- django-model-utils
- django-sass-processor
- django-csp
- django-oauth-toolkit
- django-storages
- django-pgtrigger
- s3-tar
- environs
- flower
- gunicorn
- libsass
- markdown
- packaging
- pillow
- psycopg2
- pycryptodome
- dateutil
- redis
- requests
- responses
- pytz
- boto3
- django-storages
- django-redis
- opentelemetry-api
- opentelemetry-exporter-otlp-proto-grpc
- # opentelemetry-instrumentation-celery
- opentelemetry-instrumentation-django
- # opentelemetry-instrumentation-pyscopg2
- opentelemetry-sdk
- protobuf
- pyotp
- qrcode
- grpcio
- ];
-
- postBuild = ''
- ln -s ${envfile} .env
- # needed for the python settings.py file to not fail, but not
- # used during the commands executed below, so this is safe
- export SECRET_KEY=fnord
-
- substituteInPlace contrib/systemd/* \
- --replace /opt/bookwyrm/venv/bin/gunicorn ${lib.getExe python.pkgs.gunicorn} \
- --replace /opt/bookwyrm/venv/bin/celery ${lib.getExe' python.pkgs.celery "celery"} \
- --replace /opt/bookwyrm $out
-
- sed -i /BindPath/d contrib/systemd/*
-
- python manage.py compile_themes
- python manage.py collectstatic --no-input
- '';
-
- postInstall = ''
- mkdir -p $out/lib/systemd/system
- cp -r * .env $out
- cp -r contrib/systemd/* $out/lib/systemd/system
- '';
-
- passthru = {
- pythonPath = python.pkgs.makePythonPath propagatedBuildInputs;
- gunicorn = python.pkgs.gunicorn;
- celery = python.pkgs.celery;
- manage = environmentFile: writeShellScriptBin "bookwyrm-manage.py" ''
- set -a
- ${if environmentFile != null
- then "source ${environmentFile}"
- else ""}
- export PYTHONPATH=${passthru.pythonPath}
- cd ${bookwyrm.outPath}
- exec ${bookwyrm.outPath}/manage.py "$@"
- '';
- };
-
- # hacky hacky hack
- shellHook = ''
- export PYTHONPATH=${passthru.pythonPath}
- '';
- };
-in bookwyrm
diff --git a/pkgs/bookwyrm/default.nix b/pkgs/bookwyrm/default.nix
new file mode 100644
index 0000000..e4c55bf
--- /dev/null
+++ b/pkgs/bookwyrm/default.nix
@@ -0,0 +1,94 @@
+{ lib
+, stdenvNoCC
+, writeShellScriptBin
+, writeText
+, source-han-sans-vf-ttf
+, bookwyrm-unwrapped
+, settings ? { }
+}:
+
+let
+ # set some dummy values to make the package build
+ settingsWithDefaults = {
+ DOMAIN = "localhost";
+ DEBUG = false;
+ USE_HTTPS = false;
+ EMAIL = "your@email.here";
+ PGPORT = 5432;
+ POSTGRES_USER = "bookwyrm";
+ POSTGRES_DB = "bookwyrm";
+ POSTGRES_HOST = "localhost";
+ REDIS_ACTIVITY_HOST = "localhost";
+ REDIS_ACTIVITY_PORT = 6379;
+ REDIS_BROKER_HOST = "localhost";
+ REDIS_BROKER_PORT = 6379;
+ EMAIL_HOST = "smtp.example.com";
+ EMAIL_PORT = 587;
+ EMAIL_HOST_USER = "mail@example.org";
+ EMAIL_HOST_PASSWORD = "blub";
+ MEDIA_ROOT = "/var/lib/bookwyrm/images";
+ } // settings;
+
+ # toShellVar produces "" for false, which bookwyrm rejects
+ toDjangoVar = name: value: lib.toShellVar name
+ (if value == false then "false" else
+ (if value == true then "true" else value));
+
+ envfile = writeText "bookwyrm.env"
+ (lib.strings.concatLines
+ (lib.mapAttrsToList toDjangoVar settingsWithDefaults));
+
+in stdenvNoCC.mkDerivation (finalAttrs: {
+ pname = "bookwyrm";
+ inherit (bookwyrm-unwrapped) version;
+ src = bookwyrm-unwrapped;
+
+ dontConfigure = true;
+
+ buildPhase = ''
+ runHook preBuild
+
+ ln -s ${envfile} .env
+ # needed for the python settings.py file to not fail, but not
+ # used during the commands executed below, so this is safe
+ export SECRET_KEY=fnord
+
+ export PYTHONPATH=${bookwyrm-unwrapped.pythonPath}
+ ./manage.py compile_themes
+ ./manage.py collectstatic --no-input
+
+ ln -s ${source-han-sans-vf-ttf}/share/fonts/variable/SourceHanSans-VF.ttf.ttc static/fonts/source_han_sans/
+
+ substituteInPlace contrib/systemd/* \
+ --replace /opt/bookwyrm/venv/bin/gunicorn ${lib.getExe bookwyrm-unwrapped.gunicorn} \
+ --replace /opt/bookwyrm/venv/bin/celery ${lib.getExe' bookwyrm-unwrapped.celery "celery"} \
+ --replace /opt/bookwyrm $out
+
+ sed -i /BindPath/d contrib/systemd/*
+
+ runHook postBuild
+ '';
+
+ installPhase = ''
+ runHook preInstall
+
+ mkdir -p $out/lib/systemd/system
+ cp -r * .env $out
+ cp -r contrib/systemd/* $out/lib/systemd/system
+
+ runHook postInstall
+ '';
+
+ passthru = rec {
+ inherit (bookwyrm-unwrapped) celery gunicorn pythonPath;
+ manage = environmentFile: writeShellScriptBin "bookwyrm-manage.py" ''
+ set -a
+ ${if environmentFile != null
+ then "source ${environmentFile}"
+ else ""}
+ export PYTHONPATH=${pythonPath}
+ cd ${finalAttrs.finalPackage.outPath}
+ exec ${finalAttrs.finalPackage.outPath}/manage.py "$@"
+ '';
+ };
+})
diff --git a/pkgs/bookwyrm/unwrapped.nix b/pkgs/bookwyrm/unwrapped.nix
new file mode 100644
index 0000000..151a9b5
--- /dev/null
+++ b/pkgs/bookwyrm/unwrapped.nix
@@ -0,0 +1,80 @@
+{ lib
+, fetchFromGitHub
+, python
+}:
+
+python.pkgs.buildPythonApplication rec {
+ pname = "bookwyrm-unwrapped";
+ version = "0.7.5";
+
+ format = "other";
+
+ src = fetchFromGitHub {
+ owner = "bookwyrm-social";
+ repo = "bookwyrm";
+ rev = "refs/tags/v${version}";
+ hash = "sha256-/oak9dEB2rR2z8b9oXVQ6+F2H7s0F5hVxmAlPdpaA0w=";
+ };
+
+ propagatedBuildInputs = with python.pkgs; [
+ aiohttp
+ bleach
+ celery
+ colorthief
+ django
+ django-celery-beat
+ bw-file-resubmit
+ django-compressor
+ django-imagekit
+ django-model-utils
+ django-sass-processor
+ django-csp
+ django-oauth-toolkit
+ django-storages
+ django-pgtrigger
+ s3-tar
+ environs
+ flower
+ gunicorn
+ libsass
+ markdown
+ packaging
+ pillow
+ psycopg2
+ pycryptodome
+ dateutil
+ redis
+ requests
+ responses
+ pytz
+ boto3
+ django-storages
+ django-redis
+ opentelemetry-api
+ opentelemetry-exporter-otlp-proto-grpc
+ # opentelemetry-instrumentation-celery
+ opentelemetry-instrumentation-django
+ # opentelemetry-instrumentation-pyscopg2
+ opentelemetry-sdk
+ protobuf
+ pyotp
+ qrcode
+ grpcio
+ ];
+
+ postInstall = ''
+ mkdir $out
+ cp -r * $out
+ '';
+
+ passthru = {
+ pythonPath = python.pkgs.makePythonPath propagatedBuildInputs;
+ gunicorn = python.pkgs.gunicorn;
+ celery = python.pkgs.celery;
+ };
+
+ # hacky hacky hack
+ shellHook = ''
+ export PYTHONPATH=${passthru.pythonPath}
+ '';
+}
diff --git a/pkgs/hikari.nix b/pkgs/hikari.nix
index 6506590..afbc335 100644
--- a/pkgs/hikari.nix
+++ b/pkgs/hikari.nix
@@ -2,6 +2,7 @@
, pkg-config, bmake
, cairo, glib, libevdev, libinput, libxkbcommon, linux-pam, pango, pixman
, libucl, wayland, wayland-protocols, wayland-scanner, wlroots, mesa
+, libdrm, libgbm
, features ? {
gammacontrol = true;
layershell = true;
@@ -27,6 +28,8 @@ stdenv.mkDerivation rec {
libevdev
libinput
libxkbcommon
+ libdrm
+ libgbm
linux-pam
pango
pixman
diff --git a/pkgs/mollysocket.nix b/pkgs/mollysocket.nix
index 1a079b4..a58c1a0 100644
--- a/pkgs/mollysocket.nix
+++ b/pkgs/mollysocket.nix
@@ -11,7 +11,7 @@ rustPlatform.buildRustPackage rec {
hash = "sha256-2OWkPTbrD4oXHoB+qszVjLr0e/AUuNnuaYXZ3kOyuxg=";
};
- cargoHash = "sha256-fVH5gzQYzW6uIBO8Fob04IiVyxHDh+Pr21rSow40qLk=";
+ cargoHash = "sha256-fR87PUgb+F2Q4vRYUonmGi6JzJLvGWPEKhwHw+TAsyQ=";
nativeBuildInputs = [ pkg-config ];
diff --git a/pkgs/nomsring/nomsring.cabal b/pkgs/nomsring/nomsring.cabal
index fca40c5..ea3625f 100644
--- a/pkgs/nomsring/nomsring.cabal
+++ b/pkgs/nomsring/nomsring.cabal
@@ -13,7 +13,7 @@ common warnings
executable nomsring
import: warnings
main-is: Main.hs
- build-depends: base ^>=4.18
+ build-depends: base
, cgi ^>=3001.5
, data-clist ^>= 0.2
default-language: GHC2021
diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix
index 2d561ff..f097b8a 100644
--- a/pkgs/overlay.nix
+++ b/pkgs/overlay.nix
@@ -12,7 +12,7 @@ let
radicle = import ./radicle.nix;
in
{
- beam = super.beam_nox;
+ beam = super.beam_minimal;
git-annex-remote-remarkable2 = self.callPackage
({ rustPlatform, fetchgit, ... }:
@@ -31,8 +31,11 @@ in
galmon-core = self.callPackage ./galmon.nix {};
galmon-full = self.callPackage ./galmon.nix { buildAll = true; };
- akkoma-fe = super.akkoma-frontends.akkoma-fe.overrideAttrs (old: {
- patches = [ ./patches/akkoma-fe-toki-pona.patch ];
+ akkoma-fe = super.akkoma-fe.overrideAttrs (old: {
+ patches = [
+ ./patches/akkoma-fe-toki-pona.patch
+ ./patches/akkoma-fe-toki-pona-2.patch
+ ];
});
akkoma = (self.callPackage ./akkoma {}).overrideAttrs {
@@ -202,7 +205,7 @@ in
, lib, stm, text, time, vector, wai, wai-extra, warp
}:
mkDerivation {
- pname = "bahnhof.name";
+ pname = "bahnhof-name";
version = "0.2.0.0";
src = inputs.bahnhof-name;
isLibrary = false;
@@ -212,6 +215,7 @@ in
http-client-openssl http-types stm text time vector wai wai-extra
warp
];
+ jailbreak = true;
mainProgram = "bahnhof-name";
license = lib.licenses.eupl12;
postInstall = ''
@@ -245,13 +249,13 @@ in
git-who = self.buildGoModule rec {
pname = "git-who";
- version = "0.7";
+ version = "1.1";
src = (self.fetchFromGitHub {
owner = "sinclairtarget";
repo = "git-who";
rev = "v${version}";
- hash = "sha256-Ujtwb4DTK7dUcyHvaF52a/YF3YO6WyszUIoxrEKE9jo=";
+ hash = "sha256-W3PDD0Gp9KStfa3+Wf2n8oxC5sp+YI/G5I3ukTg7H6k=";
# submodules contain test data and have ssh urls, hence this absurdity
fetchSubmodules = true;
leaveDotGit = true;
@@ -277,7 +281,8 @@ in
#### packaged mostly as shitpost / to play around with ####
- bookwyrm = (self.callPackage ./bookwyrm.nix {
+ bookwyrm = self.callPackage ./bookwyrm {};
+ bookwyrm-unwrapped = (self.callPackage ./bookwyrm/unwrapped.nix {
python = super.python312.override ({
packageOverrides = self: super: {
django-sass-processor = self.callPackage ./python/django-sass-processor.nix {};
diff --git a/pkgs/patches/akkoma-fe-toki-pona-2.patch b/pkgs/patches/akkoma-fe-toki-pona-2.patch
new file mode 100644
index 0000000..3dc549b
--- /dev/null
+++ b/pkgs/patches/akkoma-fe-toki-pona-2.patch
@@ -0,0 +1,13 @@
+diff --git a/src/lib/post_language.js b/src/lib/post_language.js
+index 7dcaebce..4d146773 100644
+--- a/src/lib/post_language.js
++++ b/src/lib/post_language.js
+@@ -3,7 +3,7 @@ import { computed } from 'vue'
+
+ export const usePostLanguageOptions = () => {
+ const postLanguageOptions = computed(() => {
+- return iso6391.getAllCodes().map(lang => ({
++ return iso6391.getAllCodes().concat(['tok']).map(lang => ({
+ key: lang,
+ value: lang,
+ label: lang,
diff --git a/pkgs/patches/akkoma-fe-toki-pona.patch b/pkgs/patches/akkoma-fe-toki-pona.patch
index 281fdfc..b556fb6 100644
--- a/pkgs/patches/akkoma-fe-toki-pona.patch
+++ b/pkgs/patches/akkoma-fe-toki-pona.patch
@@ -4,23 +4,9 @@ Date: Fri, 23 Jun 2023 01:56:43 +0200
Subject: [PATCH] mi la, toki pona li pona a
---
- src/components/post_status_form/post_status_form.js | 2 +-
src/services/locale/locale.service.js | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
-diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
-index 5647a9eb..25180ba9 100644
---- a/src/components/post_status_form/post_status_form.js
-+++ b/src/components/post_status_form/post_status_form.js
-@@ -303,7 +303,7 @@ const PostStatusForm = {
- mobileLayout: state => state.interface.mobileLayout
- }),
- isoLanguages () {
-- return iso6391.getAllCodes();
-+ return iso6391.getAllCodes().concat(['tok']);
- }
- },
- watch: {
diff --git a/src/services/locale/locale.service.js b/src/services/locale/locale.service.js
index 8cef2522..8bee6ad2 100644
--- a/src/services/locale/locale.service.js
diff --git a/pkgs/wlroots_0_15.nix b/pkgs/wlroots_0_15.nix
index 93095f8..6b63e4c 100644
--- a/pkgs/wlroots_0_15.nix
+++ b/pkgs/wlroots_0_15.nix
@@ -23,6 +23,9 @@
, glslang
, libliftoff
, libdisplay-info
+, libdrm
+, libgbm
+, cmake
, nixosTests
, enableXWayland ? true
@@ -47,6 +50,8 @@ stdenv.mkDerivation {
hash = "sha256-MFR38UuB/wW7J9ODDUOfgTzKLse0SSMIRYTpEaEdRwM=";
};
+ CFLAGS = [ "-Wno-calloc-transposed-args" ];
+
postPatch = ''
substituteInPlace backend/drm/meson.build \
--replace /usr/share/hwdata/ ${hwdata}/share/hwdata/
@@ -58,10 +63,12 @@ stdenv.mkDerivation {
strictDeps = true;
depsBuildBuild = [ pkg-config ];
- nativeBuildInputs = [ meson ninja pkg-config wayland-scanner glslang ];
+ nativeBuildInputs = [ meson ninja pkg-config wayland-scanner glslang cmake ];
buildInputs = [
libGL
+ libdrm
+ libgbm
libcap
libinput
libpng