fiftydinar / gidro-os

My personalized custom OS image.
Apache License 2.0
12 stars 0 forks source link

feat: `homefiles` module #21

Closed fiftydinar closed 4 months ago

fiftydinar commented 4 months ago

WIP, doesn't work yet.

Used for testing only.

This module will get PR-ed & possibly merged in blue-build/modules repo after it gets thoroughly tested here.

Quick thoughts on what steps should look like:

homefiles.sh:

  1. Copy included homefiles from ./config/homefiles/ to /usr/share/bluebuild/homefiles/content/ Reason for copying it here instead of copying directly to skel is for distinct homefiles separation, since distro also populates skel. Disadvantage is some file duplication, but homefiles are usually not big in size, so not a big deal.

  2. Also copy homefiles to /usr/etc/skel/, to make those immediately copied on user-creation

  3. Write config from recipe.yml to /usr/share/bluebuild/homefiles/config.yml Config includes behavior on:

    1. which files should be copied 1-time only from skel (default: false)
    2. which files should be additionally copied if the files don't exist over-time (default: true)
    3. which files should be overwritten even if the files exist over-time (default: false)

      Over-time = 1d (default), can be configurable

homefiles binary:

  1. Read config file, search for homefiles & empty homedirs
  2. Use rsync for copying files with checksum when overwrite policy is enabled
  3. to be continued