commit 27e0979c86d71fb0c1cb8003690b80d8f80adef7 (tree)
parent dc72e8a2a4a2573f545781dabbba932e82b24599
Author: Motiejus Jakštys <motiejus@jakstys.lt>
Date: Sun, 14 Jan 2024 20:04:41 +0200
geoip-archive: move to it's own package
Diffstat:
2 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/flake.nix b/flake.nix
@@ -31,24 +31,18 @@
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
-
- geoip-archive = pkgs.stdenv.mkDerivation {
- name = "geoip-archive";
- srcs = [geoip2-asn geoip2-city geoip2-country];
- dontUnpack = true;
- installPhase = ''
- mkdir -p $out
- cp ${geoip2-asn} $out/GeoLite2-ASN.mmdb
- cp ${geoip2-city} $out/GeoLite2-City.mmdb
- cp ${geoip2-country} $out/GeoLite2-Country.mmdb
- '';
- };
in rec {
+ packages.geoip-archive = pkgs.callPackage ./pkgs/geoip-archive.nix {
+ inherit geoip2-asn geoip2-city geoip2-country;
+ };
+
packages.e11sync-static = pkgs.callPackage ./pkgs/e11sync-static.nix {
inherit self;
};
+
packages.e11sync = pkgs.callPackage ./pkgs/e11sync.nix {
- inherit self geoip-archive;
+ inherit self;
+ geoip-archive = packages.geoip-archive;
};
checks.e11sync = packages.e11sync.passthru.tests.simple;
@@ -65,7 +59,6 @@
};
devShells.default = pkgs.mkShellNoCC {
-
packages = with pkgs; [
python3Packages.django-debug-toolbar
python3Packages.django_5
@@ -74,7 +67,7 @@
libmaxminddb
dart-sass
];
- GEOIP_PATH = "${geoip-archive}";
+ GEOIP_PATH = "${packages.geoip-archive}";
E11SYNC_DEBUG = "1";
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
};
diff --git a/pkgs/geoip-archive.nix b/pkgs/geoip-archive.nix
@@ -0,0 +1,17 @@
+{
+ stdenv,
+ geoip2-asn,
+ geoip2-city,
+ geoip2-country,
+}:
+stdenv.mkDerivation {
+ name = "geoip-archive";
+ srcs = [geoip2-asn geoip2-city geoip2-country];
+ dontUnpack = true;
+ installPhase = ''
+ mkdir -p $out
+ cp ${geoip2-asn} $out/GeoLite2-ASN.mmdb
+ cp ${geoip2-city} $out/GeoLite2-City.mmdb
+ cp ${geoip2-country} $out/GeoLite2-Country.mmdb
+ '';
+}