Skip to content

Instantly share code, notes, and snippets.

@grahamc
Last active January 14, 2020 14:43
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 grahamc/d061eb440421fe471fbf670c27bdd41f to your computer and use it in GitHub Desktop.
Save grahamc/d061eb440421fe471fbf670c27bdd41f to your computer and use it in GitHub Desktop.
flatten_system_config() {
(
echo "{ imports = [";
while IFS= read -r -d '' file; do
echo -n "("
cat "$file"
echo ")"
done < <(find ./modules/ -type f -print0)
echo "]; }"
) > system.nix
rm -rf modules
mv system.nix "$1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment