Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DotfiM profiles #3

Open
Timoses opened this issue Jul 15, 2018 · 0 comments
Open

DotfiM profiles #3

Timoses opened this issue Jul 15, 2018 · 0 comments

Comments

@Timoses
Copy link
Owner

Timoses commented Jul 15, 2018

Currently it's not possible to synchronize dotfile setups for specific environment types only. E.g. one would want a dotfile to exist and work for both a Windows and a Linux mashine. The ability to

  • assign specific lines of a file to a profile and
  • assign a file to a profile

enable the use of DotfiM for the purpose of

  • managing files for different types of environments (Windows/Linux),
  • using only dotfiles pertaining to a particular application and
  • adding passages/files only used in specific types of environments or situations (e.g. free time vs work environment)

Command overview

  • dotfim sync [--profile=<profile>] [<FilesOrFolders>]: allows syncing only specific profiles and/or files/folders
  • dotfim profile: list available profiles, and e.g. mark synced ones with *, OR: list available commands only
    • ls list profiles, like above
    • add a profile to be synced on this machine
    • remove profile from this machine's synced profile list
  • dotfim add --profile=<profile>[,<profiles>] <dotfile>: Add a specific file to one or more profiles
    • have to check that the file does not contain # dotfim profile <...> control statements!!!

Implications

  • The ability to add specific files to profiles requires to either
    • store that info in the file itself (profile header/file name, see below)
    • or store the information in a shared/synced dotfim config file
    • Implementing both could mean a bit more resilience and user friendly design
  • If no profile is specified the default profile is used. this allows a user to opt-out of the default profile and only sync specific profiles.

Control comments in dotfiles

# dotfim profile <profile1>,<profile2>,...: only applied to dotfile if the machine's dotfim is set up to be synced with the profile dotfim profile add...

  • A dotfile may not contain (see below "however simply") a profile passage for a specific when that is not currently synced (user first has to use dotfim profile add <profile> && dotfim sync --profile <profile>) before allowing the addition of further passages
    • Otherwise, the order in which the new dotfile profile passage should be added is unclear
      • !!!!!! Could however simply add the new profile passage to the bottom of the last gitfile profile passage. OR!!!! use the existing other lines as a reference of where the dotfile passage should be inserted!

Further ideas

  • Track which machine/hostname & user uses which profiles (could be stored in gitfile with #managed by dotfim): allows listing which hosts use which profiles
  • A file could be assigned to one or more profiles (dotfim add --profile). This means either
    • the file name could be used for distinctaion (e.g. .vimrc.profile_<name1>), or
    • the file contains several sections with headers and splitters (use old sectionHandler?....)

TODO

Add the following ideas:

Several Profiles Can be Assigned to a Passage.
Allows e.g. creating a 'remote' profile. The same passages can be used in other profiles as well.
What about: if I want a passage profiled 'bash' to have a 'remote' and a 'normal' version? -> Add combination of passages? E.g. <'bash','normal'> and <'bash','remote'>?

profiles are like passages, but they may contain passages. E.g. a gitfile would have:

# dotfim profile windows {
# dotfim local windows-machine
...
# dotfim }

# dotfim profile linux
linux profile line

In effect it works like "local/private" (which filters the host name).

@Timoses Timoses mentioned this issue Dec 9, 2018
@Timoses Timoses changed the title Allow profile section Allow profiles Dec 9, 2018
This was referenced Dec 9, 2018
@Timoses Timoses changed the title Allow profiles DotfiM profiles Dec 9, 2018
@Timoses Timoses mentioned this issue Dec 20, 2018
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant