dotfiles

Description

Symbolically link dotfile folders into place and install associated applications.

This frecklet is mainly meant to be used with freckelize to provide a 'one-command' way of initializing a new workstation setup, including application install and configuration.

It can be used without freckelize, but this usage is neither documented nor supported.

Note: this is currently unmaintained, it will be re-written at some stage

Variables

Name Type Default Description

extra_vars

n/a --

n/a Required

files

n/a --

n/a Required

path

string --

The path to the folder to process. Required

vars

n/a --

n/a Required

__folder_files__

list --

A list of files contained in the dotfile folder.

fail_on_install_error

boolean False

Whether to stop if an install step fails (this will still continue until the current list is finished though).

folder_overlay

dict --

Overlay dictionary to specify more details install instructions for folder-based package install.

packages

list --

List of additional packages to install.

skip_extra_packages

boolean False

Skip the install of extra packages specified in a .freckle file.

skip_folder_packages

boolean False

Skip the install of packages calculated from folder names.

unstow

boolean False

Unstow dotfiles folders instead of stowing them, this also prevents the installation of packages.

Code

doc:
  short_help: Setup dotfiles and associated apps.
  help: |
    Symbolically link dotfile folders into place and install associated applications.

    This frecklet is mainly meant to be used with ``freckelize`` to provide a 'one-command' way
    of initializing a new workstation setup, including application install and configuration.

    It can be used without ``freckelize``, but this usage is neither documented nor supported.

    **Note**: this is currently unmaintained, it will be re-written at some stage
args:
  path:
    doc:
      short_help: The path to the folder to process.
    type: string
    required: true
    cli:
      param_type: argument
      metavar: FOLDER
  unstow:
    doc:
      short_help: Unstow dotfiles folders instead of stowing them, this also prevents
        the installation of packages.
    type: boolean
    default: false
    required: false
    cli:
      is_flag: true
      show_default: true
  folder_overlay:
    doc:
      short_help: Overlay dictionary to specify more details install instructions
        for folder-based package install.
    type: dict
    required: false
  packages:
    doc:
      short_help: List of additional packages to install.
    type: list
    required: false
    cli:
      metavar: PACKAGE
      param_decls:
      - --package
      - -p
  skip_folder_packages:
    doc:
      short_help: Skip the install of packages calculated from folder names.
    type: boolean
    required: false
    default: false
    cli:
      is_flag: true
      show_default: true
  skip_extra_packages:
    doc:
      short_help: Skip the install of extra packages specified in a .freckle file.
    type: boolean
    required: false
    default: false
    cli:
      is_flag: true
      show_default: true
  fail_on_install_error:
    doc:
      short_help: Whether to stop if an install step fails (this will still continue
        until the current list is finished though).
    type: boolean
    required: false
    default: false
    cli:
      is_flag: true
      show_default: true
  __folder_files__:
    doc:
      short_help: A list of files contained in the dotfile folder.
    type: list
    required: false
    cli:
      enabled: false

meta:
  freckelize:
    var_map:
      path: '{{:: path ::}}'
      folder_overlay: '{{:: extra_vars ::}}'
      packages: "{{:: vars['packages'] ::}}"
      __folder_files__: '{{:: files ::}}'
  tags:
  - freckelize
  - dotfiles
  - configuration

frecklets:
- task:
      # ignore_errors: "{{:: fail_on_install_error | negate ::}}"
    import-type: import
  frecklet:
    name: freckfrackery.dotfiles
    type: ansible-role
    resources:
      ansible-role:
      - freckfrackery.dotfiles
      - freckfrackery.install-pkgs
      - freckfrackery.install-pkg-mgrs
      - freckfrackery.install-conda
      - freckfrackery.install-nix
      - freckfrackery.install-vagrant
      - freckfrackery.install-virtualbox
      - geerlingguy.homebrew
      - elliotweiser.osx-command-line-tools
    msg: "process dotfile folder '{{:: path ::}}'"
    references:
      "'freckfrackery.dotfiles' Ansible role": https://gitlab.com/freckfrackery/freckfrackery.dotfiles
  vars:
    dotfiles_folder: '{{:: path ::}}'
    dotfiles_folder_files: '{{:: __folder_files__ ::}}'
    dotfiles_packages: '{{:: packages ::}}'
    dotfiles_folder_package_overlay: '{{:: folder_overlay ::}}'
    dotfiles_unstow: '{{:: unstow ::}}'
    dotfiles_ignore_install_errors: '{{:: fail_on_install_error | negate ::}}'
    dotfiles_skip_extra_packages: '{{:: skip_extra_packages ::}}'
    dotfiles_skip_folder_packages: '{{:: skip_folder_packages ::}}'
frecklecute --community dotfiles --help

Usage: frecklecute dotfiles [OPTIONS] FOLDER

  Symbolically link dotfile folders into place and install associated
  applications.

  This frecklet is mainly meant to be used with ``freckelize`` to provide a
  'one-command' way of initializing a new workstation setup, including
  application install and configuration.

  It can be used without ``freckelize``, but this usage is neither
  documented nor supported.

  **Note**: this is currently unmaintained, it will be re-written at some
  stage

Options:
  --extra-vars EXTRA_VARS         n/a  [required]
  --files FILES                   n/a  [required]
  --vars VARS                     n/a  [required]
  --fail-on-install-error / --no-fail-on-install-error
                                  Whether to stop if an install step fails
                                  (this will still continue until the current
                                  list is finished though).
  --folder-overlay FOLDER_OVERLAY
                                  Overlay dictionary to specify more details
                                  install instructions for folder-based
                                  package install.
  -p, --package PACKAGE           List of additional packages to install.
  --skip-extra-packages / --no-skip-extra-packages
                                  Skip the install of extra packages specified
                                  in a .freckle file.
  --skip-folder-packages / --no-skip-folder-packages
                                  Skip the install of packages calculated from
                                  folder names.
  --unstow / --no-unstow          Unstow dotfiles folders instead of stowing
                                  them, this also prevents the installation of
                                  packages.
  --help                          Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.dotfiles.Dotfiles
#


from dataclasses import dataclass
from pyckles import AutoPycklet
from typing import *    # noqa

@dataclass
class Dotfiles(AutoPycklet):
    """Symbolically link dotfile folders into place and install associated applications.

     This frecklet is mainly meant to be used with ``freckelize`` to provide a 'one-command' way
     of initializing a new workstation setup, including application install and configuration.

     It can be used without ``freckelize``, but this usage is neither documented nor supported.

     **Note**: this is currently unmaintained, it will be re-written at some stage

       Args:
         __folder_files__: A list of files contained in the dotfile folder.
         extra_vars: n/a
         fail_on_install_error: Whether to stop if an install step fails (this will still continue until the current list is finished though).
         files: n/a
         folder_overlay: Overlay dictionary to specify more details install instructions for folder-based package install.
         packages: List of additional packages to install.
         path: The path to the folder to process.
         skip_extra_packages: Skip the install of extra packages specified in a .freckle file.
         skip_folder_packages: Skip the install of packages calculated from folder names.
         unstow: Unstow dotfiles folders instead of stowing them, this also prevents the installation of packages.
         vars: n/a

    """

    FRECKLET_ID = "dotfiles"

    __folder_files__: List = None
    extra_vars: str = None
    fail_on_install_error: bool = None
    files: str = None
    folder_overlay: Dict = None
    packages: List = None
    path: str = None
    skip_extra_packages: bool = None
    skip_folder_packages: bool = None
    unstow: bool = None
    vars: str = None


    def __post_init__(self):
        super(Dotfiles, self).__init__(var_names=["__folder_files__", "extra_vars", "fail_on_install_error", "files", "folder_overlay", "packages", "path", "skip_extra_packages", "skip_folder_packages", "unstow", "vars"])


frecklet_class = Dotfiles
# -*- coding: utf-8 -*-


#
# module path: pycklets.dotfiles.Dotfiles
#


from pyckles import AutoPycklet

class Dotfiles(AutoPycklet):
    """Symbolically link dotfile folders into place and install associated applications.

     This frecklet is mainly meant to be used with ``freckelize`` to provide a 'one-command' way
     of initializing a new workstation setup, including application install and configuration.

     It can be used without ``freckelize``, but this usage is neither documented nor supported.

     **Note**: this is currently unmaintained, it will be re-written at some stage

       Args:
         __folder_files__: A list of files contained in the dotfile folder.
         extra_vars: n/a
         fail_on_install_error: Whether to stop if an install step fails (this will still continue until the current list is finished though).
         files: n/a
         folder_overlay: Overlay dictionary to specify more details install instructions for folder-based package install.
         packages: List of additional packages to install.
         path: The path to the folder to process.
         skip_extra_packages: Skip the install of extra packages specified in a .freckle file.
         skip_folder_packages: Skip the install of packages calculated from folder names.
         unstow: Unstow dotfiles folders instead of stowing them, this also prevents the installation of packages.
         vars: n/a

    """

    FRECKLET_ID = "dotfiles"

    def __init__(self, __folder_files__=None, extra_vars=None, fail_on_install_error=None, files=None, folder_overlay=None, packages=None, path=None, skip_extra_packages=None, skip_folder_packages=None, unstow=None, vars=None):

        super(Dotfiles, self).__init__(var_names=["__folder_files__", "extra_vars", "fail_on_install_error", "files", "folder_overlay", "packages", "path", "skip_extra_packages", "skip_folder_packages", "unstow", "vars"])
        self.___folder_files__ = __folder_files__
        self._extra_vars = extra_vars
        self._fail_on_install_error = fail_on_install_error
        self._files = files
        self._folder_overlay = folder_overlay
        self._packages = packages
        self._path = path
        self._skip_extra_packages = skip_extra_packages
        self._skip_folder_packages = skip_folder_packages
        self._unstow = unstow
        self._vars = vars

    @property
    def __folder_files__(self):
        return self.___folder_files__

    @__folder_files__.setter
    def __folder_files__(self, __folder_files__):
        self.___folder_files__ = __folder_files__

    @property
    def extra_vars(self):
        return self._extra_vars

    @extra_vars.setter
    def extra_vars(self, extra_vars):
        self._extra_vars = extra_vars

    @property
    def fail_on_install_error(self):
        return self._fail_on_install_error

    @fail_on_install_error.setter
    def fail_on_install_error(self, fail_on_install_error):
        self._fail_on_install_error = fail_on_install_error

    @property
    def files(self):
        return self._files

    @files.setter
    def files(self, files):
        self._files = files

    @property
    def folder_overlay(self):
        return self._folder_overlay

    @folder_overlay.setter
    def folder_overlay(self, folder_overlay):
        self._folder_overlay = folder_overlay

    @property
    def packages(self):
        return self._packages

    @packages.setter
    def packages(self, packages):
        self._packages = packages

    @property
    def path(self):
        return self._path

    @path.setter
    def path(self, path):
        self._path = path

    @property
    def skip_extra_packages(self):
        return self._skip_extra_packages

    @skip_extra_packages.setter
    def skip_extra_packages(self, skip_extra_packages):
        self._skip_extra_packages = skip_extra_packages

    @property
    def skip_folder_packages(self):
        return self._skip_folder_packages

    @skip_folder_packages.setter
    def skip_folder_packages(self, skip_folder_packages):
        self._skip_folder_packages = skip_folder_packages

    @property
    def unstow(self):
        return self._unstow

    @unstow.setter
    def unstow(self, unstow):
        self._unstow = unstow

    @property
    def vars(self):
        return self._vars

    @vars.setter
    def vars(self, vars):
        self._vars = vars



frecklet_class = Dotfiles