From d8b421bbcbc0b9b67a59c07859d834de0a876555 Mon Sep 17 00:00:00 2001 From: cor Date: Thu, 3 Nov 2022 20:14:55 +0100 Subject: [PATCH 1/3] Add composable --- flake-registry.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/flake-registry.json b/flake-registry.json index e82d255..7246a29 100644 --- a/flake-registry.json +++ b/flake-registry.json @@ -34,6 +34,17 @@ "type": "github" } }, + { + "from": { + "id": "composable", + "type": "indirect" + }, + "to": { + "owner": "ComposableFi", + "repo": "composable", + "type": "github" + } + }, { "from": { "id": "dreampkgs", From ba37c15310ace7e6259717403d41b4448d9063ab Mon Sep 17 00:00:00 2001 From: Jonas Chevalier Date: Sun, 9 Apr 2023 11:27:23 +0200 Subject: [PATCH 2/3] add CI (#45) Make sure that the schema stays valid --- .github/workflows/nix.yml | 15 +++++++++++++++ ci.sh | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100644 .github/workflows/nix.yml create mode 100755 ci.sh diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 0000000..87de711 --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,15 @@ +name: Nix +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v20 + - run: ./ci.sh diff --git a/ci.sh b/ci.sh new file mode 100755 index 0000000..5fc54dc --- /dev/null +++ b/ci.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Test that the flake-registry.json format is valid +set -euo pipefail + +cd "$(dirname "$0")" + +nix run --flake-registry "$PWD/flake-registry.json" nixpkgs#hello From 4ea5076e347dda44283714b8f4d580f6922064e9 Mon Sep 17 00:00:00 2001 From: Jonas Chevalier Date: Sun, 9 Apr 2023 11:27:41 +0200 Subject: [PATCH 3/3] add README (#43) The README is designed to let the visitor know: 1. What the purpose of the repository is 2. A quick overview of the feature (can be moved to proper docs) 3. How to contribute / inclusion policy 4. Document the publication pipeline Hopefully this will make things clearer to the visitor. --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..88202a7 --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +# Nix Flake Registry + +Welcome to the Nix Flake Registry repository! This repository contains the default [flake-registry.json](flake-registry.json) file utilized by the Nix CLI. The flake registry serves as a convenient method for the Nix CLI to associate short names with flake URIs, such as linking `nixpkgs` to `github:NixOS/nixpkgs/nixpkgs-unstable`. + +## Usage + +Mapped names from this registry are employed in two distinct contexts: + +### CLI + +The registry allows for more concise invocations of `nix run` and other Nix commands. + +For instance, when executing `nix run nixpkgs#hello`, the `nixpkgs` portion is resolved to the corresponding GitHub repository via the registry mapping. + +### Flake Inputs + +When a flake output function refers to an input that has not been explicitly specified, the input is resolved using the registry. + +Consider the following minimal `flake.nix` file: +```nix +{ + outputs = { self, nixpkgs }: { }; +} +``` + +Here, `self` refers to the flake itself, while `nixpkgs` is resolved automatically through the registry. + +> NOTE: Although this feature offers convenience, we recommend explicitly listing all inputs, as the flake registry content may change over time. + +## Registry File Format + +The file format is briefly documented here: . + +## Inclusion Policy + +Inclusion criteria are evaluated based on the following considerations: + +1. The namespace has a limited size. +2. Common names should be avoided to prevent confusion if a user mistypes an input in their `flake.nix` and it resolves to another input via the registry. +3. The shortcut must offer clear utility to the NixOS ecosystem; it is not intended to showcase random projects. +4. Project popularity is taken into account. + +When submitting a PR, please acknowledge and refer to these policy points for +argumentation. + +If your goal is to get your project listed somewhere, consider submitting it to instead. + +> NOTE: Some existing entries may not adhere to this policy due to historical reasons. + +## Publication Pipeline + +By default, the Nix CLI is configured to fetch the registry at . This URL is proxied to this repository using Fastly: +.