1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-12 14:55:09 +02:00

Merge remote-tracking branch 'obsidian/single-ca-drv-build' into ca-floating-upstream

Tests also now fail as they should
This commit is contained in:
John Ericson 2020-09-03 22:44:56 +00:00
commit b836662f50
2 changed files with 32 additions and 18 deletions

View file

@ -5,12 +5,11 @@ with import ./config.nix;
# The derivation can be arbitrarily modified by passing a different `seed`,
# but the output will always be the same
rec {
root = mkDerivation {
name = "simple-content-addressed";
rootLegacy = mkDerivation {
name = "simple-input-addressed";
buildCommand = ''
set -x
echo "Building a CA derivation"
echo "The seed is ${toString seed}"
echo "Building a legacy derivation"
mkdir -p $out
echo "Hello World" > $out/hello
'';
@ -18,23 +17,35 @@ rec {
outputHashMode = "recursive";
outputHashAlgo = "sha256";
};
dependent = mkDerivation {
rootCA = mkDerivation {
name = "dependent";
buildCommand = ''
echo "building a dependent derivation"
echo "building a CA derivation"
echo "The seed is ${toString seed}"
mkdir -p $out
echo ${root}/hello > $out/dep
echo ${rootLegacy}/hello > $out/dep
'';
__contentAddressed = true;
outputHashMode = "recursive";
outputHashAlgo = "sha256";
};
transitivelyDependent = mkDerivation {
dependentCA = mkDerivation {
name = "dependent";
buildCommand = ''
echo "building a dependent derivation"
mkdir -p $out
echo ${rootCA}/hello > $out/dep
'';
__contentAddressed = true;
outputHashMode = "recursive";
outputHashAlgo = "sha256";
};
transitivelyDependentCA = mkDerivation {
name = "transitively-dependent";
buildCommand = ''
echo "building transitively-dependent"
cat ${dependent}/dep
echo ${dependent} > $out
cat ${dependentCA}/dep
echo ${dependentCA} > $out
'';
__contentAddressed = true;
outputHashMode = "recursive";