aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libfetchers/registry.cc2
-rw-r--r--src/libfetchers/registry.hh2
-rw-r--r--src/nix/registry-pin.md2
-rw-r--r--src/nix/registry.cc11
4 files changed, 9 insertions, 8 deletions
diff --git a/src/libfetchers/registry.cc b/src/libfetchers/registry.cc
index c2dfa9dc6..f35359d4b 100644
--- a/src/libfetchers/registry.cc
+++ b/src/libfetchers/registry.cc
@@ -124,7 +124,7 @@ std::shared_ptr<Registry> getUserRegistry()
return userRegistry;
}
-std::shared_ptr<Registry> getCustomRegistry(Path p)
+std::shared_ptr<Registry> getCustomRegistry(const Path & p)
{
static auto customRegistry =
Registry::read(p, Registry::Custom);
diff --git a/src/libfetchers/registry.hh b/src/libfetchers/registry.hh
index cde22dff6..260a2c460 100644
--- a/src/libfetchers/registry.hh
+++ b/src/libfetchers/registry.hh
@@ -49,7 +49,7 @@ typedef std::vector<std::shared_ptr<Registry>> Registries;
std::shared_ptr<Registry> getUserRegistry();
-std::shared_ptr<Registry> getCustomRegistry(Path p);
+std::shared_ptr<Registry> getCustomRegistry(const Path & p);
Path getUserRegistryPath();
diff --git a/src/nix/registry-pin.md b/src/nix/registry-pin.md
index 7b163c463..ebc0e3eff 100644
--- a/src/nix/registry-pin.md
+++ b/src/nix/registry-pin.md
@@ -24,7 +24,7 @@ R""(
```
-* Pin `nixpkgs` in a custom registry to its most recent Git revision
+* Pin `nixpkgs` in a custom registry to its most recent Git revision:
```console
# nix registry pin --registry ./custom-flake-registry.json nixpkgs
diff --git a/src/nix/registry.cc b/src/nix/registry.cc
index ec80dc0bc..6a92576c7 100644
--- a/src/nix/registry.cc
+++ b/src/nix/registry.cc
@@ -11,13 +11,12 @@ using namespace nix;
using namespace nix::flake;
-class RegistryCommand: virtual Args
+class RegistryCommand : virtual Args
{
std::string registry_path;
std::shared_ptr<fetchers::Registry> registry;
-
public:
RegistryCommand()
@@ -30,7 +29,8 @@ public:
});
}
- std::shared_ptr<fetchers::Registry> getRegistry() {
+ std::shared_ptr<fetchers::Registry> getRegistry()
+ {
if (registry) return registry;
if (registry_path.empty()) {
registry = fetchers::getUserRegistry();
@@ -40,7 +40,8 @@ public:
return registry;
}
- Path getRegistryPath() {
+ Path getRegistryPath()
+ {
if (registry_path.empty()) {
return fetchers::getUserRegistryPath();
} else {
@@ -156,7 +157,7 @@ struct CmdRegistryPin : RegistryCommand, EvalCommand
std::string description() override
{
- return "pin a flake to its current version in user flake registry or to the current version of a flake URI";
+ return "pin a flake to its current version or to the current version of a flake URL";
}
std::string doc() override