-
Notifications
You must be signed in to change notification settings - Fork 0
Updated : Generating home config files using autoconfig
Hamzaukw edited this page Sep 9, 2025
·
1 revision
-
scripts/autoconf-pipeline.py← Entrypoint -
ansible/-
inventory/-
hosts.ini← Hosts and group mappings -
group_vars/← Group-based home varsgroup_home_cli.ymlgroup_home_roles.ymlgroup_home_services.ymlgroup_home_luxnix.ymlgroup_home_desktops.yml
-
host_vars/-
home/-
gc-08.yml← Host-specific home vars
-
-
-
-
-
autoconf/-
home_merged_vars/-
gc-08.yml← (auto-generated output)
-
-
-
homes/-
x86_64-linux/-
admin@gc-08/-
default.nix← (final output)
-
-
-
-
conf/-
nix-templates/-
homes/-
x86_64-linux/default.nix.j2
-
-
-
-
lx_administration/-
autoconf/-
main.py← entry point that calls ETL + Nix pipelines -
imports/-
main.py← defineshome_etl() -
utils.py← definesload_home_host_vars()
-
-
nix/-
home.py← defineshome_pipe() -
home_template_renderer.py← definesrender_home_nix_template() -
utils.py← defineswrite_nix_file()
-
-
-
models/-
merged_host_vars.py← extended with home-specific keys and methods
-
-
ansible/inventory/hosts.iniansible/inventory/group_vars/group_home_*.ymlansible/inventory/host_vars/home/<host>.yml
-
Function:
home_etl() -
File:
lx_administration/autoconf/imports/main.py - Uses:
load_home_host_vars()fromlx_administration/autoconf/imports/utils.py - Validates with:
MergedHostVarsfromlx_administration/models/merged_host_vars.py - Outputs merged YAML to:
autoconf/home_merged_vars/<host>.yml
-
Function:
home_pipe() -
File:
lx_administration/autoconf/nix/home.py - Loads YAML using
MergedHostVars.load_home_from_file() - Extracts platform via
get_host_platform() - Gets users from
system_users(defaults to["admin"]) - Calls
prepare_home_config()to create the final structured config
-
Function:
prepare_home_config() -
File:
lx_administration/models/merged_host_vars.py - Merges:
-
group_home_cli+host_home_cli -
group_home_roles+host_home_roles -
group_home_services+host_home_services -
group_home_luxnix+host_home_luxnix -
group_home_desktops+host_home_desktops - Applies:
-
strip_common_prefix()to clean up keys likecli. -
dotkey_to_nested_dict()to create nested attribute sets - Returns a final nested dictionary ready for rendering
-
Function:
render_home_nix_template() -
File:
lx_administration/autoconf/nix/home_template_renderer.py - Uses Jinja2 templating engine
- Custom filter:
to_nix()converts Python types to Nix literals - Template path:
conf/nix-templates/homes/<platform>/default.nix.j2
-
Function:
write_nix_file() -
File:
lx_administration/autoconf/nix/utils.py - Writes the rendered file to: homes//@/default.nix
-
homes/-
x86_64-linux/-
admin@gc-08/default.nix
-
-
To remove trailing whitespace and ensure each file ends with a newline, run the following command from the project root:
find ansible/inventory/host_vars/home/ -type f -name "*.yml" \
-exec sed -i 's/[ \t]*$//' {} \; \
-exec sh -c 'tail -c1 "$1" | read -r _ || echo >> "$1"' _ {} \;- Finds all .yml files under the home/ directory (excluding directories and symlinks).
- Removes trailing spaces or tabs from the end of every line.
- Checks if the file ends with a newline. If not, it appends one.
- Installation Guide - NixOS and Setting Up Luxnix
- Flake.nix & Garbage Collection
- Access Management
- Roles
- LX Cheatsheet
- tmux CLI Cheatsheet
- Deployment Guide
- Development
- Hardware Setup
- Network Architecture
- Security Improvements
- Security
- Service Architecture
- User Management
- Systemd tmpfiles Rules in NixOS
- Common Errors
- NixOs Configuration Testing with Eval
- System Language Change
- Roles Documentation
- Doc Maintenance Schedule
- Luxnix Server Setup with example
- Postgres Config Guide
- Postgres Documentation
- Postgres gc-10 Declarative Setup Summary
- Endoreg Central Architecture
- Readme
- Ansible CMDB Readme
- Process flow of creating Hosts, Roles, Groups
- Adding a New User Configuration
- Maintenance & Security: Auto Update #6
- Home Configuration Autoconf Flow (Step-by-Step)
- Guide to Define New Setting With Example
- Autoconfig- create inventory.yml using Python Script
- Updated : Generating home config files using autoconfig
- git
- vscode
- fix_long_lines
- kernel
- keycloak-setup
- network
- setup-mail
- setup-s04
- syncthing
- 2025-01-29 - postgres