Skip to content

Instantly share code, notes, and snippets.

@coreyoconnor
Created March 21, 2018 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coreyoconnor/e0673ac1e723a0d6211374b2ff02a5d9 to your computer and use it in GitHub Desktop.
Save coreyoconnor/e0673ac1e723a0d6211374b2ff02a5d9 to your computer and use it in GitHub Desktop.
with (import <nixpkgs> {});
with lib;
let
forceRebuild = "1";
dummy = index: stdenv.mkDerivation {
name = "dummy-${forceRebuild}-${toString index}";
builder = writeScript "sleeping-builder" ''
#!/bin/sh
echo "dummy ${toString index} is building" > $out
${coreutils}/bin/sleep 10
'';
};
indices = genList id 1000;
dummyDerivations = map (index: "dummy-${toString index} : ${dummy index}") indices;
in writeTextFile {
name = "toplevel";
text = ''
${builtins.concatStringsSep "\n" dummyDerivations}
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment