Regenerated

This commit is contained in:
2026-03-19 14:59:23 +00:00
parent ec89904c6c
commit 5efe880ba5
29 changed files with 49 additions and 1513 deletions
+49 -20
View File
@@ -1960,36 +1960,65 @@ This is top file of this level which contains just an import statement for all r
{ lib, config, ... }:
let
# Path to your configuration assets
wofiAssets = ../../../assets/system/conf/wofi;
# --- Program definition ---
programName = "wofi";
# Read the files in that directory
wofiFiles = builtins.readDir wofiAssets;
# Path to assets
assetPath = ../../../assets/system/conf/${programName};
# Build an attribute set mapping filenames to their full paths
wofiConfs = lib.genAttrs (builtins.attrNames wofiFiles) (name: {
src = "${wofiAssets}/${name}";
# Generate file mappings
programFiles =
if builtins.pathExists assetPath then builtins.readDir assetPath else {};
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
src = "${assetPath}/${name}";
});
# Toggle for enabling Wofi
enableWofi = true;
# Top-level toggle for this module
enableProgram = config.enableWofi or false;
# Default user
username = config.defaultUser or "henrov";
in
{
# Module option to enable/disable Wofi
# --- Module option ---
options.enableWofi = lib.mkEnableOption "Enable Wofi terminal launcher";
# Everything in config is wrapped safely with mkIf
config = lib.mkIf enableWofi {
# Use mySystem as a container for all your programs
mySystem = {
wofi = {
enable = true;
assetsDir = wofiAssets;
files = wofiConfs;
# --- Config ---
config = lib.mkIf enableProgram {
# Example: you could reference a top-level user option
user = config.defaultUser or "henrov";
# --- Dendritic container for apps/services ---
myApps.${programName} = {
enable = true;
user = username;
assetsDir = assetPath;
files = files;
};
# --- Deploy assets to ~/.config/wofi ---
environment.etc."${programName}".source = assetPath;
# --- Optional systemd service to sync config ---
systemd.services."${programName}-sync" = {
description = "Sync ${programName} configuration files";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = ''
set -euo pipefail
if [ -d "${assetPath}" ]; then
for f in ${lib.concatStringsSep " " (builtins.attrNames files)}; do
mkdir -p "/home/${username}/.config/${programName}"
cp -u "${assetPath}/$f" "/home/${username}/.config/${programName}/$f"
done
fi
'';
};
restartTriggers = [ assetPath ];
path = [];
};
};
}