예제 #1
0
def env_base():
    """
    Install base system
    """
    pkgs = [
        'mc',
        'tmux',
        'dnsutils',
        'alsa-utils',
        'pulseaudio',
        'mc-solarized-git',
        'dircolors-solarized-git',
    ]
    # Check if a custom package for computer
    env_section = inspect.stack()[0][3]
    if 'pkgs' in env and env_section in env.pkgs:
        pkgs = list(set(pkgs + env.pkgs[env_section]))

    # Install required packages
    env_base_requirement()
    require.arch.packages(pkgs, options=["--noconfirm"])

    # Synchronize user dotfiles
    sync_dotfiles = 'fabrecipes/autoinstall/%(env_section)s' % locals()
    dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/')
    dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true')

    # Configure base
    configure_base()
예제 #2
0
def install():
    """
    Install zfs system (kernel + utils) from archzfs (demizerone repository)
    """

    # Add archzfs repository
    config_file = '/etc/pacman.conf'
    append(config_file, '[demz-repo-core]', use_sudo=True)
    append(config_file,
           'Server = http://demizerone.com/$repo/$arch',
           use_sudo=True)

    # Add key
    sudo('pacman-key -r 0EE7A126')
    sudo('pacman-key --lsign-key 0EE7A126')

    # Update the package database
    arch.update_index()

    # Install package
    require.arch.package('archzfs')

    # Synchronize user
    dotfiles.sync('fabrecipes/zfs/user/', '$HOME/')
    dotfiles.sync('fabrecipes/zfs/sys/', '/', use_sudo='true')
예제 #3
0
def env_base():
    """
    Install base system
    """
    pkgs = [
        'mc',
        'tmux',
        'dnsutils',
        'alsa-utils',
        'pulseaudio',
        'mc-solarized-git',
        'dircolors-solarized-git',
    ]
    # Check if a custom package for computer
    env_section = inspect.stack()[0][3]
    if 'pkgs' in env and env_section in env.pkgs:
        pkgs = list(set(pkgs + env.pkgs[env_section]))

    # Install required packages
    env_base_requirement()
    require.arch.packages(pkgs, options=["--noconfirm"])

    # Synchronize user dotfiles
    sync_dotfiles = 'fabrecipes/autoinstall/%(env_section)s' % locals()
    dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/')
    dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true')

    # Configure base
    configure_base()
예제 #4
0
def sync_dotfiles(env_section, sync_dotfiles='fabrecipes'):
    """
    Synchronize the computer configuration from a dotfiles project
    """

    # Fetch the dotfiles
    dotfiles.fetch()

    # Sync the default dotfiles for specific environment
    findex = -1
    if env_section in EXECTREE:
        findex = EXECTREE.index(env_section)
    for cindex in range(0, findex + 1):
        csection = EXECTREE[cindex]

        print "Synchronize from '%(csection)s'" % locals()
        sync_dotfiles = 'fabrecipes/autoinstall/%(csection)s' % locals()
        dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/', force_sync=False)
        dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true', force_sync=False)

    # Sync computer dotfiles
    computer_hostname = env.hostname

    print "Synchronize from '%(computer_hostname)s' computer" % locals()
    sync_dotfiles = 'fabrecipes/autoinstall/computers/%(computer_hostname)s' % locals()
    print "#### %(sync_dotfiles)s" % locals()
    dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/', force_sync=False)
    dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true', force_sync=False)
예제 #5
0
def sync_dotfiles(env_section, sync_dotfiles='fabrecipes'):
    """
    Synchronize the computer configuration from a dotfiles project
    """

    # Fetch the dotfiles
    dotfiles.fetch()

    # Sync the default dotfiles for specific environment
    findex = -1
    if env_section in EXECTREE:
        findex = EXECTREE.index(env_section)
    for cindex in range(0, findex + 1):
        csection = EXECTREE[cindex]

        print "Synchronize from '%(csection)s'" % locals()
        sync_dotfiles = 'fabrecipes/autoinstall/%(csection)s' % locals()
        dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/', force_sync=False)
        dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true', force_sync=False)

    # Sync computer dotfiles
    computer_hostname = env.hostname

    print "Synchronize from '%(computer_hostname)s' computer" % locals()
    sync_dotfiles = 'fabrecipes/autoinstall/computers/%(computer_hostname)s' % locals()
    print "#### %(sync_dotfiles)s" % locals()
    dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/', force_sync=False)
    dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true', force_sync=False)
예제 #6
0
def install_p2k():
    """
    Install emacs with some features in python 2.7 environement
    """
    if 'pkgs' not in env:
        env.pkgs = []

    pkgs = [
        'python2',
        'git',
        'mercurial',
        'emacs',
        # For flymake
        'xmlstarlet',
        #'csslint-git',
    ]
    require.arch.packages(pkgs)

    python_cmd = 'python2.7'
    virtualenv = '.virtualenvs/emacs_p2k'
    require.python.pip(python_cmd=python_cmd)
    require.python.package(
        'virtualenv',
        python_cmd=python_cmd,
        use_sudo=True,
    )
    require.python.package(
        'virtualenvwrapper',
        python_cmd=python_cmd,
        use_sudo=True,
    )
    require.python.virtualenv(
        virtualenv,
        python_cmd=python_cmd,
        venv_python='python2.7',
    )

    with python.virtualenv(virtualenv):
        here = os.path.dirname(__file__)
        requirements = '%(here)s/requirements.txt' % locals()
        put(requirements, '/tmp/requirements.txt')
        require.python.requirements(
            '/tmp/requirements.txt',
        )

    # Synchronize user
    dotfiles.sync('fabrecipes/emacs/emacs_p2k/user/', '$HOME/')
    dotfiles.sync('fabrecipes/emacs/emacs_p2k/sys/', '/', use_sudo='true')
예제 #7
0
def env_base_requirement(direct=True, sync_dotfiles='fabrecipes'):
    """
    Install requirement base system
    """
    pkgs = [
        'zsh',
        'wget',
        'netctl',
        'dialog',
        'yaourt',
        'python2',
        'ifplugd',
        'net-tools',
        'wpa_actiond',
        'wpa_supplicant',
    ]

    # Check if a custom package for computer
    env_section = inspect.stack()[0][3]
    if 'pkgs' in env and env_section in env.pkgs:
        pkgs = list(set(pkgs + env.pkgs[env_section]))

    # Install required packages
    run_as_root('dirmngr </dev/null')
    run_as_root('pacman-key --init')
    run_as_root('pacman-key --populate archlinux')
    run_as_root('pacman-key --refresh-keys')
    run_as_root('pacman --noconfirm -Syyu')
    run_as_root('pacman-db-upgrade')
    require.arch.packages(pkgs, options=["--noconfirm"])

    # Install oh-my-zsh
    ohmyzsh = '$HOME/.oh-my-zsh'
    if not is_dir(ohmyzsh):
        run(
            'git clone git://github.com/robbyrussell/oh-my-zsh.git %(ohmyzsh)s'
            % locals()
        )

    # Set default ZSH shell for user
    if user.exists(env.useraccount):
        user.modify(env.useraccount, shell='/usr/bin/zsh')

    # Synchronize user dotfiles
    sync_dotfiles = 'fabrecipes/autoinstall/%(env_section)s' % locals()
    dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/')
    dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true')
예제 #8
0
def env_base_requirement(direct=True, sync_dotfiles='fabrecipes'):
    """
    Install requirement base system
    """
    pkgs = [
        'zsh',
        'wget',
        'netctl',
        'dialog',
        'yaourt',
        'python2',
        'ifplugd',
        'net-tools',
        'wpa_actiond',
        'wpa_supplicant',
    ]

    # Check if a custom package for computer
    env_section = inspect.stack()[0][3]
    if 'pkgs' in env and env_section in env.pkgs:
        pkgs = list(set(pkgs + env.pkgs[env_section]))

    # Install required packages
    run_as_root('dirmngr </dev/null')
    run_as_root('pacman-key --init')
    run_as_root('pacman-key --populate archlinux')
    run_as_root('pacman-key --refresh-keys')
    run_as_root('pacman --noconfirm -Syyu')
    run_as_root('pacman-db-upgrade')
    require.arch.packages(pkgs, options=["--noconfirm"])

    # Install oh-my-zsh
    ohmyzsh = '$HOME/.oh-my-zsh'
    if not is_dir(ohmyzsh):
        run(
            'git clone git://github.com/robbyrussell/oh-my-zsh.git %(ohmyzsh)s'
            % locals()
        )

    # Set default ZSH shell for user
    if user.exists(env.useraccount):
        user.modify(env.useraccount, shell='/usr/bin/zsh')

    # Synchronize user dotfiles
    sync_dotfiles = 'fabrecipes/autoinstall/%(env_section)s' % locals()
    dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/')
    dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true')
예제 #9
0
def install_p2k():
    """
    Install emacs with some features in python 2.7 environement
    """
    if 'pkgs' not in env:
        env.pkgs = []

    pkgs = [
        'python2',
        'git',
        'mercurial',
        'emacs',
        # For flymake
        'xmlstarlet',
        #'csslint-git',
    ]
    require.arch.packages(pkgs)

    python_cmd = 'python2.7'
    virtualenv = '.virtualenvs/emacs_p2k'
    require.python.pip(python_cmd=python_cmd)
    require.python.package(
        'virtualenv',
        python_cmd=python_cmd,
        use_sudo=True,
    )
    require.python.package(
        'virtualenvwrapper',
        python_cmd=python_cmd,
        use_sudo=True,
    )
    require.python.virtualenv(
        virtualenv,
        python_cmd=python_cmd,
        venv_python='python2.7',
    )

    with python.virtualenv(virtualenv):
        here = os.path.dirname(__file__)
        requirements = '%(here)s/requirements.txt' % locals()
        put(requirements, '/tmp/requirements.txt')
        require.python.requirements('/tmp/requirements.txt', )

    # Synchronize user
    dotfiles.sync('fabrecipes/emacs/emacs_p2k/user/', '$HOME/')
    dotfiles.sync('fabrecipes/emacs/emacs_p2k/sys/', '/', use_sudo='true')
예제 #10
0
def env_xorg():
    """
    Install base Xorg system
    """
    pkgs = [
        'gksu',
        'xterm',
        'arandr',
        'xdotool',
        'xorg-xev',
        'xorg-xrdb',
        'xorg-xkill',
        'xorg-xinit',
        'xorg-xprop',
        'xorg-server',
        'xorg-server-utils',
        'xf86-input-synaptics',
        'alsa-utils',
        'wicd-gtk',
        'xournal',
        'evince',
    ]
    # Check if a custom package for computer
    env_section = inspect.stack()[0][3]
    if 'pkgs' in env and env_section in env.pkgs:
        pkgs = list(set(pkgs + env.pkgs[env_section]))


    # Install required packages
    env_base()
    require.arch.packages(pkgs, options=["--noconfirm"])

    # Synchronize user dotfiles
    sync_dotfiles = 'fabrecipes/autoinstall/%(env_section)s' % locals()
    dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/')
    dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true')

    # Configure_xorg
    configure_xorg()
예제 #11
0
def env_xorg():
    """
    Install base Xorg system
    """
    pkgs = [
        'gksu',
        'xterm',
        'arandr',
        'xdotool',
        'xorg-xev',
        'xorg-xrdb',
        'xorg-xkill',
        'xorg-xinit',
        'xorg-xprop',
        'xorg-server',
        'xorg-server-utils',
        'xf86-input-synaptics',
        'alsa-utils',
        'wicd-gtk',
        'xournal',
        'evince',
    ]
    # Check if a custom package for computer
    env_section = inspect.stack()[0][3]
    if 'pkgs' in env and env_section in env.pkgs:
        pkgs = list(set(pkgs + env.pkgs[env_section]))


    # Install required packages
    env_base()
    require.arch.packages(pkgs, options=["--noconfirm"])

    # Synchronize user dotfiles
    sync_dotfiles = 'fabrecipes/autoinstall/%(env_section)s' % locals()
    dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/')
    dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true')

    # Configure_xorg
    configure_xorg()
예제 #12
0
def install():
    """
    Install zfs system (kernel + utils) from archzfs (demizerone repository)
    """

    # Add archzfs repository
    config_file = '/etc/pacman.conf'
    append(config_file, '[demz-repo-core]', use_sudo=True)
    append(config_file, 'Server = http://demizerone.com/$repo/$arch', use_sudo=True)

    # Add key
    sudo('pacman-key -r 0EE7A126')
    sudo('pacman-key --lsign-key 0EE7A126')

    # Update the package database
    arch.update_index()

    # Install package
    require.arch.package('archzfs')

    # Synchronize user
    dotfiles.sync('fabrecipes/zfs/user/', '$HOME/')
    dotfiles.sync('fabrecipes/zfs/sys/', '/', use_sudo='true')
예제 #13
0
def install():
    """
    Install virtualbox and use dkms virtual host modules
    """

    pkgs = [
        'virtualbox',
        'virtualbox-host-dkms',
        'linux-headers',
    ]

    # Install packages
    require.arch.packages(pkgs)

    # active startup virtualbox module compilation
    systemd.start('dkms')
    systemd.enable('dkms')

    # Synchronize user
    dotfiles.sync('fabrecipes/virtualbox/user/', '$HOME/')
    dotfiles.sync('fabrecipes/virtualbox/sys/', '/', use_sudo='true')

    print(red('Please reboot your system for use new kernel'))
예제 #14
0
def install():
    """
    Install virtualbox and use dkms virtual host modules
    """

    pkgs = [
        'virtualbox',
        'virtualbox-host-dkms',
        'linux-headers',
    ]

    # Install packages
    require.arch.packages(pkgs)

    # active startup virtualbox module compilation
    systemd.start('dkms')
    systemd.enable('dkms')

    # Synchronize user
    dotfiles.sync('fabrecipes/virtualbox/user/', '$HOME/')
    dotfiles.sync('fabrecipes/virtualbox/sys/', '/', use_sudo='true')

    print(red('Please reboot your system for use new kernel'))
예제 #15
0
def env_xorg_misc(direct=True):
    """
    Full Xorg installation
    (Xorg + i3 + lighweight + misc software)
    """
    pkgs = [
        'sox',
        'vlc',
        'slop',
        'maim',
        'docker',
        'openvpn',
        'firefox',
        'remmina',
        'freerdp',
        'keepassx',
        'flashplugin',
        'pavucontrol',
        # Google Chrome
        'google-chrome',
        'ttf-liberation'

    ]

    # Check if a custom package for computer
    env_section = inspect.stack()[0][3]
    if 'pkgs' in env and env_section in env.pkgs:
        pkgs = list(set(pkgs + env.pkgs[env_section]))

    env_xorg()
    require.arch.packages(pkgs, options=["--noconfirm"])

    # Synchronize user dotfiles
    sync_dotfiles = 'fabrecipes/autoinstall/%(env_section)s' % locals()
    dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/')
    dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true')
예제 #16
0
def env_xorg_misc(direct=True):
    """
    Full Xorg installation
    (Xorg + i3 + lighweight + misc software)
    """
    pkgs = [
        'sox',
        'vlc',
        'slop',
        'maim',
        'docker',
        'openvpn',
        'firefox',
        'remmina',
        'freerdp',
        'keepassx',
        'flashplugin',
        'pavucontrol',
        # Google Chrome
        'google-chrome',
        'ttf-liberation'

    ]

    # Check if a custom package for computer
    env_section = inspect.stack()[0][3]
    if 'pkgs' in env and env_section in env.pkgs:
        pkgs = list(set(pkgs + env.pkgs[env_section]))

    env_xorg()
    require.arch.packages(pkgs, options=["--noconfirm"])

    # Synchronize user dotfiles
    sync_dotfiles = 'fabrecipes/autoinstall/%(env_section)s' % locals()
    dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/')
    dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true')
예제 #17
0
def env_xorg_xfce_i3():
    """
    Install Xorg Xfce + I3 feature
    """

    # if not arch.is_installed('xfce4-power-manager') and \
    #    not arch.is_installed('xfce4-wavelan-plugin'):
    pkgs = [

        # I3
        'i3-wm',
        'dmenu',
        'i3lock',
        'i3status',
        'xautolock',

        # XFCE4
        'xfwm4',
        'xfconf',
        'xfce4-mixer',
        'xfce4-panel',
        'xfwm4-themes',
        'xfce4-session',
        'xfce4-settings',
        'xfce4-terminal',
        'xfce4-appfinder',
        'xfce4-screenshooter',
        'xfce4-power-manager',
        'xfce-theme-albatross',
        'xfce4-whiskermenu-plugin',

        # Thunar
        'unzip',
        'thunar',
        'xarchiver',
        'thunar-volman',
        'thunar-archive-plugin',

        # Misc
        'feh',
        'exo',
        'gvfs',
        'tumbler',
        'gvfs-smb',
        'ristretto',
        'xfdesktop',
        'rxvt-unicode',
        'gtk2-xfce-engine',
        'shimmer-wallpapers',
        ##'xfce4-goodies',
        ##'xfce-theme-manager',
        ##'gtk-engine-unico',
        #'elementary-xfce-icons',
    ]
    # Check if a custom package for computer
    env_section = inspect.stack()[0][3]
    if 'pkgs' in env and env_section in env.pkgs:
        pkgs = list(set(pkgs + env.pkgs[env_section]))

    # Install required packages
    env_xorg()
    require.arch.packages(pkgs, options=["--noconfirm"])

    # Synchronize user dotfiles
    sync_dotfiles = 'fabrecipes/autoinstall/%(env_section)s' % locals()
    dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/')
    dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true')

    configure_xfce_i3()
예제 #18
0
def env_xorg_xfce_i3():
    """
    Install Xorg Xfce + I3 feature
    """

    # if not arch.is_installed('xfce4-power-manager') and \
    #    not arch.is_installed('xfce4-wavelan-plugin'):
    pkgs = [

        # I3
        'i3-wm',
        'dmenu',
        'i3lock',
        'i3status',
        'xautolock',

        # XFCE4
        'xfwm4',
        'xfconf',
        'xfce4-mixer',
        'xfce4-panel',
        'xfwm4-themes',
        'xfce4-session',
        'xfce4-settings',
        'xfce4-terminal',
        'xfce4-appfinder',
        'xfce4-power-manager',
        'xfce-theme-albatross',
        'xfce4-whiskermenu-plugin',

        # Thunar
        'unzip',
        'thunar',
        'xarchiver',
        'thunar-volman',
        'thunar-archive-plugin',

        # Misc
        'feh',
        'exo',
        'gvfs',
        'tumbler',
        'gvfs-smb',
        'ristretto',
        'xfdesktop',
        'rxvt-unicode',
        'gtk2-xfce-engine',
        'shimmer-wallpapers',
        ##'xfce4-goodies',
        ##'xfce-theme-manager',
        ##'gtk-engine-unico',
        #'elementary-xfce-icons',
    ]
    # Check if a custom package for computer
    env_section = inspect.stack()[0][3]
    if 'pkgs' in env and env_section in env.pkgs:
        pkgs = list(set(pkgs + env.pkgs[env_section]))

    # Install required packages
    env_xorg()
    require.arch.packages(pkgs, options=["--noconfirm"])

    # Synchronize user dotfiles
    sync_dotfiles = 'fabrecipes/autoinstall/%(env_section)s' % locals()
    dotfiles.sync('%(sync_dotfiles)s/user/' % locals(), '$HOME/')
    dotfiles.sync('%(sync_dotfiles)s/sys/' % locals(), '/', use_sudo='true')

    configure_xfce_i3()