forked from the-distro/channel-scripts
Update to the latest Nix
This commit is contained in:
parent
3ed896a90e
commit
6d74f1a131
|
@ -59,7 +59,7 @@ public:
|
|||
state->db.exec(cacheSchema);
|
||||
|
||||
if (sqlite3_busy_timeout(state->db, 60 * 60 * 1000) != SQLITE_OK)
|
||||
throwSQLiteError(state->db, "setting timeout");
|
||||
SQLiteError::throw_(state->db, "setting timeout");
|
||||
|
||||
state->queryPath.create(state->db,
|
||||
"select id from StorePaths where path = ?");
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
description = "Script for generating Nixpkgs/NixOS channels";
|
||||
|
||||
inputs.nixpkgs.url = "nixpkgs/nixos-20.03";
|
||||
inputs.nixpkgs.follows = "nix/nixpkgs";
|
||||
|
||||
outputs = { self, nixpkgs, nix }:
|
||||
|
||||
{
|
||||
|
||||
overlay = final: prev: {
|
||||
overlays.default = final: prev: {
|
||||
|
||||
nixos-channel-native-programs = with final; stdenv.mkDerivation {
|
||||
name = "nixos-channel-native-programs";
|
||||
|
@ -75,7 +75,7 @@
|
|||
|
||||
defaultPackage.x86_64-linux = (import nixpkgs {
|
||||
system = "x86_64-linux";
|
||||
overlays = [ nix.overlay self.overlay ];
|
||||
overlays = [ nix.overlays.default self.overlays.default ];
|
||||
}).nixos-channel-scripts;
|
||||
|
||||
};
|
||||
|
|
|
@ -91,15 +91,10 @@ void mainWrapped(int argc, char * * argv)
|
|||
DrvInfos packages;
|
||||
|
||||
for (auto system : std::set<std::string>{"x86_64-linux", "aarch64-linux"}) {
|
||||
auto args = state.allocBindings(2);
|
||||
Value * vConfig = state.allocValue();
|
||||
state.mkAttrs(*vConfig, 0);
|
||||
args->push_back(Attr(state.symbols.create("config"), vConfig));
|
||||
Value * vSystem = state.allocValue();
|
||||
mkString(*vSystem, system);
|
||||
args->push_back(Attr(state.symbols.create("system"), vSystem));
|
||||
args->sort();
|
||||
getDerivations(state, vRoot, "", *args, packages, true);
|
||||
auto args = state.buildBindings(2);
|
||||
args.alloc(state.symbols.create("config")).mkAttrs(&state.emptyBindings);
|
||||
args.alloc(state.symbols.create("system")).mkString(system);
|
||||
getDerivations(state, vRoot, "", *args.finish(), packages, true);
|
||||
}
|
||||
|
||||
/* For each store path, figure out the package with the shortest
|
||||
|
@ -110,15 +105,15 @@ void mainWrapped(int argc, char * * argv)
|
|||
try {
|
||||
auto outputs = package.queryOutputs(true);
|
||||
|
||||
for (auto & output : outputs) {
|
||||
auto storePath = binaryCache->parseStorePath(output.second);
|
||||
if (!allowedPathsClosure.count(storePath)) continue;
|
||||
auto i = packagesByPath.find(storePath);
|
||||
for (auto & [_, storePath] : outputs) {
|
||||
if (!storePath) continue;
|
||||
if (!allowedPathsClosure.count(*storePath)) continue;
|
||||
auto i = packagesByPath.find(*storePath);
|
||||
if (i != packagesByPath.end() &&
|
||||
(i->second->attrPath.size() < package.attrPath.size() ||
|
||||
(i->second->attrPath.size() == package.attrPath.size() && i->second->attrPath < package.attrPath)))
|
||||
continue;
|
||||
packagesByPath.emplace(std::move(storePath), &package);
|
||||
packagesByPath.emplace(std::move(*storePath), &package);
|
||||
}
|
||||
} catch (AssertionError & e) {
|
||||
} catch (Error & e) {
|
||||
|
|
Loading…
Reference in a new issue