ITADN
NotAShelf/nyxexprs
NotAShelf/nyxexprs · 文件 下载 ZIP
文件最后提交记录最后更新时间
README.md
以下内容由 AI 翻译,如有问题请点此提交 issue 反馈

🌙 nyxexprs

欢迎来到 Nyxexprs!这是我的个人软件包集合和 overlay, 包含那些我无法确切上游到 Nixpkgs 的内容,或者有时我只是不想贡献的内容。这是从我的 个人 monorepo(即我的 NixOS 配置)中提取出来的,旨在为我的软件提供 公共缓存,并为我创建或觉得值得打包的内容提供集中化的打包解决方案。它还包含我从 个人 NixOS 配置中重构出来的软件包,Nyx(因此得名 "nyxexprs.")

[!NOTE] 此仓库通过 GitHub workflows 保持更新,并使用 npins 来 跟踪大多数依赖项。Flakes 用于使用统一的 Nixpkgs 来“重新导出”其他 flakes。 重复项通过 Flint 检测,该软件包在此处已打包 :)

用法

Nyxexprs 中的所有软件包都在 flake 输出中暴露,位于 packages 下。还 通过 flake-parts' easy-overlay 模块 提供了一个 overlay

Flakes

# In your flake.nix

{
  inputs = {
    # Your Nixpkgs input
    nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";

    # Add an input as such. Do NOT add the "follows" line (a typical flakes
    # pattern) if you intend to use the binary cache.
    nyxexprs.url = "github:notashelf/nyxexprs";
    
    # Other inputs
    # ...
  };
}

然后直接从输入中获取你需要的包

{ 
  inputs,
  ...
}: {
  # For this to be valid, you need `inputs` in the argset above and nyxexprs
  # to be in your `inputs`, as demonstrated in the flake.nix example. You 
  # will also need `inputs` to be in your `nixosSystem` call's `specialArgs`
  # or else you will not be able to access `inputs` in your modules.
  environment.systemPackages = [
    inputs.nyxexprs.packages.${pkgs.stdenv.hostPlatform.system}.tempus # example
  ];
}

Overlay

提供了一个 overlay。添加后,可按以下方式使用:

{
  inputs, # needs to be in scope, e.g., with `specialArgs`
  pkgs,
  ...
}: {
  nixpkgs.overlays = [inputs.nyxexprs.overlays.default];

  # Overlays modify the `pkgs` instance. If consumed, all
  # of my packages will be appended directly to your pkgs
  # at which point you can consume them as `pkgs.package`
  environment.systemPackages = [
    pkgs.tempus # example package
  ];
}

[!TIP] 如果你正在非 NixOS 发行版上使用 Nix,你可以使用 nix run 来试用 软件包,或者使用 nix profile install 将它们安装到你的系统配置中。如果 在非 NixOS 上使用 home-manager,我建议使用 home.packages 代替。

Binary Cache

无论您的配置如何,您可能希望将 binary cache 添加到您的 substituters 中,以避免在每次拉取时构建提供的软件包。您可以 按照下面的示例将 binary cache 添加到您的系统中。

{ 
  nix.settings = {
    builders-use-substitutes = true;
    substituters = [
        # Add the Nyx cache
        "https://nyx.cachix.org"
    ];

    trusted-public-keys = [
        # And the trusted public key for Nyx
        "nyx.cachix.org-1:xH6G0MO9PrpeGe7mHBtj1WbNzmnXr7jId2mCiq6hipE="

        # Other trusted public keys
        # ...
    ];
  };
}

🫂 致谢

该仓库的结构主要借鉴自 @fufexannix-gaming 仓库。感谢 fuf!

我还从 @diniamo 那里借鉴了一些关于检测未缓存包的 CI 逻辑, 该逻辑使用 niqspkgs 中的 GitHub workflows 来构建并缓存 Cachix 中缺失的包。

📜 License

本项目依据欧洲联盟公共许可证(EUPL) 第 1.2 版提供。有关确切条件的详细信息,请参阅 LICENSE。 在线副本提供于 [此处]。

本仓库中的所有内容,包括派生作品和补丁,均依据 EUPL v1.2 许可证授权。