From 72a93d13683a54210fe5900af78cbdfc7255dce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=B9=82=E0=B8=97=E0=B8=AA=E0=B8=BA=E0=B8=95=E0=B8=B1?= =?UTF-8?q?=E0=B8=A5?= Date: Thu, 23 Jan 2025 17:08:42 +0700 Subject: [PATCH] docs: add more depth to Flake input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At present, if a user copy-pastes the current documentation, a version of Nixpkgs will be added to their ``flake.lock`` lockfile. This is probably not what the user wants as Nixpkgs, the tarball, is quite large & the user likely expects the StevenBlack Flake to be used as a module to just be using the Nixpkgs of the system. This change should also help new Nix users know how to pin a Nix version if there ever comes a time where the Nix :ac:`API` changes—even if ``lib`` tries to be stable & backwards-compatible. Additionally, provide a comment about where & what the input can be—such as a mirror or a local fork for development. Format: text/x-rst --- readme_template.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/readme_template.md b/readme_template.md index b9e134fce..af3df4140 100644 --- a/readme_template.md +++ b/readme_template.md @@ -386,7 +386,14 @@ like this: ```nix { - inputs.hosts.url = "github:StevenBlack/hosts"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs?ref=$YOUR-REF"; + hosts = { + url = "github:StevenBlack/hosts"; # or a fork/mirror + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + outputs = { self, nixpkgs, hosts }: { nixosConfigurations.my-hostname = { system = "";