#!/usr/bin/env python
# -*- coding: utf-8 -*-

from os import getenv
sudo_user = getenv("SUDO_USER", "")

if sudo_user:
    user = sudo_user
else:
    from getpass import getuser
    user = getuser()


def install(tools_module):
    tools_module.chmod("/var/cache/prezto/fasd/cache.zsh", "666")

    tools_module.enable_service("avahi-daemon")
    tools_module.enable_service("dhcpcd")
    tools_module.enable_service("iptables")
    tools_module.enable_service("ntpd")
    tools_module.enable_service("org.cups.cupsd.service")
    tools_module.clone(
        "https://github.com/jpigree/prezto-contrib",
        "/home/{}/workspace/perso/prezto-contrib".format(sudo_user)
    )

    tools_module.chsh(user, "/usr/bin/zsh")
