dotfiles/pkgs/postgresql-packages/default.nix

46 lines
1.3 KiB
Nix
Raw Normal View History

{ pkgs
, pkgs'
, isOverlay
, lib
, ... }:
let
inherit (pkgs') callPackage;
extraPackages = {
tsja = callPackage ./tsja.nix { };
};
gen' = postgresql: builtins.mapAttrs (k: v: v.override { inherit postgresql; }) extraPackages;
gen = ver:
lib.optionalAttrs isOverlay pkgs."postgresql${toString ver}Packages"
// gen' pkgs."postgresql${if ver == "" then "" else "_" + toString ver}";
2023-10-26 06:49:55 +07:00
psql = ver: let
old = pkgs."postgresql${if ver == "" then "" else "_" + toString ver}";
in old // { pkgs = old.pkgs // gen' old; };
self = {
mecab = pkgs.mecab.overrideAttrs (old: {
postInstall = ''
mkdir -p $out/lib/mecab/dic
ln -s ${callPackage /${pkgs.path}/pkgs/tools/text/mecab/ipadic.nix {
mecab-nodic = callPackage /${pkgs.path}/pkgs/tools/text/mecab/nodic.nix { };
}} $out/lib/mecab/dic/ipadic
'';
});
postgresqlPackages = gen "";
postgresql11Packages = gen 11;
postgresql12Packages = gen 12;
postgresql13Packages = gen 13;
postgresql14Packages = gen 14;
postgresql15Packages = gen 15;
postgresql16Packages = gen 16;
} // lib.optionalAttrs isOverlay {
postgresql = psql "";
postgresql_11 = psql 11;
postgresql_12 = psql 12;
postgresql_13 = psql 13;
postgresql_14 = psql 14;
postgresql_15 = psql 15;
2023-10-26 06:49:55 +07:00
postgresql_16 = psql 16;
};
in self