1

Revert "nixosModules.e11sync: remove ${system}"

This reverts commit a7b32b6df5.
This commit is contained in:
Motiejus Jakštys 2024-01-17 15:03:44 +02:00
parent 250edb3472
commit a88bc7071c
2 changed files with 38 additions and 26 deletions

View File

@ -39,26 +39,44 @@
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ overlays = [
(_: prev: { (_: super: {
python3 = prev.python3.override { python3 = super.python3.override {
packageOverrides = _: python-prev: { packageOverrides = _: python-super: {
django = python-prev.django_5; django = python-super.django_5;
}; };
}; };
}) })
(_: prev: {
geoip-mmdb = prev.callPackage ./pkgs/geoip-mmdb.nix {
inherit geoip2-tarball;
};
e11sync-static = pkgs.callPackage ./pkgs/e11sync-static.nix {};
e11sync-frontend = pkgs.callPackage ./pkgs/e11sync-frontend.nix {};
e11sync-backend = pkgs.callPackage ./pkgs/e11sync-backend.nix {};
})
]; ];
}; };
geoip-mmdb = pkgs.callPackage ./pkgs/geoip-mmdb.nix {
inherit geoip2-tarball;
};
e11sync-static = pkgs.callPackage ./pkgs/e11sync-static.nix {};
e11sync-frontend = pkgs.callPackage ./pkgs/e11sync-frontend.nix {
inherit e11sync-static;
};
e11sync-backend = pkgs.callPackage ./pkgs/e11sync-backend.nix {
inherit geoip-mmdb;
e11sync-static-manifest = e11sync-static.passthru.manifest;
};
e11sync-module = import ./modules/e11sync {
inherit e11sync-backend e11sync-frontend;
};
in { in {
packages = {
inherit geoip-mmdb;
inherit e11sync-static;
inherit e11sync-frontend;
inherit e11sync-backend;
};
checks = { checks = {
e11sync-unit = pkgs.e11sync-backend.passthru.tests.unit; e11sync-unit = e11sync-backend.passthru.tests.unit;
pre-commit-check = pre-commit-hooks.lib.${system}.run { pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.; src = ./.;
hooks = { hooks = {
@ -74,9 +92,8 @@
''; '';
}; };
packages = { nixosModules.e11sync = e11sync-module;
inherit (pkgs) e11sync-static e11sync-frontend e11sync-backend; nixosModules.default = e11sync-module;
};
apps = { apps = {
e11sync-frontend = { e11sync-frontend = {
@ -92,7 +109,7 @@
debug debug
} }
:8001 :8001
${builtins.readFile "${pkgs.e11sync-frontend}"} ${builtins.readFile "${e11sync-frontend}"}
''; '';
}} --adapter caddyfile''); }} --adapter caddyfile'');
}; };
@ -101,7 +118,7 @@
name = "e11sync-backend"; name = "e11sync-backend";
program = toString (pkgs.writeShellScript "wrapper" '' program = toString (pkgs.writeShellScript "wrapper" ''
export E11SYNC_DATABASE_PATH=$PWD/db.sqlite3 export E11SYNC_DATABASE_PATH=$PWD/db.sqlite3
exec ${pkgs.e11sync-backend}/bin/e11sync-backend exec ${e11sync-backend}/bin/e11sync-backend
''); '');
}; };
}; };
@ -122,7 +139,7 @@
libmaxminddb libmaxminddb
dart-sass dart-sass
]; ];
GEOIP_PATH = "${pkgs.geoip-mmdb}"; GEOIP_PATH = "${geoip-mmdb}";
E11SYNC_DEBUG = "1"; E11SYNC_DEBUG = "1";
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive"; LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
inherit (self.checks.${system}.pre-commit-check) shellHook; inherit (self.checks.${system}.pre-commit-check) shellHook;
@ -139,10 +156,5 @@
self.nixosModules.x86_64-linux.e11sync self.nixosModules.x86_64-linux.e11sync
]; ];
}; };
nixosModules = rec {
e11sync = import ./modules/e11sync {};
nixosModules.default = e11sync;
};
}; };
} }

View File

@ -10,7 +10,7 @@
backendPort ? 8002, backendPort ? 8002,
databasePath ? null, databasePath ? null,
geoip-mmdb, geoip-mmdb,
e11sync-static, e11sync-static-manifest,
}: let }: let
uwsgi-python = uwsgi.override {plugins = ["python3"];}; uwsgi-python = uwsgi.override {plugins = ["python3"];};
pythonEnv = pythonEnv =
@ -50,7 +50,7 @@ in
${lib.optionalString (databasePath != null) '' ${lib.optionalString (databasePath != null) ''
--set E11SYNC_DATABASE_PATH "${databasePath}" \ --set E11SYNC_DATABASE_PATH "${databasePath}" \
''} \ ''} \
--set E11SYNC_STATIC_ROOT "${e11sync-static.passthru.manifest}" \ --set E11SYNC_STATIC_ROOT "${e11sync-static-manifest}" \
--set E11SYNC_COMPRESS_OFFLINE 1 \ --set E11SYNC_COMPRESS_OFFLINE 1 \
--set E11SYNC_DEBUG "" \ --set E11SYNC_DEBUG "" \
--set GEOIP_PATH "${geoip-mmdb}" \ --set GEOIP_PATH "${geoip-mmdb}" \