From 10d634cdc0c0e9b2d7f9d6a0983f755443b5b47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sat, 20 Jan 2024 06:31:40 +0200 Subject: [PATCH] pkgs: move to overlay --- flake.nix | 5 +++-- modules/e11sync/default.nix | 6 ++++-- overlays.nix | 17 +++++++++++++++++ pkgs.nix | 23 ----------------------- 4 files changed, 24 insertions(+), 27 deletions(-) create mode 100644 overlays.nix delete mode 100644 pkgs.nix diff --git a/flake.nix b/flake.nix index cfc3e08..6e453c6 100644 --- a/flake.nix +++ b/flake.nix @@ -36,8 +36,9 @@ ... }: flake-utils.lib.eachDefaultSystem (system: let - pkgs = import ./pkgs.nix { - inherit nixpkgs system geoip2-tarball; + pkgs = import nixpkgs { + inherit system; + overlays = import ./overlays.nix geoip2-tarball; }; in { packages = { diff --git a/modules/e11sync/default.nix b/modules/e11sync/default.nix index eb39f91..d596824 100644 --- a/modules/e11sync/default.nix +++ b/modules/e11sync/default.nix @@ -7,8 +7,10 @@ pkgs, ... }: let - inherit (pkgs.stdenv.hostPlatform) system; - pkgs1 = import ../../pkgs.nix {inherit nixpkgs system geoip2-tarball;}; + pkgs1 = import nixpkgs { + inherit (pkgs.stdenv.hostPlatform) system; + overlays = import ../../overlays.nix geoip2-tarball; + }; in { options.e11sync = with lib.types; { enable = lib.mkEnableOption "Enable e11sync"; diff --git a/overlays.nix b/overlays.nix new file mode 100644 index 0000000..92fcd83 --- /dev/null +++ b/overlays.nix @@ -0,0 +1,17 @@ +# 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 { + 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 {}; + }) +] diff --git a/pkgs.nix b/pkgs.nix deleted file mode 100644 index b7717da..0000000 --- a/pkgs.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - nixpkgs, - system, - geoip2-tarball, -}: -import nixpkgs { - inherit system; - overlays = [ - (_: super: { - python3 = super.python3.override { - packageOverrides = _: python-super: { - django = python-super.django_5; - }; - }; - geoip-mmdb = super.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 {}; - }) - ]; -}