From a01d07c53318729f9e92746761a91f382c7bded4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Fri, 26 Jan 2024 17:02:21 +0200 Subject: [PATCH] pkgs: simplify --- flake.nix | 20 +++++++------------- pkgs/e11sync-backend.nix | 13 ++----------- pkgs/e11sync-static.nix | 3 +-- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/flake.nix b/flake.nix index a0b3fc1..bdb1cd3 100644 --- a/flake.nix +++ b/flake.nix @@ -94,19 +94,13 @@ }; devShells.default = pkgs.mkShellNoCC { - packages = with pkgs; [ - (python3.withPackages - (ps: [ - ps.django - ps.geoip2 - - ps.django-debug-toolbar - ps.flake8 - # TODO: vim integration via EXITINT? See make check - ps.autopep8 - ])) - libmaxminddb - dart-sass + packages = [ + ( + pkgs.python3.withPackages + (p: with p; [django geoip2 django-debug-toolbar flake8 autopep8]) + ) + pkgs.libmaxminddb + pkgs.dart-sass ]; GEOIP_PATH = "${pkgs.geoip-mmdb}"; E11SYNC_DEBUG = "1"; diff --git a/pkgs/e11sync-backend.nix b/pkgs/e11sync-backend.nix index 03ec0ed..697d58f 100644 --- a/pkgs/e11sync-backend.nix +++ b/pkgs/e11sync-backend.nix @@ -5,7 +5,6 @@ makeWrapper, python3, libmaxminddb, - dart-sass, uwsgi, backendPort ? 8002, databasePath ? null, @@ -13,12 +12,7 @@ e11sync-static, }: let uwsgi-python = uwsgi.override {plugins = ["python3"];}; - pythonEnv = - python3.withPackages - (ps: [ - ps.django - ps.geoip2 - ]); + pythonEnv = python3.withPackages (ps: [ps.django ps.geoip2]); in stdenv.mkDerivation { name = "e11sync-backend"; @@ -56,10 +50,7 @@ in passthru.tests.unit = runCommand "e11sync-test" { srcs = ../app; - buildInputs = [ - pythonEnv - dart-sass - ]; + buildInputs = [pythonEnv]; } '' unpackPhase patchShebangs --build app/manage.py diff --git a/pkgs/e11sync-static.nix b/pkgs/e11sync-static.nix index dba56a6..0c27039 100644 --- a/pkgs/e11sync-static.nix +++ b/pkgs/e11sync-static.nix @@ -24,8 +24,7 @@ # remove unversioned files (cd app/_static; - ${jq}/bin/jq -r '.paths | keys[]' staticfiles.json | \ - xargs rm + ${jq}/bin/jq -r '.paths | keys[]' staticfiles.json | xargs rm ) find app/_static \