This commit is contained in:
Graham Christensen 2024-06-12 17:55:39 -04:00
parent 76db34a53f
commit 1e5e79a3c8

View file

@ -43,6 +43,34 @@
magic-nix-cache = pkgs.callPackage ./package.nix { };
#inherit (cranePkgs) magic-nix-cache;
default = magic-nix-cache;
veryLongChain =
let
# Function to write the current date to a file
startFile =
pkgs.stdenv.mkDerivation {
name = "start-file";
buildCommand = ''
echo ${magic-nix-cache} > $out
'';
};
# Recursive function to create a chain of derivations
createChain = n: startFile:
pkgs.stdenv.mkDerivation {
name = "chain-${toString n}";
src =
if n == 0 then
startFile
else createChain (n - 1) startFile;
buildCommand = ''
echo $src > $out
'';
};
in
# Starting point of the chain
createChain 1000 startFile;
});
devShells = forEachSupportedSystem ({ pkgs, cranePkgs, lib }: {