Sysconfigs is my take on Linux workstation configuration. It is currently focused on Arch Linux, on which I use for a daily basis.
The main goal of this project is twofolds:
- To collect all my system configurations therefore I'll never need to configure the same stuff again. (Unless something is broken.)
- To organize my configurations and construct an automated way to apply them easily.
The repository mainly consists of two parts:
sysconfig-- A python script to facilitate applying and modifying configurations.modules.d-- directory where configs reside. Each subdirectory is a config module, which covers configuration of an application or functionality of my Linux system.
packages.d/packages-<distro>.yamla list of packages to be installed to system, where
<distro>can beubuntu,fedora,arch, orany. File format:- packagename1 - packagename2 ...
files.d/files-<distro>.yamla list of files to installed to system. Files are by default symlinked to its target, unless otherwise defined by
copyoption. Ifasrootistrue, the particular link/copy will be done as root, suitable for modifying system level configurations. File format:- source: relpath/to/source1 target: abspath/to/target1 copy: true - source: relpath/to/source2 target: abspath/to/target2 copy: false asroot: true ...
If
targetalready exists, original file will be renamed totarget.orig.<N>before linking/copying.files.d/source/a directory where source configuration files are kept.
hooks.d/preinstall-<distro>,hooks.d/postinstall-<distro>hooks to be executed before/after configuration module installation. This can be any binary or script executable. The only constraint is the file's exec bits are set properly.
Operations are mainly executed via sysconfig script, which features the
following functionalities:
- Install the specified or all config modules.
- List available config modules.
- Show content of the specified config module.
- Initialize a new config module by creating boilerplate module directory and file structure.
Each configuration module is created under modules.d directory
and named NNNN<module-name>, where N is a digit of [0-9].
During configuring process, modules are applied in alpha-numeral order
as defined by NNNN<module-name>.
During installation of each module, the followings are performed in order.
hooks.d/preinstall-<distro>is executed if exists.- Packages listed in
packages.d/files-<distro>.yamlare installed. - Configuration and other files listed in
files.d/files-<distro>.yamlare linked/copied. hooks.d/postinstall-<distro>is executed if exists.