1
Fork 0

flake.nix: avoid `rec`

This commit is contained in:
Motiejus Jakštys 2024-01-14 22:45:54 +02:00
parent 446413083a
commit 75fb04d227
1 changed files with 15 additions and 14 deletions

View File

@ -31,31 +31,32 @@
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
in rec {
packages.geoip-archive = pkgs.callPackage ./pkgs/geoip-archive.nix {
geoip-archive = pkgs.callPackage ./pkgs/geoip-archive.nix {
inherit geoip2-asn geoip2-city geoip2-country;
};
packages.e11sync-static = pkgs.callPackage ./pkgs/e11sync-static.nix {
e11sync-static = pkgs.callPackage ./pkgs/e11sync-static.nix {
inherit self;
};
packages.e11sync = pkgs.callPackage ./pkgs/e11sync.nix {
inherit self;
inherit (packages) geoip-archive;
e11sync = pkgs.callPackage ./pkgs/e11sync.nix {
inherit self geoip-archive;
};
in {
packages.geoip-archive = geoip-archive;
packages.e11sync-static = e11sync-static;
packages.e11sync = e11sync;
checks.e11sync-unit = packages.e11sync.passthru.tests.unit;
checks.e11sync-unit = e11sync.passthru.tests.unit;
apps.e11sync-gunicorn = {
type = "app";
name = "e11sync-gunicorn";
program = let
wrapper = pkgs.writeShellScript "wrapper" ''
export E11SYNC_DATABASE_PATH=$PWD/db.sqlite3
exec ${packages.e11sync}/bin/e11sync-gunicorn
'';
in "${wrapper}";
program = toString (pkgs.writeShellScript "wrapper" ''
export E11SYNC_DATABASE_PATH=$PWD/db.sqlite3
exec ${e11sync}/bin/e11sync-gunicorn
'');
};
devShells.default = pkgs.mkShellNoCC {
@ -67,7 +68,7 @@
libmaxminddb
dart-sass
];
GEOIP_PATH = "${packages.geoip-archive}";
GEOIP_PATH = "${geoip-archive}";
E11SYNC_DEBUG = "1";
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
};