0

NixOS 用アプリケーションのプラグインをパッケージ化する方法は?

src tarball と複数のプラグインを含むアプリケーションを別のソースからインストールする。どのように、またはドキュメントへのポインターの例を楽しみにしています。

4

1 に答える 1

1

私の知る限り、このトピックに関するドキュメントはありませんが、pidgin または入力メソッドの管理方法の例を挙げることができます。

一般的な考え方は、次のとおりです。

  • メインパッケージ。
  • 1 つまたは複数のプラグイン パッケージ。
  • 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 ステップ進めます。

于 2016-07-11T04:58:05.267 に答える