id int64 0 755k | file_name stringlengths 3 109 | file_path stringlengths 13 185 | content stringlengths 31 9.38M | size int64 31 9.38M | language stringclasses 1
value | extension stringclasses 11
values | total_lines int64 1 340k | avg_line_length float64 2.18 149k | max_line_length int64 7 2.22M | alphanum_fraction float64 0 1 | repo_name stringlengths 6 65 | repo_stars int64 100 47.3k | repo_forks int64 0 12k | repo_open_issues int64 0 3.4k | repo_license stringclasses 9
values | repo_extraction_date stringclasses 92
values | exact_duplicates_redpajama bool 2
classes | near_duplicates_redpajama bool 2
classes | exact_duplicates_githubcode bool 2
classes | exact_duplicates_stackv2 bool 1
class | exact_duplicates_stackv1 bool 2
classes | near_duplicates_githubcode bool 2
classes | near_duplicates_stackv1 bool 2
classes | near_duplicates_stackv2 bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10,742 | why-depends.cc | NixOS_nix/src/nix/why-depends.cc | #include "command.hh"
#include "store-api.hh"
#include "progress-bar.hh"
#include "source-accessor.hh"
#include "shared.hh"
#include <queue>
using namespace nix;
static std::string hilite(const std::string & s, size_t pos, size_t len,
const std::string & colour = ANSI_RED)
{
return
std::string(s, 0, ... | 10,557 | C++ | .cc | 248 | 28.725806 | 142 | 0.497316 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,743 | derivation-add.cc | NixOS_nix/src/nix/derivation-add.cc | // FIXME: rename to 'nix plan add' or 'nix derivation add'?
#include "command.hh"
#include "common-args.hh"
#include "store-api.hh"
#include "archive.hh"
#include "derivations.hh"
#include <nlohmann/json.hpp>
using namespace nix;
using json = nlohmann::json;
struct CmdAddDerivation : MixDryRun, StoreCommand
{
st... | 1,096 | C++ | .cc | 33 | 28.090909 | 90 | 0.675547 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,744 | edit.cc | NixOS_nix/src/nix/edit.cc | #include "current-process.hh"
#include "command-installable-value.hh"
#include "shared.hh"
#include "eval.hh"
#include "attr-path.hh"
#include "progress-bar.hh"
#include "editor-for.hh"
#include <unistd.h>
using namespace nix;
struct CmdEdit : InstallableValueCommand
{
std::string description() override
{
... | 1,426 | C++ | .cc | 43 | 26.348837 | 93 | 0.617239 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,745 | derivation-show.cc | NixOS_nix/src/nix/derivation-show.cc | // FIXME: integrate this with nix path-info?
// FIXME: rename to 'nix store derivation show' or 'nix debug derivation show'?
#include "command.hh"
#include "common-args.hh"
#include "store-api.hh"
#include "archive.hh"
#include "derivations.hh"
#include <nlohmann/json.hpp>
using namespace nix;
using json = nlohmann::... | 1,676 | C++ | .cc | 51 | 25.960784 | 93 | 0.635236 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,746 | path-info.cc | NixOS_nix/src/nix/path-info.cc | #include "command.hh"
#include "shared.hh"
#include "store-api.hh"
#include "common-args.hh"
#include "nar-info.hh"
#include <algorithm>
#include <array>
#include <nlohmann/json.hpp>
#include "strings.hh"
using namespace nix;
using nlohmann::json;
/**
* @return the total size of a set of store objects (specified ... | 6,099 | C++ | .cc | 163 | 26.815951 | 111 | 0.554011 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,747 | config.cc | NixOS_nix/src/nix/config.cc | #include "command.hh"
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
#include "config-global.hh"
#include <nlohmann/json.hpp>
using namespace nix;
struct CmdConfig : NixMultiCommand
{
CmdConfig() : NixMultiCommand("config", RegisterCommand::getCommandsFor({"config"}))
{ }
std::st... | 1,913 | C++ | .cc | 59 | 24.728814 | 93 | 0.588907 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,748 | path-from-hash-part.cc | NixOS_nix/src/nix/path-from-hash-part.cc | #include "command.hh"
#include "store-api.hh"
using namespace nix;
struct CmdPathFromHashPart : StoreCommand
{
std::string hashPart;
CmdPathFromHashPart()
{
expectArgs({
.label = "hash-part",
.handler = {&hashPart},
});
}
std::string description() override... | 893 | C++ | .cc | 32 | 21.4375 | 107 | 0.62178 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,749 | build.cc | NixOS_nix/src/nix/build.cc | #include "command.hh"
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
#include "local-fs-store.hh"
#include "progress-bar.hh"
#include <nlohmann/json.hpp>
using namespace nix;
static nlohmann::json derivedPathsToJSON(const DerivedPaths & paths, Store & store)
{
auto res = nlohmann::json::a... | 5,418 | C++ | .cc | 145 | 26.717241 | 138 | 0.53619 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,750 | store.cc | NixOS_nix/src/nix/store.cc | #include "command.hh"
using namespace nix;
struct CmdStore : NixMultiCommand
{
CmdStore() : NixMultiCommand("store", RegisterCommand::getCommandsFor({"store"}))
{ }
std::string description() override
{
return "manipulate a Nix store";
}
Category category() override { return catUtilit... | 389 | C++ | .cc | 13 | 26.076923 | 85 | 0.71159 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,751 | dump-path.cc | NixOS_nix/src/nix/dump-path.cc | #include "command.hh"
#include "store-api.hh"
#include "archive.hh"
using namespace nix;
struct CmdDumpPath : StorePathCommand
{
std::string description() override
{
return "serialise a store path to stdout in NAR format";
}
std::string doc() override
{
return
#include "... | 1,542 | C++ | .cc | 60 | 19.766667 | 85 | 0.614286 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,752 | sigs.cc | NixOS_nix/src/nix/sigs.cc | #include "signals.hh"
#include "command.hh"
#include "shared.hh"
#include "store-api.hh"
#include "thread-pool.hh"
#include "progress-bar.hh"
#include <atomic>
using namespace nix;
struct CmdCopySigs : StorePathsCommand
{
Strings substituterUris;
CmdCopySigs()
{
addFlag({
.longName =... | 5,989 | C++ | .cc | 178 | 24.47191 | 108 | 0.56776 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,753 | repl.cc | NixOS_nix/src/nix/repl.cc | #include "eval.hh"
#include "eval-settings.hh"
#include "config-global.hh"
#include "globals.hh"
#include "command.hh"
#include "installable-value.hh"
#include "repl.hh"
#include "processes.hh"
#include "self-exe.hh"
namespace nix {
void runNix(Path program, const Strings & args,
const std::optional<std::string> ... | 3,195 | C++ | .cc | 101 | 23.188119 | 86 | 0.582792 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,754 | realisation.cc | NixOS_nix/src/nix/realisation.cc | #include "command.hh"
#include "common-args.hh"
#include <nlohmann/json.hpp>
using namespace nix;
struct CmdRealisation : NixMultiCommand
{
CmdRealisation() : NixMultiCommand("realisation", RegisterCommand::getCommandsFor({"realisation"}))
{ }
std::string description() override
{
return "man... | 2,277 | C++ | .cc | 61 | 27.967213 | 103 | 0.601726 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,755 | add-to-store.cc | NixOS_nix/src/nix/add-to-store.cc | #include "command.hh"
#include "common-args.hh"
#include "store-api.hh"
#include "archive.hh"
#include "git.hh"
#include "posix-source-accessor.hh"
#include "misc-store-flags.hh"
using namespace nix;
struct CmdAddToStore : MixDryRun, StoreCommand
{
Path path;
std::optional<std::string> namePart;
ContentAd... | 2,379 | C++ | .cc | 74 | 26.121622 | 121 | 0.640891 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,756 | prefetch.cc | NixOS_nix/src/nix/prefetch.cc | #include "command.hh"
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
#include "filetransfer.hh"
#include "finally.hh"
#include "progress-bar.hh"
#include "tarfile.hh"
#include "attr-path.hh"
#include "eval-inline.hh"
#include "legacy.hh"
#include "posix-source-accessor.hh"
#include "misc-store-f... | 11,613 | C++ | .cc | 287 | 30.515679 | 146 | 0.568182 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,757 | copy.cc | NixOS_nix/src/nix/copy.cc | #include "command.hh"
#include "shared.hh"
#include "store-api.hh"
using namespace nix;
struct CmdCopy : virtual CopyCommand, virtual BuiltPathsCommand
{
CheckSigsFlag checkSigs = CheckSigs;
SubstituteFlag substitute = NoSubstitute;
CmdCopy()
: BuiltPathsCommand(true)
{
addFlag({
... | 1,617 | C++ | .cc | 48 | 26.0625 | 113 | 0.627653 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,758 | verify.cc | NixOS_nix/src/nix/verify.cc | #include "command.hh"
#include "shared.hh"
#include "store-api.hh"
#include "thread-pool.hh"
#include "signals.hh"
#include "keys.hh"
#include <atomic>
#include "exit.hh"
using namespace nix;
struct CmdVerify : StorePathsCommand
{
bool noContents = false;
bool noTrust = false;
Strings substituterUris;
... | 5,951 | C++ | .cc | 145 | 25.834483 | 120 | 0.474141 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,759 | develop.cc | NixOS_nix/src/nix/develop.cc | #include "config-global.hh"
#include "eval.hh"
#include "installable-flake.hh"
#include "command-installable-value.hh"
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
#include "outputs-spec.hh"
#include "derivations.hh"
#include "progress-bar.hh"
#ifndef _WIN32 // TODO re-enable on Windows
# inc... | 25,172 | C++ | .cc | 620 | 30.535484 | 148 | 0.567346 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,760 | eval.cc | NixOS_nix/src/nix/eval.cc | #include "command-installable-value.hh"
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
#include "eval.hh"
#include "eval-inline.hh"
#include "value-to-json.hh"
#include "progress-bar.hh"
#include <nlohmann/json.hpp>
using namespace nix;
namespace nix::fs { using namespace std::filesystem; }
... | 4,449 | C++ | .cc | 118 | 25.118644 | 133 | 0.49559 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,761 | cat.cc | NixOS_nix/src/nix/cat.cc | #include "command.hh"
#include "store-api.hh"
#include "nar-accessor.hh"
#include "progress-bar.hh"
using namespace nix;
struct MixCat : virtual Args
{
std::string path;
void cat(ref<SourceAccessor> accessor)
{
auto st = accessor->lstat(CanonPath(path));
if (st.type != SourceAccessor::Typ... | 1,785 | C++ | .cc | 71 | 18.873239 | 76 | 0.593529 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,762 | make-content-addressed.cc | NixOS_nix/src/nix/make-content-addressed.cc | #include "command.hh"
#include "store-api.hh"
#include "make-content-addressed.hh"
#include "common-args.hh"
#include <nlohmann/json.hpp>
using namespace nix;
using nlohmann::json;
struct CmdMakeContentAddressed : virtual CopyCommand, virtual StorePathsCommand, MixJSON
{
CmdMakeContentAddressed()
{
... | 1,796 | C++ | .cc | 50 | 27.2 | 118 | 0.599654 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,763 | flake.cc | NixOS_nix/src/nix/flake.cc | #include "command.hh"
#include "installable-flake.hh"
#include "common-args.hh"
#include "shared.hh"
#include "eval.hh"
#include "eval-inline.hh"
#include "eval-settings.hh"
#include "flake/flake.hh"
#include "get-drvs.hh"
#include "signals.hh"
#include "store-api.hh"
#include "derivations.hh"
#include "outputs-spec.hh... | 60,716 | C++ | .cc | 1,328 | 29.236446 | 159 | 0.471504 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,764 | fmt.cc | NixOS_nix/src/nix/fmt.cc | #include "command.hh"
#include "installable-value.hh"
#include "eval.hh"
#include "run.hh"
using namespace nix;
struct CmdFmt : SourceExprCommand {
std::vector<std::string> args;
CmdFmt() { expectArgs({.label = "args", .handler = {&args}}); }
std::string description() override {
return "reformat... | 1,584 | C++ | .cc | 40 | 32.925 | 94 | 0.663179 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,765 | run.cc | NixOS_nix/src/nix/run.cc | #include "current-process.hh"
#include "run.hh"
#include "command-installable-value.hh"
#include "common-args.hh"
#include "shared.hh"
#include "signals.hh"
#include "store-api.hh"
#include "derivations.hh"
#include "local-fs-store.hh"
#include "finally.hh"
#include "source-accessor.hh"
#include "progress-bar.hh"
#incl... | 7,162 | C++ | .cc | 181 | 32.635359 | 137 | 0.621719 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,766 | nar.cc | NixOS_nix/src/nix/nar.cc | #include "command.hh"
using namespace nix;
struct CmdNar : NixMultiCommand
{
CmdNar() : NixMultiCommand("nar", RegisterCommand::getCommandsFor({"nar"}))
{ }
std::string description() override
{
return "create or inspect NAR files";
}
std::string doc() override
{
return
... | 479 | C++ | .cc | 19 | 20.105263 | 79 | 0.643172 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,767 | env.cc | NixOS_nix/src/nix/env.cc | #include <unordered_set>
#include <queue>
#include "command.hh"
#include "eval.hh"
#include "run.hh"
#include "strings.hh"
#include "executable-path.hh"
using namespace nix;
struct CmdEnv : NixMultiCommand
{
CmdEnv()
: NixMultiCommand("env", RegisterCommand::getCommandsFor({"env"}))
{
}
std:... | 3,384 | C++ | .cc | 91 | 28.791209 | 112 | 0.606793 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,768 | search.cc | NixOS_nix/src/nix/search.cc | #include "command-installable-value.hh"
#include "globals.hh"
#include "eval.hh"
#include "eval-inline.hh"
#include "eval-settings.hh"
#include "names.hh"
#include "get-drvs.hh"
#include "common-args.hh"
#include "shared.hh"
#include "eval-cache.hh"
#include "attr-path.hh"
#include "hilite.hh"
#include "strings-inline.... | 7,673 | C++ | .cc | 173 | 29.271676 | 128 | 0.493301 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,769 | log.cc | NixOS_nix/src/nix/log.cc | #include "command.hh"
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
#include "log-store.hh"
#include "progress-bar.hh"
using namespace nix;
struct CmdLog : InstallableCommand
{
std::string description() override
{
return "show the build log of the specified packages or paths, ... | 1,908 | C++ | .cc | 55 | 26.109091 | 102 | 0.580978 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,770 | config-check.cc | NixOS_nix/src/nix/config-check.cc | #include <sstream>
#include "command.hh"
#include "exit.hh"
#include "logging.hh"
#include "serve-protocol.hh"
#include "shared.hh"
#include "store-api.hh"
#include "local-fs-store.hh"
#include "worker-protocol.hh"
#include "executable-path.hh"
namespace nix::fs { using namespace std::filesystem; }
using namespace n... | 5,394 | C++ | .cc | 141 | 29.085106 | 111 | 0.577284 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,771 | main.cc | NixOS_nix/src/nix/main.cc | #include "args/root.hh"
#include "current-process.hh"
#include "command.hh"
#include "common-args.hh"
#include "eval.hh"
#include "eval-settings.hh"
#include "globals.hh"
#include "legacy.hh"
#include "shared.hh"
#include "store-api.hh"
#include "filetransfer.hh"
#include "finally.hh"
#include "loggers.hh"
#include "ma... | 17,392 | C++ | .cc | 477 | 29.048218 | 107 | 0.601391 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,772 | store-info.cc | NixOS_nix/src/nix/store-info.cc | #include "command.hh"
#include "shared.hh"
#include "store-api.hh"
#include "finally.hh"
#include <nlohmann/json.hpp>
using namespace nix;
struct CmdPingStore : StoreCommand, MixJSON
{
std::string description() override
{
return "test whether a store can be accessed";
}
std::string doc() ove... | 1,563 | C++ | .cc | 51 | 22.882353 | 78 | 0.564205 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,773 | app.cc | NixOS_nix/src/nix/app.cc | #include "installables.hh"
#include "installable-derived-path.hh"
#include "installable-value.hh"
#include "store-api.hh"
#include "eval-inline.hh"
#include "eval-cache.hh"
#include "names.hh"
#include "command.hh"
#include "derivations.hh"
#include "downstream-placeholder.hh"
namespace nix {
/**
* Return the rewrit... | 5,100 | C++ | .cc | 133 | 29.263158 | 101 | 0.595474 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,774 | hash.cc | NixOS_nix/src/nix/hash.cc | #include "command.hh"
#include "hash.hh"
#include "content-address.hh"
#include "legacy.hh"
#include "shared.hh"
#include "references.hh"
#include "archive.hh"
#include "git.hh"
#include "posix-source-accessor.hh"
#include "misc-store-flags.hh"
using namespace nix;
/**
* Base for `nix hash path`, `nix hash file` (de... | 10,236 | C++ | .cc | 297 | 25.875421 | 117 | 0.56185 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,775 | store-gc.cc | NixOS_nix/src/nix/store-gc.cc | #include "command.hh"
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
#include "store-cast.hh"
#include "gc-store.hh"
using namespace nix;
struct CmdStoreGC : StoreCommand, MixDryRun
{
GCOptions options;
CmdStoreGC()
{
addFlag({
.longName = "max",
.d... | 1,108 | C++ | .cc | 39 | 22.282051 | 84 | 0.624882 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,776 | self-exe.cc | NixOS_nix/src/nix/self-exe.cc | #include "current-process.hh"
#include "file-system.hh"
#include "globals.hh"
#include "self-exe.hh"
namespace nix {
namespace fs {
using namespace std::filesystem;
}
fs::path getNixBin(std::optional<std::string_view> binaryNameOpt)
{
auto getBinaryName = [&] { return binaryNameOpt ? *binaryNameOpt : "nix"; };
... | 1,168 | C++ | .cc | 33 | 30.151515 | 80 | 0.648625 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,777 | optimise-store.cc | NixOS_nix/src/nix/optimise-store.cc | #include "command.hh"
#include "shared.hh"
#include "store-api.hh"
#include <atomic>
using namespace nix;
struct CmdOptimiseStore : StoreCommand
{
std::string description() override
{
return "replace identical files in the store by hard links";
}
std::string doc() override
{
retu... | 560 | C++ | .cc | 23 | 19.608696 | 90 | 0.666667 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | true | false | false | true | false | false |
10,778 | profile.cc | NixOS_nix/src/nix/profile.cc | #include "command.hh"
#include "installable-flake.hh"
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
#include "derivations.hh"
#include "archive.hh"
#include "builtins/buildenv.hh"
#include "flake/flakeref.hh"
#include "../nix-env/user-env.hh"
#include "profiles.hh"
#include "names.hh"
#include ... | 32,691 | C++ | .cc | 859 | 27.250291 | 183 | 0.55511 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,779 | upgrade-nix.cc | NixOS_nix/src/nix/upgrade-nix.cc | #include "processes.hh"
#include "command.hh"
#include "common-args.hh"
#include "store-api.hh"
#include "filetransfer.hh"
#include "eval.hh"
#include "eval-settings.hh"
#include "attr-path.hh"
#include "names.hh"
#include "progress-bar.hh"
#include "executable-path.hh"
#include "self-exe.hh"
using namespace nix;
str... | 5,189 | C++ | .cc | 122 | 34.155738 | 126 | 0.619511 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,780 | registry.cc | NixOS_nix/src/nix/registry.cc | #include "command.hh"
#include "common-args.hh"
#include "shared.hh"
#include "eval.hh"
#include "flake/flake.hh"
#include "store-api.hh"
#include "fetchers.hh"
#include "registry.hh"
using namespace nix;
using namespace nix::flake;
class RegistryCommand : virtual Args
{
std::string registry_path;
std::shar... | 5,717 | C++ | .cc | 195 | 21.65641 | 94 | 0.579734 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,781 | store-copy-log.cc | NixOS_nix/src/nix/store-copy-log.cc | #include "command.hh"
#include "shared.hh"
#include "store-api.hh"
#include "store-cast.hh"
#include "log-store.hh"
#include "sync.hh"
#include "thread-pool.hh"
#include <atomic>
using namespace nix;
struct CmdCopyLog : virtual CopyCommand, virtual InstallablesCommand
{
std::string description() override
{
... | 1,159 | C++ | .cc | 35 | 27.085714 | 102 | 0.65681 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,782 | store-delete.cc | NixOS_nix/src/nix/store-delete.cc | #include "command.hh"
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
#include "store-cast.hh"
#include "gc-store.hh"
using namespace nix;
struct CmdStoreDelete : StorePathsCommand
{
GCOptions options { .action = GCOptions::gcDeleteSpecific };
CmdStoreDelete()
{
addFlag({
... | 1,159 | C++ | .cc | 39 | 23.564103 | 87 | 0.640864 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,783 | derivation.cc | NixOS_nix/src/nix/derivation.cc | #include "command.hh"
using namespace nix;
struct CmdDerivation : NixMultiCommand
{
CmdDerivation() : NixMultiCommand("derivation", RegisterCommand::getCommandsFor({"derivation"}))
{ }
std::string description() override
{
return "Work with derivations, Nix's notion of a build plan.";
}
... | 454 | C++ | .cc | 13 | 31.076923 | 100 | 0.736239 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,784 | bundle.cc | NixOS_nix/src/nix/bundle.cc | #include "installable-flake.hh"
#include "command-installable-value.hh"
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
#include "local-fs-store.hh"
#include "eval-inline.hh"
namespace nix::fs { using namespace std::filesystem; }
using namespace nix;
struct CmdBundle : InstallableValueCommand
... | 4,467 | C++ | .cc | 109 | 31.963303 | 124 | 0.605816 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,785 | store-repair.cc | NixOS_nix/src/nix/store-repair.cc | #include "command.hh"
#include "store-api.hh"
using namespace nix;
struct CmdStoreRepair : StorePathsCommand
{
std::string description() override
{
return "repair store paths";
}
std::string doc() override
{
return
#include "store-repair.md"
;
}
void r... | 550 | C++ | .cc | 22 | 19.590909 | 81 | 0.638623 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,786 | daemon.cc | NixOS_nix/src/nix/unix/daemon.cc | ///@file
#include "signals.hh"
#include "unix-domain-socket.hh"
#include "command.hh"
#include "shared.hh"
#include "local-store.hh"
#include "remote-store.hh"
#include "remote-store-connection.hh"
#include "serialise.hh"
#include "archive.hh"
#include "globals.hh"
#include "config-global.hh"
#include "derivations.hh"... | 19,942 | C++ | .cc | 529 | 30.493384 | 240 | 0.625861 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,787 | nix-build.cc | NixOS_nix/src/nix-build/nix-build.cc | #include <cstring>
#include <fstream>
#include <iostream>
#include <filesystem>
#include <regex>
#include <sstream>
#include <vector>
#include <map>
#include <nlohmann/json.hpp>
#include "current-process.hh"
#include "parsed-derivations.hh"
#include "store-api.hh"
#include "local-fs-store.hh"
#include "globals.hh"
#i... | 26,594 | C++ | .cc | 599 | 32.624374 | 153 | 0.543929 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,788 | common-protocol.cc | NixOS_nix/src/libstore/common-protocol.cc | #include "serialise.hh"
#include "path-with-outputs.hh"
#include "store-api.hh"
#include "build-result.hh"
#include "common-protocol.hh"
#include "common-protocol-impl.hh"
#include "archive.hh"
#include "derivations.hh"
#include <nlohmann/json.hpp>
namespace nix {
/* protocol-agnostic definitions */
std::string Com... | 3,095 | C++ | .cc | 73 | 39.917808 | 169 | 0.768846 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,789 | path-references.cc | NixOS_nix/src/libstore/path-references.cc | #include "path-references.hh"
#include "hash.hh"
#include "archive.hh"
#include <map>
#include <cstdlib>
#include <mutex>
#include <algorithm>
namespace nix {
PathRefScanSink::PathRefScanSink(StringSet && hashes, std::map<std::string, StorePath> && backMap)
: RefScanSink(std::move(hashes))
, backMap(std::m... | 1,710 | C++ | .cc | 56 | 26.392857 | 98 | 0.693529 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,790 | path-with-outputs.cc | NixOS_nix/src/libstore/path-with-outputs.cc | #include <regex>
#include "path-with-outputs.hh"
#include "store-api.hh"
#include "strings.hh"
namespace nix {
std::string StorePathWithOutputs::to_string(const StoreDirConfig & store) const
{
return outputs.empty()
? store.printStorePath(path)
: store.printStorePath(path) + "!" + concatStringsS... | 3,474 | C++ | .cc | 87 | 30.367816 | 109 | 0.592878 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,791 | binary-cache-store.cc | NixOS_nix/src/libstore/binary-cache-store.cc | #include "archive.hh"
#include "binary-cache-store.hh"
#include "compression.hh"
#include "derivations.hh"
#include "source-accessor.hh"
#include "globals.hh"
#include "nar-info.hh"
#include "sync.hh"
#include "remote-fs-accessor.hh"
#include "nar-info-disk-cache.hh"
#include "nar-accessor.hh"
#include "thread-pool.hh"... | 18,681 | C++ | .cc | 458 | 32.796943 | 124 | 0.625538 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,792 | ssh-store.cc | NixOS_nix/src/libstore/ssh-store.cc | #include "ssh-store.hh"
#include "local-fs-store.hh"
#include "remote-store-connection.hh"
#include "source-accessor.hh"
#include "archive.hh"
#include "worker-protocol.hh"
#include "worker-protocol-impl.hh"
#include "pool.hh"
#include "ssh.hh"
namespace nix {
SSHStoreConfig::SSHStoreConfig(
std::string_view sche... | 6,471 | C++ | .cc | 191 | 28.413613 | 114 | 0.69136 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,793 | path-info.cc | NixOS_nix/src/libstore/path-info.cc | #include <nlohmann/json.hpp>
#include "path-info.hh"
#include "store-api.hh"
#include "json-utils.hh"
#include "comparator.hh"
#include "strings.hh"
namespace nix {
GENERATE_CMP_EXT(
,
std::weak_ordering,
UnkeyedValidPathInfo,
me->deriver,
me->narHash,
me->references,
me->registrationTime... | 6,440 | C++ | .cc | 186 | 27.645161 | 117 | 0.62963 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,794 | remote-store.cc | NixOS_nix/src/libstore/remote-store.cc | #include "serialise.hh"
#include "util.hh"
#include "path-with-outputs.hh"
#include "gc-store.hh"
#include "remote-fs-accessor.hh"
#include "build-result.hh"
#include "remote-store.hh"
#include "remote-store-connection.hh"
#include "worker-protocol.hh"
#include "worker-protocol-impl.hh"
#include "archive.hh"
#include "... | 31,430 | C++ | .cc | 816 | 29.101716 | 145 | 0.596333 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,795 | legacy-ssh-store.cc | NixOS_nix/src/libstore/legacy-ssh-store.cc | #include "legacy-ssh-store.hh"
#include "common-ssh-store-config.hh"
#include "archive.hh"
#include "pool.hh"
#include "remote-store.hh"
#include "serve-protocol.hh"
#include "serve-protocol-connection.hh"
#include "serve-protocol-impl.hh"
#include "build-result.hh"
#include "store-api.hh"
#include "path-with-outputs.h... | 9,077 | C++ | .cc | 261 | 28.015326 | 229 | 0.630725 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,796 | serve-protocol.cc | NixOS_nix/src/libstore/serve-protocol.cc | #include "serialise.hh"
#include "path-with-outputs.hh"
#include "store-api.hh"
#include "build-result.hh"
#include "serve-protocol.hh"
#include "serve-protocol-impl.hh"
#include "archive.hh"
#include "path-info.hh"
#include <nlohmann/json.hpp>
namespace nix {
/* protocol-specific definitions */
BuildResult ServePr... | 4,506 | C++ | .cc | 117 | 32.051282 | 147 | 0.665827 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,797 | path.cc | NixOS_nix/src/libstore/path.cc | #include "store-dir-config.hh"
namespace nix {
void checkName(std::string_view name)
{
if (name.empty())
throw BadStorePathName("name must not be empty");
if (name.size() > StorePath::MaxPathLen)
throw BadStorePathName("name '%s' must be no longer than %d characters", name, StorePath::MaxPathL... | 4,149 | C++ | .cc | 114 | 31.184211 | 126 | 0.615327 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,798 | realisation.cc | NixOS_nix/src/libstore/realisation.cc | #include "realisation.hh"
#include "store-api.hh"
#include "closure.hh"
#include "signature/local-keys.hh"
#include <nlohmann/json.hpp>
namespace nix {
MakeError(InvalidDerivationOutputId, Error);
DrvOutput DrvOutput::parse(const std::string &strRep) {
size_t n = strRep.find("!");
if (n == strRep.npos)
... | 6,574 | C++ | .cc | 176 | 30.852273 | 113 | 0.653786 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,799 | machines.cc | NixOS_nix/src/libstore/machines.cc | #include "machines.hh"
#include "globals.hh"
#include "store-api.hh"
#include <algorithm>
namespace nix {
Machine::Machine(
const std::string & storeUri,
decltype(systemTypes) systemTypes,
decltype(sshKey) sshKey,
decltype(maxJobs) maxJobs,
decltype(speedFactor) speedFactor,
decltype(supporte... | 6,997 | C++ | .cc | 186 | 30.575269 | 141 | 0.612266 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,800 | http-binary-cache-store.cc | NixOS_nix/src/libstore/http-binary-cache-store.cc | #include "http-binary-cache-store.hh"
#include "filetransfer.hh"
#include "globals.hh"
#include "nar-info-disk-cache.hh"
#include "callback.hh"
namespace nix {
MakeError(UploadToHTTP, Error);
HttpBinaryCacheStoreConfig::HttpBinaryCacheStoreConfig(
std::string_view scheme,
std::string_view _cacheUri,
con... | 6,341 | C++ | .cc | 182 | 25.813187 | 109 | 0.582409 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,801 | posix-fs-canonicalise.cc | NixOS_nix/src/libstore/posix-fs-canonicalise.cc | #if HAVE_ACL_SUPPORT
# include <sys/xattr.h>
#endif
#include "posix-fs-canonicalise.hh"
#include "file-system.hh"
#include "signals.hh"
#include "util.hh"
#include "globals.hh"
#include "store-api.hh"
namespace nix {
const time_t mtimeStore = 1; /* 1 second into the epoch */
static void canonicaliseTimestampAndPer... | 5,704 | C++ | .cc | 160 | 29.56875 | 127 | 0.621009 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,802 | profiles.cc | NixOS_nix/src/libstore/profiles.cc | #include "profiles.hh"
#include "signals.hh"
#include "store-api.hh"
#include "local-fs-store.hh"
#include "users.hh"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
namespace nix {
/**
* Parse a generation name of the format
* `<profilename>-<number>-link'.... | 9,608 | C++ | .cc | 279 | 29.035842 | 119 | 0.650486 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,803 | globals.cc | NixOS_nix/src/libstore/globals.cc | #include "globals.hh"
#include "config-global.hh"
#include "current-process.hh"
#include "archive.hh"
#include "args.hh"
#include "abstract-setting-to-json.hh"
#include "compute-levels.hh"
#include "signals.hh"
#include <algorithm>
#include <map>
#include <mutex>
#include <thread>
#include <curl/curl.h>
#include <nlo... | 12,087 | C++ | .cc | 326 | 32.015337 | 166 | 0.670943 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,804 | pathlocks.cc | NixOS_nix/src/libstore/pathlocks.cc | #include "pathlocks.hh"
#include "util.hh"
#include "sync.hh"
#include "signals.hh"
#include <cerrno>
#include <cstdlib>
namespace nix {
PathLocks::PathLocks()
: deletePaths(false)
{
}
PathLocks::PathLocks(const PathSet & paths, const std::string & waitMsg)
: deletePaths(false)
{
lockPaths(paths, wait... | 544 | C++ | .cc | 29 | 15.827586 | 72 | 0.695825 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,805 | store-api.cc | NixOS_nix/src/libstore/store-api.cc | #include "signature/local-keys.hh"
#include "source-accessor.hh"
#include "globals.hh"
#include "derived-path.hh"
#include "realisation.hh"
#include "derivations.hh"
#include "store-api.hh"
#include "util.hh"
#include "nar-info-disk-cache.hh"
#include "thread-pool.hh"
#include "references.hh"
#include "archive.hh"
#inc... | 44,908 | C++ | .cc | 1,149 | 30.662315 | 207 | 0.619983 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,806 | nar-info-disk-cache.cc | NixOS_nix/src/libstore/nar-info-disk-cache.cc | #include "nar-info-disk-cache.hh"
#include "users.hh"
#include "sync.hh"
#include "sqlite.hh"
#include "globals.hh"
#include <sqlite3.h>
#include <nlohmann/json.hpp>
#include "strings.hh"
namespace nix {
static const char * schema = R"sql(
create table if not exists BinaryCaches (
id integer primary key... | 13,664 | C++ | .cc | 326 | 30.849693 | 237 | 0.551576 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,807 | uds-remote-store.cc | NixOS_nix/src/libstore/uds-remote-store.cc | #include "uds-remote-store.hh"
#include "unix-domain-socket.hh"
#include "worker-protocol.hh"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#ifdef _WIN32
# include <winsock2.h>
# include <afunix.h>
#else
# include <sys/socket.h>
# include <sys/un.h>
#endif
namespace nix {
UDSRe... | 2,703 | C++ | .cc | 85 | 28.047059 | 106 | 0.710262 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,808 | gc.cc | NixOS_nix/src/libstore/gc.cc | #include "derivations.hh"
#include "globals.hh"
#include "local-store.hh"
#include "finally.hh"
#include "unix-domain-socket.hh"
#include "signals.hh"
#if !defined(__linux__)
// For shelling out to lsof
# include "processes.hh"
#endif
#include <functional>
#include <queue>
#include <algorithm>
#include <regex>
#incl... | 34,464 | C++ | .cc | 804 | 31.114428 | 147 | 0.542835 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,809 | worker-protocol.cc | NixOS_nix/src/libstore/worker-protocol.cc | #include "serialise.hh"
#include "path-with-outputs.hh"
#include "store-api.hh"
#include "build-result.hh"
#include "worker-protocol.hh"
#include "worker-protocol-impl.hh"
#include "archive.hh"
#include "path-info.hh"
#include <chrono>
#include <nlohmann/json.hpp>
namespace nix {
/* protocol-specific definitions */
... | 9,732 | C++ | .cc | 251 | 32.302789 | 197 | 0.662786 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,810 | ssh.cc | NixOS_nix/src/libstore/ssh.cc | #include "ssh.hh"
#include "finally.hh"
#include "current-process.hh"
#include "environment-variables.hh"
#include "util.hh"
#include "exec.hh"
namespace nix {
static std::string parsePublicHostKey(std::string_view host, std::string_view sshPublicHostKey)
{
try {
return base64Decode(sshPublicHostKey);
... | 7,240 | C++ | .cc | 184 | 33.054348 | 108 | 0.627462 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,811 | make-content-addressed.cc | NixOS_nix/src/libstore/make-content-addressed.cc | #include "make-content-addressed.hh"
#include "references.hh"
namespace nix {
std::map<StorePath, StorePath> makeContentAddressed(
Store & srcStore,
Store & dstStore,
const StorePathSet & storePaths)
{
StorePathSet closure;
srcStore.computeFSClosure(storePaths, closure);
auto paths = srcStore... | 2,678 | C++ | .cc | 71 | 28.929577 | 114 | 0.622583 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,812 | common-ssh-store-config.cc | NixOS_nix/src/libstore/common-ssh-store-config.cc | #include <regex>
#include "common-ssh-store-config.hh"
#include "ssh.hh"
namespace nix {
static std::string extractConnStr(std::string_view scheme, std::string_view _connStr)
{
if (_connStr.empty())
throw UsageError("`%s` store requires a valid SSH host as the authority part in Store URI", scheme);
... | 1,024 | C++ | .cc | 33 | 26.454545 | 113 | 0.671764 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,813 | local-binary-cache-store.cc | NixOS_nix/src/libstore/local-binary-cache-store.cc | #include "local-binary-cache-store.hh"
#include "globals.hh"
#include "nar-info-disk-cache.hh"
#include "signals.hh"
#include <atomic>
namespace nix {
LocalBinaryCacheStoreConfig::LocalBinaryCacheStoreConfig(
std::string_view scheme,
PathView binaryCacheDir,
const Params & params)
: StoreConfig(param... | 3,432 | C++ | .cc | 110 | 24.7 | 112 | 0.63697 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,814 | derived-path.cc | NixOS_nix/src/libstore/derived-path.cc | #include "derived-path.hh"
#include "derivations.hh"
#include "store-api.hh"
#include "comparator.hh"
#include <nlohmann/json.hpp>
#include <optional>
namespace nix {
// Custom implementation to avoid `ref` ptr equality
GENERATE_CMP_EXT(
,
std::strong_ordering,
SingleDerivedPathBuilt,
*me->drvPath,
... | 8,838 | C++ | .cc | 272 | 27.441176 | 102 | 0.675622 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,815 | local-overlay-store.cc | NixOS_nix/src/libstore/local-overlay-store.cc | #include "local-overlay-store.hh"
#include "callback.hh"
#include "realisation.hh"
#include "processes.hh"
#include "url.hh"
#include <regex>
namespace nix {
std::string LocalOverlayStoreConfig::doc()
{
return
#include "local-overlay-store.md"
;
}
Path LocalOverlayStoreConfig::toUpperPath(const S... | 9,120 | C++ | .cc | 237 | 30.818565 | 101 | 0.63797 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,816 | outputs-spec.cc | NixOS_nix/src/libstore/outputs-spec.cc | #include <regex>
#include <nlohmann/json.hpp>
#include "util.hh"
#include "regex-combinators.hh"
#include "outputs-spec.hh"
#include "path-regex.hh"
#include "strings-inline.hh"
namespace nix {
bool OutputsSpec::contains(const std::string & outputName) const
{
return std::visit(overloaded {
[&](const Out... | 5,407 | C++ | .cc | 167 | 25.107784 | 113 | 0.584054 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,817 | serve-protocol-connection.cc | NixOS_nix/src/libstore/serve-protocol-connection.cc | #include "serve-protocol-connection.hh"
#include "serve-protocol-impl.hh"
#include "build-result.hh"
#include "derivations.hh"
namespace nix {
ServeProto::Version ServeProto::BasicClientConnection::handshake(
BufferedSink & to, Source & from, ServeProto::Version localVersion, std::string_view host)
{
to << SE... | 3,338 | C++ | .cc | 86 | 34.511628 | 114 | 0.720916 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,818 | local-store.cc | NixOS_nix/src/libstore/local-store.cc | #include "local-store.hh"
#include "globals.hh"
#include "git.hh"
#include "archive.hh"
#include "pathlocks.hh"
#include "worker-protocol.hh"
#include "derivations.hh"
#include "realisation.hh"
#include "nar-info.hh"
#include "references.hh"
#include "callback.hh"
#include "topo-sort.hh"
#include "finally.hh"
#include ... | 58,209 | C++ | .cc | 1,411 | 31.953933 | 161 | 0.606875 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,819 | dummy-store.cc | NixOS_nix/src/libstore/dummy-store.cc | #include "store-api.hh"
#include "callback.hh"
namespace nix {
struct DummyStoreConfig : virtual StoreConfig {
using StoreConfig::StoreConfig;
DummyStoreConfig(std::string_view scheme, std::string_view authority, const Params & params)
: StoreConfig(params)
{
if (!authority.empty())
... | 2,715 | C++ | .cc | 72 | 31.527778 | 105 | 0.691311 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,820 | s3-binary-cache-store.cc | NixOS_nix/src/libstore/s3-binary-cache-store.cc | #if ENABLE_S3
#include <assert.h>
#include "s3.hh"
#include "s3-binary-cache-store.hh"
#include "nar-info.hh"
#include "nar-info-disk-cache.hh"
#include "globals.hh"
#include "compression.hh"
#include "filetransfer.hh"
#include "signals.hh"
#include <aws/core/Aws.h>
#include <aws/core/VersionConfig.h>
#include <aws/... | 15,841 | C++ | .cc | 393 | 31.638677 | 119 | 0.618415 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,821 | local-fs-store.cc | NixOS_nix/src/libstore/local-fs-store.cc | #include "archive.hh"
#include "posix-source-accessor.hh"
#include "store-api.hh"
#include "local-fs-store.hh"
#include "globals.hh"
#include "compression.hh"
#include "derivations.hh"
namespace nix {
LocalFSStoreConfig::LocalFSStoreConfig(PathView rootDir, const Params & params)
: StoreConfig(params)
// Defa... | 3,446 | C++ | .cc | 96 | 29.75 | 104 | 0.659255 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,822 | keys.cc | NixOS_nix/src/libstore/keys.cc | #include "file-system.hh"
#include "globals.hh"
#include "keys.hh"
namespace nix {
PublicKeys getDefaultPublicKeys()
{
PublicKeys publicKeys;
// FIXME: filter duplicates
for (auto s : settings.trustedPublicKeys.get()) {
PublicKey key(s);
publicKeys.emplace(key.name, key);
}
for ... | 707 | C++ | .cc | 24 | 23.208333 | 72 | 0.64497 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,823 | nar-info.cc | NixOS_nix/src/libstore/nar-info.cc | #include "globals.hh"
#include "nar-info.hh"
#include "store-api.hh"
#include "strings.hh"
#include "json-utils.hh"
namespace nix {
NarInfo::NarInfo(const Store & store, const std::string & s, const std::string & whence)
: ValidPathInfo(StorePath(StorePath::dummy), Hash(Hash::dummy)) // FIXME: hack
{
unsigned... | 5,494 | C++ | .cc | 152 | 28.144737 | 88 | 0.556497 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,824 | build-result.cc | NixOS_nix/src/libstore/build-result.cc | #include "build-result.hh"
namespace nix {
bool BuildResult::operator==(const BuildResult &) const noexcept = default;
std::strong_ordering BuildResult::operator<=>(const BuildResult &) const noexcept = default;
}
| 217 | C++ | .cc | 5 | 41.8 | 92 | 0.779904 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,825 | worker-protocol-connection.cc | NixOS_nix/src/libstore/worker-protocol-connection.cc | #include "worker-protocol-connection.hh"
#include "worker-protocol-impl.hh"
#include "build-result.hh"
#include "derivations.hh"
namespace nix {
const std::set<WorkerProto::Feature> WorkerProto::allFeatures{};
WorkerProto::BasicClientConnection::~BasicClientConnection()
{
try {
to.flush();
} catch (.... | 10,874 | C++ | .cc | 278 | 31.888489 | 180 | 0.642905 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,826 | misc.cc | NixOS_nix/src/libstore/misc.cc | #include <unordered_set>
#include "derivations.hh"
#include "parsed-derivations.hh"
#include "globals.hh"
#include "store-api.hh"
#include "thread-pool.hh"
#include "realisation.hh"
#include "topo-sort.hh"
#include "callback.hh"
#include "closure.hh"
#include "filetransfer.hh"
#include "strings.hh"
namespace nix {
v... | 17,298 | C++ | .cc | 405 | 31.079012 | 136 | 0.572031 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,827 | indirect-root-store.cc | NixOS_nix/src/libstore/indirect-root-store.cc | #include "indirect-root-store.hh"
namespace nix {
void IndirectRootStore::makeSymlink(const Path & link, const Path & target)
{
/* Create directories up to `gcRoot'. */
createDirs(dirOf(link));
/* Create the new symlink. */
Path tempLink = fmt("%1%.tmp-%2%-%3%", link, getpid(), rand());
createSym... | 1,397 | C++ | .cc | 34 | 35.529412 | 101 | 0.675296 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,828 | derived-path-map.cc | NixOS_nix/src/libstore/derived-path-map.cc | #include "derived-path-map.hh"
#include "util.hh"
namespace nix {
template<typename V>
typename DerivedPathMap<V>::ChildNode & DerivedPathMap<V>::ensureSlot(const SingleDerivedPath & k)
{
std::function<ChildNode &(const SingleDerivedPath & )> initIter;
initIter = [&](const auto & k) -> auto & {
return... | 2,251 | C++ | .cc | 60 | 29.533333 | 98 | 0.587615 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,829 | remote-fs-accessor.cc | NixOS_nix/src/libstore/remote-fs-accessor.cc | #include <nlohmann/json.hpp>
#include "remote-fs-accessor.hh"
#include "nar-accessor.hh"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
namespace nix {
RemoteFSAccessor::RemoteFSAccessor(ref<Store> store, bool requireValidPath, const Path & cacheDir)
: store(store)
, requireValidPath(require... | 3,952 | C++ | .cc | 104 | 30.269231 | 100 | 0.621466 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,830 | optimise-store.cc | NixOS_nix/src/libstore/optimise-store.cc | #include "local-store.hh"
#include "globals.hh"
#include "signals.hh"
#include "posix-fs-canonicalise.hh"
#include "posix-source-accessor.hh"
#include <cstdlib>
#include <cstring>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include <regex>
namespace nix {
... | 10,152 | C++ | .cc | 255 | 32.298039 | 112 | 0.616636 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,831 | export-import.cc | NixOS_nix/src/libstore/export-import.cc | #include "serialise.hh"
#include "store-api.hh"
#include "archive.hh"
#include "common-protocol.hh"
#include "common-protocol-impl.hh"
#include <algorithm>
namespace nix {
void Store::exportPaths(const StorePathSet & paths, Sink & sink)
{
auto sorted = topoSortPaths(paths);
std::reverse(sorted.begin(), sorte... | 3,206 | C++ | .cc | 81 | 32.691358 | 133 | 0.641844 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,832 | nar-accessor.cc | NixOS_nix/src/libstore/nar-accessor.cc | #include "nar-accessor.hh"
#include "archive.hh"
#include <map>
#include <stack>
#include <nlohmann/json.hpp>
namespace nix {
struct NarMember
{
SourceAccessor::Stat stat;
std::string target;
/* If this is a directory, all the children of the directory. */
std::map<std::string, NarMember> children... | 8,157 | C++ | .cc | 244 | 24.151639 | 114 | 0.550592 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,833 | filetransfer.cc | NixOS_nix/src/libstore/filetransfer.cc | #include "filetransfer.hh"
#include "globals.hh"
#include "config-global.hh"
#include "store-api.hh"
#include "s3.hh"
#include "compression.hh"
#include "finally.hh"
#include "callback.hh"
#include "signals.hh"
#if ENABLE_S3
#include <aws/core/client/ClientConfiguration.h>
#endif
#if __linux__
# include "namespaces.h... | 36,128 | C++ | .cc | 797 | 32.308657 | 150 | 0.546336 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,834 | parsed-derivations.cc | NixOS_nix/src/libstore/parsed-derivations.cc | #include "parsed-derivations.hh"
#include <nlohmann/json.hpp>
#include <regex>
namespace nix {
ParsedDerivation::ParsedDerivation(const StorePath & drvPath, BasicDerivation & drv)
: drvPath(drvPath), drv(drv)
{
/* Parse the __json attribute, if any. */
auto jsonAttr = drv.env.find("__json");
if (json... | 8,761 | C++ | .cc | 237 | 28.991561 | 122 | 0.586951 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,835 | sqlite.cc | NixOS_nix/src/libstore/sqlite.cc | #include "sqlite.hh"
#include "globals.hh"
#include "util.hh"
#include "url.hh"
#include "signals.hh"
#include <sqlite3.h>
#include <atomic>
#include <thread>
namespace nix {
SQLiteError::SQLiteError(const char *path, const char *errMsg, int errNo, int extendedErrNo, int offset, HintFmt && hf)
: Error(""), path(p... | 7,382 | C++ | .cc | 228 | 27.657895 | 119 | 0.626861 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
10,836 | daemon.cc | NixOS_nix/src/libstore/daemon.cc | #include "daemon.hh"
#include "signals.hh"
#include "worker-protocol.hh"
#include "worker-protocol-connection.hh"
#include "worker-protocol-impl.hh"
#include "build-result.hh"
#include "store-api.hh"
#include "store-cast.hh"
#include "gc-store.hh"
#include "log-store.hh"
#include "indirect-root-store.hh"
#include "path... | 39,679 | C++ | .cc | 982 | 30.280041 | 157 | 0.592182 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,837 | derivations.cc | NixOS_nix/src/libstore/derivations.cc | #include "derivations.hh"
#include "downstream-placeholder.hh"
#include "store-api.hh"
#include "globals.hh"
#include "types.hh"
#include "util.hh"
#include "split.hh"
#include "common-protocol.hh"
#include "common-protocol-impl.hh"
#include "strings-inline.hh"
#include "json-utils.hh"
#include <boost/container/small_... | 46,329 | C++ | .cc | 1,239 | 29.378531 | 155 | 0.596455 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,838 | content-address.cc | NixOS_nix/src/libstore/content-address.cc | #include "args.hh"
#include "content-address.hh"
#include "split.hh"
namespace nix {
std::string_view makeFileIngestionPrefix(FileIngestionMethod m)
{
switch (m) {
case FileIngestionMethod::Flat:
// Not prefixed for back compat
return "";
case FileIngestionMethod::NixArchive:
retur... | 9,144 | C++ | .cc | 281 | 26.83274 | 124 | 0.67727 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,839 | store-reference.cc | NixOS_nix/src/libstore/store-reference.cc | #include <regex>
#include "error.hh"
#include "url.hh"
#include "store-reference.hh"
#include "file-system.hh"
#include "util.hh"
namespace nix {
static bool isNonUriPath(const std::string & spec)
{
return
// is not a URL
spec.find("://") == std::string::npos
// Has at least one path sepa... | 3,175 | C++ | .cc | 102 | 20.892157 | 105 | 0.484145 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,840 | downstream-placeholder.cc | NixOS_nix/src/libstore/downstream-placeholder.cc | #include "downstream-placeholder.hh"
#include "derivations.hh"
namespace nix {
std::string DownstreamPlaceholder::render() const
{
return "/" + hash.to_string(HashFormat::Nix32, false);
}
DownstreamPlaceholder DownstreamPlaceholder::unknownCaOutput(
const StorePath & drvPath,
OutputNameView outputName,
... | 1,963 | C++ | .cc | 51 | 32.960784 | 125 | 0.72126 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
10,841 | names.cc | NixOS_nix/src/libstore/names.cc | #include "names.hh"
#include "util.hh"
#include <regex>
namespace nix {
struct Regex
{
std::regex regex;
};
DrvName::DrvName()
{
name = "";
}
/* Parse a derivation name. The `name' part of a derivation name is
everything up to but not including the first dash *not* followed by
a letter. The `ve... | 2,982 | C++ | .cc | 93 | 27.032258 | 90 | 0.582517 | NixOS/nix | 12,186 | 1,472 | 3,401 | LGPL-2.1 | 9/20/2024, 9:26:25 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.