feat: improve scripts and write tests
This commit is contained in:
32 files changed
+3817
-723
No files matched your search
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
# Fake nixos-generate-config. Env: FAKE_NGC_MODE = ok (default) | fail | empty | partial-then-fail | garbage
|
||||
echo "$*" > "${FAKE_NGC_ARGS:-/dev/null}"
|
||||
case "${FAKE_NGC_MODE:-ok}" in
|
||||
ok)
|
||||
cat <<'EOF'
|
||||
# Do not modify this file! It was generated by nixos-generate-config
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
{
|
||||
fileSystems."/" = { device = "/dev/disk/by-uuid/1234"; fsType = "ext4"; };
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
EOF
|
||||
;;
|
||||
fail) echo "boom" >&2; exit 1 ;;
|
||||
empty) exit 0 ;;
|
||||
partial-then-fail) echo "{ half = of a file"; exit 1 ;;
|
||||
garbage) echo "error: something went wrong but exit 0" ;;
|
||||
esac
|
||||
Reference in new issue
Block a user