diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-11-29 14:01:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-29 14:01:42 +0100 |
commit | fbc53e97edfff092e6a4c1b7f0546137fdb6238c (patch) | |
tree | cd45faa2f2b75065689fcc0d72e7e705dfea1257 /src/libstore/parsed-derivations.cc | |
parent | f904f6a66f2fea3d6a9498dd47284aa8c16fb26d (diff) | |
parent | 4f762e2b023fd451fdbab0de8d6394dd7201640d (diff) |
Merge pull request #3600 from NixOS/auto-uid-allocation
Automatic UID allocation
Diffstat (limited to 'src/libstore/parsed-derivations.cc')
-rw-r--r-- | src/libstore/parsed-derivations.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstore/parsed-derivations.cc b/src/libstore/parsed-derivations.cc index 59a30db10..cc4a94fab 100644 --- a/src/libstore/parsed-derivations.cc +++ b/src/libstore/parsed-derivations.cc @@ -89,6 +89,7 @@ std::optional<Strings> ParsedDerivation::getStringsAttr(const std::string & name StringSet ParsedDerivation::getRequiredSystemFeatures() const { + // FIXME: cache this? StringSet res; for (auto & i : getStringsAttr("requiredSystemFeatures").value_or(Strings())) res.insert(i); @@ -124,6 +125,11 @@ bool ParsedDerivation::substitutesAllowed() const return getBoolAttr("allowSubstitutes", true); } +bool ParsedDerivation::useUidRange() const +{ + return getRequiredSystemFeatures().count("uid-range"); +} + static std::regex shVarName("[A-Za-z_][A-Za-z0-9_]*"); std::optional<nlohmann::json> ParsedDerivation::prepareStructuredAttrs(Store & store, const StorePathSet & inputPaths) |