forked from lix-project/lix
Add 'nix store' NAR-related manpages
This commit is contained in:
parent
2cc02bbe76
commit
c14ed3f8b2
|
@ -37,6 +37,13 @@ struct CmdCatStore : StoreCommand, MixCat
|
||||||
return "print the contents of a file in the Nix store on stdout";
|
return "print the contents of a file in the Nix store on stdout";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string doc() override
|
||||||
|
{
|
||||||
|
return
|
||||||
|
#include "store-cat.md"
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
void run(ref<Store> store) override
|
void run(ref<Store> store) override
|
||||||
{
|
{
|
||||||
cat(store->getFSAccessor());
|
cat(store->getFSAccessor());
|
||||||
|
|
|
@ -11,14 +11,11 @@ struct CmdDumpPath : StorePathCommand
|
||||||
return "serialise a store path to stdout in NAR format";
|
return "serialise a store path to stdout in NAR format";
|
||||||
}
|
}
|
||||||
|
|
||||||
Examples examples() override
|
std::string doc() override
|
||||||
{
|
{
|
||||||
return {
|
return
|
||||||
Example{
|
#include "store-dump-path.md"
|
||||||
"To get a NAR from the binary cache https://cache.nixos.org/:",
|
;
|
||||||
"nix store dump-path --store https://cache.nixos.org/ /nix/store/7crrmih8c52r8fbnqb933dxrsp44md93-glibc-2.25"
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void run(ref<Store> store, const StorePath & storePath) override
|
void run(ref<Store> store, const StorePath & storePath) override
|
||||||
|
|
|
@ -94,21 +94,18 @@ struct CmdLsStore : StoreCommand, MixLs
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Examples examples() override
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
Example{
|
|
||||||
"To list the contents of a store path in a binary cache:",
|
|
||||||
"nix store ls --store https://cache.nixos.org/ -lR /nix/store/0i2jd68mp5g6h2sa5k9c85rb80sn8hi9-hello-2.10"
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string description() override
|
std::string description() override
|
||||||
{
|
{
|
||||||
return "show information about a path in the Nix store";
|
return "show information about a path in the Nix store";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string doc() override
|
||||||
|
{
|
||||||
|
return
|
||||||
|
#include "store-ls.md"
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
void run(ref<Store> store) override
|
void run(ref<Store> store) override
|
||||||
{
|
{
|
||||||
list(store->getFSAccessor());
|
list(store->getFSAccessor());
|
||||||
|
|
19
src/nix/store-cat.md
Normal file
19
src/nix/store-cat.md
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
R""(
|
||||||
|
|
||||||
|
# Examples
|
||||||
|
|
||||||
|
* Show the contents of a file in a binary cache:
|
||||||
|
|
||||||
|
```console
|
||||||
|
# nix store cat --store https://cache.nixos.org/ \
|
||||||
|
/nix/store/0i2jd68mp5g6h2sa5k9c85rb80sn8hi9-hello-2.10/bin/hello | hexdump -C | head -n1
|
||||||
|
00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|
|
||||||
|
```
|
||||||
|
|
||||||
|
# Description
|
||||||
|
|
||||||
|
This command prints on standard output the contents of the regular
|
||||||
|
file *path* in a Nix store. *path* can be a top-level store path or
|
||||||
|
any file inside a store path.
|
||||||
|
|
||||||
|
)""
|
23
src/nix/store-dump-path.md
Normal file
23
src/nix/store-dump-path.md
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
R""(
|
||||||
|
|
||||||
|
# Examples
|
||||||
|
|
||||||
|
* To get a NAR containing the GNU Hello package:
|
||||||
|
|
||||||
|
```console
|
||||||
|
# nix store dump-path nixpkgs#hello > hello.nar
|
||||||
|
```
|
||||||
|
|
||||||
|
* To get a NAR from the binary cache https://cache.nixos.org/:
|
||||||
|
|
||||||
|
```console
|
||||||
|
# nix store dump-path --store https://cache.nixos.org/ \
|
||||||
|
/nix/store/7crrmih8c52r8fbnqb933dxrsp44md93-glibc-2.25 > glibc.nar
|
||||||
|
```
|
||||||
|
|
||||||
|
# Description
|
||||||
|
|
||||||
|
This command generates a NAR file containing the serialisation of the
|
||||||
|
store path *installable*. The NAR is written to standard output.
|
||||||
|
|
||||||
|
)""
|
27
src/nix/store-ls.md
Normal file
27
src/nix/store-ls.md
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
R""(
|
||||||
|
|
||||||
|
# Examples
|
||||||
|
|
||||||
|
* To list the contents of a store path in a binary cache:
|
||||||
|
|
||||||
|
```console
|
||||||
|
# nix store ls --store https://cache.nixos.org/ -lR /nix/store/0i2jd68mp5g6h2sa5k9c85rb80sn8hi9-hello-2.10
|
||||||
|
dr-xr-xr-x 0 ./bin
|
||||||
|
-r-xr-xr-x 38184 ./bin/hello
|
||||||
|
dr-xr-xr-x 0 ./share
|
||||||
|
…
|
||||||
|
```
|
||||||
|
|
||||||
|
* To show information about a specific file in a binary cache:
|
||||||
|
|
||||||
|
```console
|
||||||
|
# nix store ls --store https://cache.nixos.org/ -l /nix/store/0i2jd68mp5g6h2sa5k9c85rb80sn8hi9-hello-2.10/bin/hello
|
||||||
|
-r-xr-xr-x 38184 hello
|
||||||
|
```
|
||||||
|
|
||||||
|
# Description
|
||||||
|
|
||||||
|
This command shows information about *path* in a Nix store. *path* can
|
||||||
|
be a top-level store path or any file inside a store path.
|
||||||
|
|
||||||
|
)""
|
Loading…
Reference in a new issue