deleted generated files
This commit is contained in:
@@ -1,74 +0,0 @@
|
||||
{ lib, config, pkgs, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
# --- Module metadata ---
|
||||
moduleName = "kitty"; # Change per module
|
||||
assetPath = "${flakeRoot}/assets/system/conf/${moduleName}"; # Path to kitty config
|
||||
username = config.defaultUser or "henrov"; # Use default user
|
||||
enableProgram = config.enableKitty or true; # Toggle for this module
|
||||
|
||||
# Read asset files
|
||||
assetFiles = builtins.readDir assetPath;
|
||||
|
||||
# Map files → attrset
|
||||
files = lib.genAttrs (builtins.attrNames assetFiles) (name: {
|
||||
src = "${assetPath}/${name}";
|
||||
});
|
||||
in
|
||||
{
|
||||
# --- Top-level toggle option ---
|
||||
options.enableKitty = lib.mkEnableOption "Enable Kitty terminal integration";
|
||||
|
||||
# --- Apply configuration only if enabled ---
|
||||
config = lib.mkIf enableProgram {
|
||||
|
||||
# Dendritic container for this program
|
||||
myApps.${moduleName} = {
|
||||
enable = true;
|
||||
user = username;
|
||||
assetsDir = assetPath;
|
||||
files = files;
|
||||
|
||||
# Program-specific metadata
|
||||
theme = "catppuccin-mocha";
|
||||
};
|
||||
|
||||
# Deploy config files to XDG config
|
||||
home-manager.users.${username} = {
|
||||
programs.kitty.enable = true;
|
||||
|
||||
xdg.configFile = lib.mapAttrs' (name: value: {
|
||||
name = "${moduleName}/${name}";
|
||||
value.source = value.src;
|
||||
}) files;
|
||||
};
|
||||
|
||||
# Optional systemd service to sync Kitty config (example)
|
||||
systemd.services."${moduleName}-sync" = {
|
||||
description = "Sync ${moduleName} configuration";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = ''
|
||||
set -euo pipefail
|
||||
CONF="${assetPath}"
|
||||
|
||||
# Sync each file (example logic)
|
||||
for f in ${lib.concatStringsSep " " (builtins.attrNames files)}; do
|
||||
cp -u "$CONF/$f" "${HOME}/.config/${moduleName}/$f"
|
||||
done
|
||||
'';
|
||||
};
|
||||
|
||||
restartTriggers = [ assetPath ];
|
||||
|
||||
# Use system-wide binaries without referencing pkgs directly
|
||||
path = [
|
||||
"/run/current-system/sw/bin/coreutils"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{ lib, ... }:
|
||||
|
||||
let
|
||||
# Path to your Starship config inside the flake
|
||||
starshipAssets = ../../../assets/system/conf/starship.toml;
|
||||
|
||||
# Read and parse the TOML file as a symbolic value
|
||||
starshipConfig = lib.importTOML starshipAssets;
|
||||
|
||||
# Toggle on/off
|
||||
enableStarship = true;
|
||||
in
|
||||
{
|
||||
# Declare a top-level module option
|
||||
options.starship = {
|
||||
enable = lib.mkEnableOption "Enable Starship prompt";
|
||||
configFiles = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.any;
|
||||
default = {};
|
||||
description = "Symbolic Starship configuration files";
|
||||
};
|
||||
};
|
||||
|
||||
# Populate the option safely
|
||||
config = lib.mkIf enableStarship {
|
||||
starship.enable = true;
|
||||
starship.configFiles = {
|
||||
"starship.toml" = starshipConfig;
|
||||
assetsDir = ../../../assets/system/conf;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user