1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2024-12-14 11:47:31 +00:00
flake-parts/dev/tests/template.nix
2024-01-30 00:00:55 +01:00

36 lines
774 B
Nix

{ hci-effects, nix, git, path }:
hci-effects.mkEffect {
inputs = [ nix git ];
effectScript = ''
ann() { # announce
printf '\n\e[34;1m%s\e[0m\n' "$*"
}
mkdir -p ~/.config/nix
echo 'experimental-features = nix-command flakes' >>~/.config/nix/nix.conf
mkdir clean
cd clean
ann nix flake init...
nix -v flake init -t ${../..}
ann pointing to local sources...
override=(--override-input flake-parts ${../..})
ann nix flake lock...
nix flake lock "''${override[@]}"
ann nix flake show...
nix -v flake show "''${override[@]}"
ann nix build...
nix build . "''${override[@]}"
ann checking result...
readlink ./result | grep hello
echo
printf '\n\e[32;1m%s\e[0m\n' 'All good!'
'';
}