Config file and package tracking utility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
3.1 KiB

#+TITLE: Manafiles
#+AUTHOR: Riyyi
#+LANGUAGE: en
#+OPTIONS: toc:nil
3 years ago
Config file and package tracking utility.
3 years ago
- Manage dotfiles and system config files.
- Selectively comment and uncomment depending on machine configuration.
- Store a list of all installed packages.
- Install packages from a stored list.
** Getting started
*** Installation
If you are using *Arch Linux*, you can install the AUR package [[https://aur.archlinux.org/packages/manafiles-git/][manafiles-git]].
Alternatively, you will have to [[#building][build from source]].
*** Configuration
**** Install the example configuration
During installation, manafiles will install the example config to: \\
~/usr/share/doc/manafiles/examples/manafiles.json~
From there you can copy it to anywhere in the working directory,
the config file is searched recursively. \\
~$HOME/<dotfiles>/<anywhere>~
**** Exclude paths
Everything in this list will get excluded when pushing config files from the working directory to the system. \\
Currently three types of file matching are supported:
- ~file~ full name of the file matches
- ~directory~ full name of the directory matches
- ~endsWith~ end of the path matches
The excluded paths from the example config:
#+BEGIN_SRC javascript
"excludePaths" : {
".git": "directory",
".md": "endsWith",
"manafiles.json": "endsWith",
"packages": "file",
"README.org": "endsWith",
"screenshot.png": "file"
}
#+END_SRC
3 years ago
**** System config files
3 years ago
Directories in this list will be pushed to the root ~/~ of the system, instead of ~$HOME~.
The system directories from the example config:
#+BEGIN_SRC javascript
"systemDirectories": [
"/boot",
"/etc",
"/usr/share"
]
#+END_SRC
3 years ago
*** Usage
3 years ago
**** Selectively comment and uncomment
3 years ago
Config files can be pushed from the working directory to the system like so:
3 years ago
#+BEGIN_SRC shell-script
$ manafiles -Fs
3 years ago
#+END_SRC
When pushing files to the system, manafiles recognizes special blocks and comments
or uncomments them depending on the machine's configuration. Such a block looks
like this:
3 years ago
#+BEGIN_SRC shell-script
# >>> distro=arch hostname=arch-desktop user=anon
export PATH="$PATH:$HOME/.local/bin"
# <<<
3 years ago
#+END_SRC
This block uses all of the supported configurations, ~distro~, ~hostname~ and
~user~. These can be used in any combination and order.
If *all* of the given configurations match, manafiles will make sure that the
contents of the block are uncommented. If *any* of them do *not* match, then
manafiles will make sure that the contents of the block are commented.
** Building
*** Build dependencies
- ~gcc-libs~
- (make) ~cmake~
- (make) ~git~
- (make) ~gzip~
- (make) ~nlohmann-json~ [[https://archlinux.org/packages/community/any/nlohmann-json/][arch]], [[https://packages.debian.org/search?keywords=nlohmann-json][debian]], [[https://packages.ubuntu.com/search?keywords=nlohmann-json][ubuntu]]
- (optional) ~grep~
- (optional) ~pacman~ + ~pacman-contrib~
- (optional) ~apt~ + ~dpkg~
The optional requirements are for the package tracking functionality.
*** Build compilation
#+BEGIN_SRC shell-script
$ mkdir build
$ cd build
$ cmake ..
$ make
#+END_SRC
*** Build installation
#+BEGIN_SRC shell-script
$ sudo make install
#+END_SRC