aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-07-07 10:02:55 +0200
committerEelco Dolstra <edolstra@gmail.com>2021-07-07 10:02:55 +0200
commit3b3e6bb1e50fae42ab509b0e3910c93b83dc84cc (patch)
treee332cd4a420c39e2da12854f4951f91f0daebc32 /src
parente37ecd1282f7ab2799db54eea5a12d078a5bd96f (diff)
Style tweaks
Diffstat (limited to 'src')
-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