From 9bc1db9fe07655f3a7ad565eb208b8ac5b9fa538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sat, 20 Jan 2024 12:04:23 +0200 Subject: [PATCH] add an overlay for e11sync --- app/e11sync/settings.py | 2 +- flake.nix | 9 ++++++--- overlays.nix | 27 +++++++++++++++------------ 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/app/e11sync/settings.py b/app/e11sync/settings.py index 8a64b12..afd7b62 100644 --- a/app/e11sync/settings.py +++ b/app/e11sync/settings.py @@ -38,7 +38,7 @@ SECRET_KEY = _SECRET_KEY DEBUG = _DEBUG -ALLOWED_HOSTS = ["127.0.0.1", "localhost", "11sync.net"] +ALLOWED_HOSTS = ["127.0.0.1", "localhost", "11sync.net", "admin.11sync.net"] INTERNAL_IPS = ["127.0.0.1"] diff --git a/flake.nix b/flake.nix index f4101af..51c4959 100644 --- a/flake.nix +++ b/flake.nix @@ -34,11 +34,12 @@ pre-commit-hooks, geoip2-tarball, ... - }: + }: let + overlays = import ./overlays.nix geoip2-tarball; + in flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { - inherit system; - overlays = import ./overlays.nix geoip2-tarball; + inherit system overlays; }; in { packages = { @@ -125,5 +126,7 @@ ]; }; nixosModules.e11sync = import ./modules/e11sync geoip2-tarball; + + overlays.default = overlays; }; } diff --git a/overlays.nix b/overlays.nix index 92fcd83..eec1699 100644 --- a/overlays.nix +++ b/overlays.nix @@ -1,17 +1,20 @@ -# If you consider exposing this overlay to the users, remove -# django overwrite from here. geoip2-tarball: [ - (_: super: { - python3 = super.python3.override { - packageOverrides = _: python-super: { - django = python-super.django_5; - }; - }; - geoip-mmdb = super.callPackage ./pkgs/geoip-mmdb.nix { + (_: super: let + withDjango5 = super.extend ( + _: super: { + python3 = super.python3.override { + packageOverrides = _: python-super: { + django = python-super.django_5; + }; + }; + } + ); + in { + geoip-mmdb = withDjango5.callPackage ./pkgs/geoip-mmdb.nix { inherit geoip2-tarball; }; - e11sync-static = super.callPackage ./pkgs/e11sync-static.nix {}; - e11sync-frontend = super.callPackage ./pkgs/e11sync-frontend.nix {}; - e11sync-backend = super.callPackage ./pkgs/e11sync-backend.nix {}; + e11sync-static = withDjango5.callPackage ./pkgs/e11sync-static.nix {}; + e11sync-frontend = withDjango5.callPackage ./pkgs/e11sync-frontend.nix {}; + e11sync-backend = withDjango5.callPackage ./pkgs/e11sync-backend.nix {}; }) ]