mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
doc: fix example (#435473)
This commit is contained in:
@@ -659,13 +659,13 @@ If you have any problems with formatting, please ping the [formatting team](http
|
||||
Do
|
||||
|
||||
```nix
|
||||
{ rev = version; }
|
||||
{ tag = version; }
|
||||
```
|
||||
|
||||
instead of
|
||||
|
||||
```nix
|
||||
{ rev = "${version}"; }
|
||||
{ tag = "${version}"; }
|
||||
```
|
||||
|
||||
- Building lists conditionally _should_ be done with `lib.optional(s)` instead of using `if cond then [ ... ] else null` or `if cond then [ ... ] else [ ]`.
|
||||
|
||||
@@ -765,7 +765,7 @@ Used with Subversion. Expects `url` to a Subversion directory, `rev`, and `hash`
|
||||
|
||||
## `fetchgit` {#fetchgit}
|
||||
|
||||
Used with Git. Expects `url` to a Git repo, `rev`, and `hash`. `rev` in this case can be full the git commit id (SHA1 hash) or a tag name like `refs/tags/v1.0`.
|
||||
Used with Git. Expects `url` to a Git repo, `rev` or `tag`, and `hash`. `rev` in this case can be full the git commit id (SHA1 hash), or use `tag` for a tag name like `refs/tags/v1.0`.
|
||||
|
||||
If you want to fetch a tag you should pass the `tag` parameter instead of `rev` which has the same effect as setting `rev = "refs/tags"/${version}"`.
|
||||
This is safer than just setting `rev = version` w.r.t. possible branch and tag name conflicts.
|
||||
@@ -1005,4 +1005,3 @@ fetchtorrent {
|
||||
|
||||
- `config`: When using `transmission` as the `backend`, a json configuration can
|
||||
be supplied to transmission. Refer to the [upstream documentation](https://github.com/transmission/transmission/blob/main/docs/Editing-Configuration-Files.md) for information on how to configure.
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ crystal.buildCrystalPackage rec {
|
||||
src = fetchFromGitHub {
|
||||
owner = "mint-lang";
|
||||
repo = "mint";
|
||||
rev = version;
|
||||
tag = version;
|
||||
hash = "sha256-dFN9l5fgrM/TtOPqlQvUYgixE4KPr629aBmkwdDoq28=";
|
||||
};
|
||||
|
||||
@@ -68,7 +68,7 @@ crystal.buildCrystalPackage rec {
|
||||
src = fetchFromGitHub {
|
||||
owner = "mint-lang";
|
||||
repo = "mint";
|
||||
rev = version;
|
||||
tag = version;
|
||||
hash = "sha256-dFN9l5fgrM/TtOPqlQvUYgixE4KPr629aBmkwdDoq28=";
|
||||
};
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ nix-prefetch -E "{ sha256 }: ((import ./. { }).my-package.overrideAttrs { vendor
|
||||
version = "0.4.0";
|
||||
src = fetchFromGitHub {
|
||||
inherit (previousAttrs.src) owner repo;
|
||||
rev = "v${finalAttrs.version}";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-gVTpzmXekQxGMucDKskGi+e+34nJwwsXwvQTjRO6Gdg=";
|
||||
};
|
||||
vendorHash = "sha256-dUvp7FEW09V0xMuhewPGw3TuAic/sD7xyXEYviZ2Ivs=";
|
||||
|
||||
@@ -539,7 +539,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
src = fetchFromGitHub {
|
||||
owner = "...";
|
||||
repo = "...";
|
||||
rev = "v${finalAttrs.version}";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
|
||||
};
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ jd-cli.overrideMavenAttrs (old: rec {
|
||||
src = fetchFromGitHub {
|
||||
owner = old.src.owner;
|
||||
repo = old.src.repo;
|
||||
rev = "${old.pname}-${version}";
|
||||
tag = "${old.pname}-${version}";
|
||||
# old source hash of 1.2.0 version
|
||||
hash = "sha256-US7j6tQ6mh1libeHnQdFxPGoxHzbZHqehWSgCYynKx8=";
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ buildNimPackage (finalAttrs: {
|
||||
src = fetchFromGitHub {
|
||||
owner = "inv2004";
|
||||
repo = "ttop";
|
||||
rev = "v${finalAttrs.version}";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = lib.fakeHash;
|
||||
};
|
||||
|
||||
@@ -74,7 +74,7 @@ buildNimSbom (finalAttrs: {
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~ehmry";
|
||||
repo = "nim_lk";
|
||||
rev = finalAttrs.version;
|
||||
tag = finalAttrs.version;
|
||||
hash = lib.fakeHash;
|
||||
};
|
||||
buildInputs = [ openssl ];
|
||||
|
||||
@@ -307,7 +307,7 @@ stdenvNoCC.mkDerivation (
|
||||
src = fetchFromGitHub {
|
||||
owner = "git-owner";
|
||||
repo = "git-repo";
|
||||
rev = finalAttrs.version;
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-VcQRSss2dssfkJ+iUb5qT+FJ10GHiFDzySigcmuVI+8=";
|
||||
};
|
||||
in
|
||||
|
||||
Reference in New Issue
Block a user