From e17646b0701e836525feb24c8f77e24244013d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Mon, 15 Jan 2024 07:50:38 +0200 Subject: [PATCH] flakes: get rid of `self` --- flake.nix | 8 ++------ pkgs/e11sync-static.nix | 9 ++++----- pkgs/e11sync.nix | 12 +++++------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/flake.nix b/flake.nix index 0b11b50..0cefd0f 100644 --- a/flake.nix +++ b/flake.nix @@ -35,13 +35,9 @@ inherit geoip2-asn geoip2-city geoip2-country; }; - e11sync-static = pkgs.callPackage ./pkgs/e11sync-static.nix { - inherit self; - }; + e11sync-static = pkgs.callPackage ./pkgs/e11sync-static.nix {}; - e11sync = pkgs.callPackage ./pkgs/e11sync.nix { - inherit self geoip-archive; - }; + e11sync = pkgs.callPackage ./pkgs/e11sync.nix {inherit geoip-archive;}; in { packages.geoip-archive = geoip-archive; packages.e11sync-static = e11sync-static; diff --git a/pkgs/e11sync-static.nix b/pkgs/e11sync-static.nix index 33f8c06..272a26f 100644 --- a/pkgs/e11sync-static.nix +++ b/pkgs/e11sync-static.nix @@ -1,5 +1,4 @@ { - self, stdenv, python3Packages, coreutils, @@ -10,20 +9,20 @@ }: stdenv.mkDerivation { name = "e11sync-static"; - src = self; + src = ../app; nativeBuildInputs = [ python3Packages.django_5 python3Packages.django-compressor dart-sass ]; - patchPhase = ''patchShebangs --build app/manage.py''; + patchPhase = ''patchShebangs --build manage.py''; buildPhase = '' mkdir -p static export E11SYNC_STATIC_ROOT=static export E11SYNC_DEBUG= export E11SYNC_COMPRESS_OFFLINE=1 - app/manage.py collectstatic - app/manage.py compress + ./manage.py collectstatic + ./manage.py compress ${findutils}/bin/find static/CACHE -name '*.css' | \ ${findutils}/bin/xargs -P''$(${coreutils}/bin/nproc) -I{} sh -c \ diff --git a/pkgs/e11sync.nix b/pkgs/e11sync.nix index 72098f1..0474a5a 100644 --- a/pkgs/e11sync.nix +++ b/pkgs/e11sync.nix @@ -1,5 +1,4 @@ { - self, lib, stdenv, runCommand, @@ -20,11 +19,11 @@ stdenv.mkDerivation { libmaxminddb ]; nativeBuildInputs = [makeWrapper]; - src = self; - patchPhase = ''patchShebangs --build app/manage.py''; + src = ../app; + patchPhase = ''patchShebangs --build manage.py''; buildPhase = ''mkdir -p $out''; installPhase = '' - cp -r app $out + cp -r . $out/app makeWrapper ${python3Packages.gunicorn}/bin/gunicorn $out/bin/e11sync-gunicorn \ --chdir $out/app \ --set-default E11SYNC_HTTP_PORT ${toString gunicornPort} \ @@ -42,7 +41,7 @@ stdenv.mkDerivation { ''; passthru.tests.unit = runCommand "e11sync-test" { - src = self; + src = ../app; buildInputs = [ python3Packages.django_5 python3Packages.django-compressor @@ -51,8 +50,7 @@ stdenv.mkDerivation { ]; } '' unpackPhase - patchShebangs --build $sourceRoot/app/manage.py - cd $sourceRoot + patchShebangs --build app/manage.py export GEOIP_PATH="${geoip-archive}" app/manage.py test app mkdir -p $out