Regenerated

This commit is contained in:
2026-03-20 10:13:24 +00:00
parent 822dba545e
commit 4dd516851d
30 changed files with 84 additions and 1582 deletions
+84 -77
View File
@@ -116,7 +116,7 @@ The Nix flake definition for Droidnix.
[
# ./generated/system/mysystem.nix
]
++ (inputs.import-tree ./generated/modules).imports
# ++ (inputs.import-tree ./generated/modules).imports # moved to traveldroid
++ [
./generated/hosts/traveldroid/traveldroid.nix
./generated/hosts/traveldroid/boot.nix
@@ -327,24 +327,50 @@ in
* First the nix-files that flake really needs and that do not fit wel in the hierarchical structure
** =generated/hosts/traveldroid/traveldroid.nix=
#+BEGIN_SRC nix :tangle generated/hosts/traveldroid/traveldroid.nix :noweb tangle :mkdirp yes :eval never-html
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
let
# --- Path to your modules ---
modulesPath = ./generated/modules;
# --- Import all modules via import-tree ---
importedModules = import-tree modulesPath;
# --- Flatten the modules into a list ---
allModules = builtins.attrValues importedModules.imports;
# --- Helper: extract homeManagerExtraUsers if present ---
getFragment = module:
if builtins.hasAttr "homeManagerExtraFragments" module
then module.homeManagerExtraFragments
else {};
# --- Merge all fragments together ---
mergedHomeManagerUsers = lib.foldl' lib.mkMerge {} (map getFragment allModules);
in
{
# Host-specific system configuration
# Host-specific configuration
networking.hostName = "traveldroid";
system.stateVersion = "26.05";
#enablingModules
enableFlatpaks = true;
enableThunar = true;
enableWofi = true;
enableZenBrowser = true;
enableEmacs = true;
enableKitty = true;
enableZsh = true;
enableFonts = true;
enableHyprland = true;
enableStylix = true;
# Enable modules
enableFlatpaks = false;
enableThunar = false;
enableWofi = false;
enableZenBrowser= false;
enableEmacs = false;
enableKitty = false;
enableZsh = false;
enableFonts = false;
enableHyprland = true;
enableStylix = false;
# --- Inject the merged homeManagerExtraUsers fragments ---
home-manager.users = lib.mkMerge [
config.home-manager.users
mergedHomeManagerUsers
];
}
#+END_SRC
@@ -600,93 +626,74 @@ Setting up Hyprland
{ lib, config, ... }:
let
# --- Module variables ---
moduleName = "hyprland";
username = config.defaultUser or "henrov";
# Assets directory
# Path to hyprland assets
assetPath = ../../../assets/hyprland/conf/hypr;
# Read all files except main config
allFiles =
if builtins.pathExists assetPath
then builtins.readDir assetPath
else {};
# Main config
mainConfigPath = "${assetPath}/hypr.hyprland.conf";
otherFiles = lib.filter (name: name != "hyprland.conf") (builtins.attrNames allFiles);
files = lib.genAttrs otherFiles (name: {
src = "${assetPath}/${name}";
});
# Main config (inline)
mainConfigPath =
if builtins.pathExists "${assetPath}/hyprland.conf"
then "${assetPath}/hyprland.conf"
else null;
# Top-level toggle
enableProgram = config.enableHyprland or false;
in
{
# --- Option ---
options.enableHyprland = lib.mkEnableOption "Enable Hyprland desktop";
# --- Config ---
config = lib.mkIf enableProgram {
# --- ExtraFragment for aggregator ---
{ lib, config, ... }:
# Enable Hyprland programmatically
programs.hyprland.enable = true;
let
moduleName = "hyprland";
username = config.defaultUser or "henrov";
# --- Home Manager wiring ---
home-manager.users.${username} = {
# Path to hyprland assets
assetPath = ../../../assets/hyprland/conf/hypr;
# Main config
mainConfigPath = "${assetPath}/hypr.hyprland.conf";
enableProgram = config.enableHyprland or false;
in
{
# --- Option ---
options.enableHyprland = lib.mkEnableOption "Enable Hyprland desktop";
# --- ExtraFragment for aggregator ---
homeManagerExtraUsers = lib.mkIf enableProgram {
${username} = {
wayland.windowManager.hyprland = {
enable = true;
# Minimal example setting
settings.general."col.active_border" = lib.mkForce "0xff97cbcd 0xff89b4fa";
};
# Deploy the main config file
xdg.configFile = {
"hypr/hyprland.conf".text = builtins.readFile mainConfigPath;
};
};
};
} = lib.mkIf enableProgram {
${username} = {
home.stateVersion = "26.05";
home.username = username;
home.homeDirectory = "/home/${username}";
wayland.windowManager.hyprland = {
enable = true;
# Minimal example setting
settings.general."col.active_border" = lib.mkForce "0xff97cbcd 0xff89b4fa";
};
# Deploy config files
xdg.configFile =
(lib.mapAttrs' (name: value: {
name = "hypr/${name}";
value.source = value.src;
}) files)
// (if mainConfigPath != null then {
"hypr/hyprland.conf".text = builtins.readFile mainConfigPath;
} else {})
// {
"hypr/.keep".text = "";
};
};
# --- Optional: systemd service to sync configs ---
systemd.services."${moduleName}-sync" = {
description = "Sync ${moduleName} 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
cp -u "${assetPath}/$f" "/home/${username}/.config/${moduleName}/$f"
done
fi
if [ -f "${mainConfigPath}" ]; then
cp -u "${mainConfigPath}" "/home/${username}/.config/${moduleName}/hyprland.conf"
fi
'';
# Deploy the main config file
xdg.configFile = {
"hypr/hyprland.conf".text = builtins.readFile mainConfigPath;
};
restartTriggers = [ assetPath ];
path = [];
};
};
}