Exemple #1
0
    def run(self):
        if not platform.is_arch:
            return

        print_header("Setting up Pacman")
        link_file(SCRIPT_DIR.joinpath("pacman.conf"),
                  Path("/etc/pacman.conf"),
                  sudo=True)

        install_pkg("reflector", "arch-audit", "kernel-modules-hook")

        # Enable kernel module cleanup job
        run_command("sudo systemctl daemon-reload")
        run_command("sudo systemctl enable linux-modules-cleanup")

        # Hooks are symlinked individually to allow local hooks that are
        # not managed by this installer.
        with os.scandir(SCRIPT_DIR.joinpath("hooks")) as hooks:
            hook_dir = "/etc/pacman.d/hooks/"
            for item in hooks:
                link_file(item.path, Path(hook_dir + item.name), sudo=True)

        link_file(
            SCRIPT_DIR.joinpath("reflector.conf"),
            Path("/etc/xdg/reflector/reflector.conf"),
            sudo=True,
        )

        run_command("sudo systemctl enable reflector.timer")
        run_command("sudo systemctl start reflector.timer")
Exemple #2
0
    def run(self):
        if not platform.is_arch:
            return

        print_header("Setting up VNC")

        install_pkg("tigervnc", "lxde-gtk3")

        if file_exists("/etc/pam.d/tigervnc.pacnew"):
            move("/etc/pam.d/tigervnc.pacnew", "/etc/pam.d/tigervnc")

        link_files([
            [
                SCRIPT_DIR.joinpath("vncserver.users"),
                Path("/etc/tigervnc/vncserver.users"),
                True,
            ],
            [
                SCRIPT_DIR.joinpath("config"),
                Path.home().joinpath(".vnc", "config"),
                True,
            ],
        ])

        run_command("sudo systemctl enable vncserver@:1")
        run_command("sudo systemctl start vncserver@:1")
Exemple #3
0
    def run(self):
        print_header("Setting up Minicom")
        for file in ["dfl", "fast"]:
            link_file(
                Path(__file__).parent.joinpath(f".minirc.{file}"),
                Path.home().joinpath(f".minirc.{file}"),
            )
        install_pkg("minicom")

        if platform.is_linux:
            run_command("sudo usermod -a -G dialout $(whoami)", shell=True)
Exemple #4
0
    def install_code(self):
        if command_exists(EXE_NAME):
            print_line(
                "VSCode already installed, update through the package manager",
                color=Color.MAGENTA,
            )
            return

        if platform.is_arch:
            if EXE_NAME == "code":
                install_pkg("visual-studio-code-bin")
            else:
                install_pkg("vscodium-bin")
        elif platform.is_mac or platform.is_linux:
            print_line("Please install VSCodium first")
            raise InstallException()
        else:
            print_line("Unsupported distribution")
            raise InstallException()
Exemple #5
0
    def setup_cred_store(self):
        # Get current config
        docker_config = Path.home().joinpath(".docker", "config.json")
        with open(docker_config) as f:
            config = json.load(f)

        # Check if credential store is already configured
        if "credsStore" not in config:
            install_pkg("docker-credential-secretservice", "gnome-keyring")

            config["auths"] = {
            }  # Reset auths to remove any existing passwords
            config["credsStore"] = "secretservice"

            # Write out new config, make it pretty
            with open(docker_config, "w") as f:
                json.dump(config, f, indent=2)

            run_command("sudo systemctl restart docker")
Exemple #6
0
    def check_nvim_installed(self):
        if command_exists("nvim"):
            return

        if platform.is_fedora:
            install_pkg("python2-neovim", "python3-neovim")
        elif platform.is_ubuntu:
            install_apt_ppa("neovim-ppa/stable", update_lists=True)
            install_pkg("neovim", "python-dev", "python-pip", "python3-dev",
                        "python3-pip")
            run_command(
                "sudo update-alternatives --install /usr/bin/vi vi /usr/bin/nvim 60"
            )
            run_command("sudo update-alternatives --config vi")
            run_command(
                "sudo update-alternatives --install /usr/bin/vim vim /usr/bin/nvim 60"
            )
            run_command("sudo update-alternatives --config vim")
            run_command(
                "sudo update-alternatives --install /usr/bin/editor editor /usr/bin/nvim 60"
            )
            run_command("sudo update-alternatives --config editor")
Exemple #7
0
    def install_linux_pkgs(self):
        if platform.is_fedora:
            install_pkg(*self.settings["packages"]["linux"],
                        *self.settings["packages"]["fedora"])
        elif platform.is_ubuntu:
            install_pkg(*self.settings["packages"]["linux"],
                        *self.settings["packages"]["ubuntu"])
        elif platform.is_arch:
            packmgr.install_aur_helper()
            install_pkg(*self.settings["packages"]["linux"],
                        *self.settings["packages"]["arch"])

        run_command("sudo systemctl start haveged")
        run_command("sudo systemctl enable haveged")
Exemple #8
0
 def install_pkgs(self):
     if platform.is_mac:
         install_pkg("gpg2", "pidof", "pinentry-mac")
     elif platform.is_ubuntu:
         install_pkg(
             "gnupg-agent",
             "gnupg2",
             "pinentry-gtk2",
             "scdaemon",
             "libccid",
             "pcscd",
             "libpcsclite1",
             "gpgsm",
         )
     elif platform.is_fedora:
         install_pkg("ykpers", "libyubikey", "gnupg", "gnupg2-smime")
     elif platform.is_arch:
         install_pkg("gnupg", "pinentry", "ccid", "pcsclite")
         run_command("sudo systemctl enable pcscd.service")
         run_command("sudo systemctl start pcscd.service")
     else:
         print_line("Unsupported distribution")
Exemple #9
0
 def install_mac_pkgs(self):
     packmgr.install_homebrew()
     install_pkg(*self.settings["packages"]["macos"])
Exemple #10
0
    def install_docker(self):
        if not command_exists("docker"):
            install_pkg("docker-bin")

        if platform.is_arch and not command_exists("docker-compose"):
            install_pkg("docker-compose")