Updated/merged stuff from TUD's hydra-module.nix to make this work again