lib: init, add timeTravel

This commit is contained in:
Max Headroom 2023-08-23 20:42:51 +02:00
parent 600756b494
commit a5c945b247
3 changed files with 24 additions and 0 deletions

View file

@ -18,6 +18,7 @@
./modules/part.nix ./modules/part.nix
./packages/part.nix ./packages/part.nix
./jobs/part.nix ./jobs/part.nix
./lib/part.nix
]; ];
}; };

5
lib/part.nix Normal file
View file

@ -0,0 +1,5 @@
{
imports = [
./time-travel.nix
];
}

18
lib/time-travel.nix Normal file
View file

@ -0,0 +1,18 @@
{ config, lib, ... }:
let
timeTravel = rev: builtins.getFlake "github:privatevoid-net/depot/${rev}";
in
{
_module.args = { inherit timeTravel; };
perSystem = { system, ... }: {
_module.args.timeTravel' = rev: let
flake = timeTravel rev;
flake' = config.perInput system flake;
in flake' // {
inputs = lib.mapAttrs (_: input: config.perInput system input) flake.inputs;
};
};
}