1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-12 23:15:08 +02:00

Split off 'nix flake init' tests

This commit is contained in:
Eelco Dolstra 2022-07-13 20:36:11 +02:00
parent f011c269c9
commit a094259d35
4 changed files with 119 additions and 86 deletions

View file

@ -30,6 +30,13 @@ EOF
cp ../simple.nix ../simple.builder.sh ../config.nix $flakeDir/
}
createSimpleGitFlake() {
local flakeDir="$1"
writeSimpleFlake $flakeDir
git -C $flakeDir add flake.nix simple.nix simple.builder.sh config.nix
git -C $flakeDir commit -m 'Initial'
}
writeDependentFlake() {
local flakeDir="$1"
cat > $flakeDir/flake.nix <<EOF
@ -42,6 +49,17 @@ writeDependentFlake() {
EOF
}
writeTrivialFlake() {
local flakeDir="$1"
cat > $flakeDir/flake.nix <<EOF
{
outputs = { self }: {
expr = 123;
};
}
EOF
}
createGitRepo() {
local repo="$1"
local extraArgs="$2"