项目作者: trskop

项目描述 :
User configuration files (dot-files)
高级语言: Haskell
项目地址: git://github.com/trskop/dot.config.git
创建时间: 2018-07-15T12:40:51Z
项目社区:https://github.com/trskop/dot.config

开源协议:

下载


User configuration files (dot–files)

TODO:

Installation

Some dependencies need to be installed. On Debian it is:

  1. sudo apt install haskell-stack curl libtinfo-dev zlib1g-dev

We are expecting that there are some files already present in your ~/.config/
directory. This installation process will leave them untouched, but you may
need to resolve issues with files that exist both locally and in the
repository.

  1. cd ~/.config/
  2. git init
  3. git remote add origin git@github.com:trskop/dot.config.git
  4. git fetch --all
  5. git checkout -b master origin/master

If installing on a clean system then ~/.config directory may not exist, in
which case it becomes a little bit easier. We’ll be using HTTPS protocol
instead of SSH, since SSH key for accessing GitHub may not be present on a
pristine system. Just reconfigure remote URL afterwards.

  1. git clone https://github.com/trskop/dot.config.git ~/.config

Make sure to use ~/.local/bin for your executables instead of ~/bin:

  1. cd ~
  2. mkdir -p ~/.local/bin
  3. if [ -e ~/bin ]; then mv ~/bin/* ~/.local/bin/; fi
  4. rmdir bin

For backward compatibility it is possible to do this:

  1. ln -s .local/bin bin

Now make sure that ~/.profile and ~/.bash_profile add ~/.local/bin into
your $PATH instead of ~/bin.

Make sure that stack installed through the system package is sufficiently
new. If not then run:

  1. stack upgrade

To avoid long bootstrapping sequence when calling Haskell scripts it may be a
good idea to run:

  1. stack setup 8.10.4

Where 8.10.4 is GHC version used by ~/.config/dot.config.init.hs. Please
check the Stackage LTS version specified in it to be sure as this documentation
may be out of date.

Now we need to install everything:

  1. ~/.config/dot.config.init.hs bootstrap
  2. yx this -Uusin

Version-controlled Host-specific Configuration

Host-specific configuration is stored in ~/.local/src/localhost repository
with following directory structure:

  1. ~/.local/src/localhost/
  2. ├── ${host}/
  3. ├── dot.config/ <── Private configuration that would normally go to
  4. ${XDG_CONFIG_HOME:-${HOME}/.config}
  5. └── ...
  6. └── notes/ <── Notes about the hardware, installation specifics, etc.
  7. Basically anything that is easily forgotten once the
  8. system is installed and configured.
  9. └── ...
  10. ├── this -> ${host}
  11. └── dot.config -> this/dot.config

Where ${host} is the result of hostname --fqdn. This allows us to
reuse/share the repository for multiple machines. One such example is when one
machine dies, and new one has to be installed. Copying over existing
repository can serve as a nice starting point.

Script scripts/init-host-specific-config-repo.bash is provided to create the
repository with the above structure. It can be invoked as:

  1. bash ~/.config/scripts/init-host-specific-config-repo.bash

Scripts

Other Resources