NixOS 用アプリケーションのプラグインをパッケージ化する方法は?
src tarball と複数のプラグインを含むアプリケーションを別のソースからインストールする。どのように、またはドキュメントへのポインターの例を楽しみにしています。
私の知る限り、このトピックに関するドキュメントはありませんが、pidgin または入力メソッドの管理方法の例を挙げることができます。
一般的な考え方は、次のとおりです。
symlinkJoin
または同様の機能を使用して、メイン パッケージとプラグインを 1 つのパッケージに結合するラッパーパッケージ。たとえば、fcitx
入力メソッド関連の定義は次のall-packages.nix
とおりです。
fcitx = callPackage ../tools/inputmethods/fcitx { };
fcitx-engines = recurseIntoAttrs {
anthy = callPackage ../tools/inputmethods/fcitx-engines/fcitx-anthy { };
chewing = callPackage ../tools/inputmethods/fcitx-engines/fcitx-chewing { };
hangul = callPackage ../tools/inputmethods/fcitx-engines/fcitx-hangul { };
m17n = callPackage ../tools/inputmethods/fcitx-engines/fcitx-m17n { };
mozc = callPackage ../tools/inputmethods/fcitx-engines/fcitx-mozc {
inherit (pythonPackages) gyp;
protobuf = protobuf.override { stdenv = clangStdenv; };
};
table-other = callPackage ../tools/inputmethods/fcitx-engines/fcitx-table-other { };
cloudpinyin = callPackage ../tools/inputmethods/fcitx-engines/fcitx-cloudpinyin { };
};
fcitx-configtool = callPackage ../tools/inputmethods/fcitx/fcitx-configtool.nix { };
fcitx-with-plugins = callPackage ../tools/inputmethods/fcitx/wrapper.nix {
plugins = [ ];
};
environment.systemPackages
そのため、以下をリストに追加することにより (または専用の nixos モジュールを使用することにより) 、anthy および m17n プラグインを使用して fcitx をインストールすることができます。
pkgs.fcitx-with-plugins.override { plugins = [ fcitx-engines.anthy fcitx-engines.m17n ]; };
pidgin パッケージは、メイン パッケージとラッパーをマージすることで、因数分解をもう 1 ステップ進めます。