Regenerated
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
|
||||
{
|
||||
options.enableFonts = lib.mkEnableOption "Enable nerd fonts";
|
||||
|
||||
config = lib.mkIf (config.enableFonts or false) {
|
||||
fonts.packages = with pkgs; [
|
||||
nerd-fonts.iosevka
|
||||
nerd-fonts.fira-code
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
# --- Module variables ---
|
||||
moduleName = "hyprland";
|
||||
username = config.defaultUser or "henrov";
|
||||
|
||||
# Assets directory
|
||||
assetPath = ../../../assets/hyprland/conf/hypr;
|
||||
|
||||
# Read all files except main config
|
||||
allFiles =
|
||||
if builtins.pathExists assetPath
|
||||
then builtins.readDir assetPath
|
||||
else {};
|
||||
|
||||
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 {
|
||||
|
||||
# Enable Hyprland programmatically
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
# --- Home Manager wiring ---
|
||||
home-manager.users.${username} = {
|
||||
home.stateVersion = "26.05";
|
||||
home.username = username;
|
||||
home.homeDirectory = "/home/${username}";
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
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
|
||||
'';
|
||||
};
|
||||
|
||||
restartTriggers = [ assetPath ];
|
||||
path = [];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
# --- Module variables ---
|
||||
moduleName = "stylix";
|
||||
username = config.defaultUser or "henrov";
|
||||
|
||||
# Assets directory for Stylix config
|
||||
assetPath = ../../../assets/system/conf/${moduleName};
|
||||
|
||||
# Read all config files
|
||||
programFiles = builtins.readDir assetPath;
|
||||
|
||||
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
|
||||
src = "${assetPath}/${name}";
|
||||
});
|
||||
|
||||
# Top-level toggle for this module
|
||||
enableProgram = config.enableStylix or false;
|
||||
|
||||
# Read the main stylix.conf
|
||||
stylixConfFile = "${assetPath}/stylix.conf";
|
||||
stylixConf = if builtins.pathExists stylixConfFile
|
||||
then builtins.readFile stylixConfFile
|
||||
else "";
|
||||
|
||||
in
|
||||
{
|
||||
# --- Top-level toggle ---
|
||||
options.enableStylix = lib.mkEnableOption "Enable Stylix system theming";
|
||||
|
||||
# --- Only apply configuration if enabled ---
|
||||
config = lib.mkIf enableProgram {
|
||||
|
||||
# Deploy Stylix configuration files to user's XDG config
|
||||
home-manager.users.${username}.xdg.configFile =
|
||||
lib.mapAttrs' (name: value: {
|
||||
name = "${moduleName}/${name}";
|
||||
value.source = value.src;
|
||||
}) files;
|
||||
|
||||
# Provide stylix.conf content as an environment variable (or for further init scripts)
|
||||
home-manager.users.${username}.home.sessionVariables = {
|
||||
STYLIX_CONF = stylixConf;
|
||||
};
|
||||
|
||||
# Optional wallpaper helper packages (symbolic, install manually or via packages)
|
||||
environment.systemPackages = [
|
||||
# symbolic references, actual pkgs mapping done elsewhere
|
||||
"feh"
|
||||
"st"
|
||||
];
|
||||
|
||||
# Cursor environment variables (read from stylix.conf if needed)
|
||||
# Minimal example using defaults from your stylix.conf
|
||||
home-manager.users.${username}.home.sessionVariables = lib.mkForce (
|
||||
let
|
||||
# Default cursor values if stylix.conf parsing not implemented
|
||||
cursorName = "phinger-cursors-light";
|
||||
cursorSize = 24;
|
||||
in {
|
||||
XCURSOR_THEME = cursorName;
|
||||
XCURSOR_SIZE = toString cursorSize;
|
||||
HYPRCURSOR_THEME = cursorName;
|
||||
HYPRCURSOR_SIZE = toString cursorSize;
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
# --- Module variables ---
|
||||
moduleName = "waybar";
|
||||
username = config.defaultUser or "henrov";
|
||||
|
||||
# Assets directory
|
||||
assetPath =
|
||||
if builtins.pathExists ../../../assets/system/conf/${moduleName}
|
||||
then ../../../assets/system/conf/${moduleName}
|
||||
else null;
|
||||
|
||||
# Read all files if assets exist
|
||||
programFiles =
|
||||
if assetPath != null
|
||||
then builtins.readDir assetPath
|
||||
else {};
|
||||
|
||||
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
|
||||
src = "${assetPath}/${name}";
|
||||
});
|
||||
|
||||
# Top-level toggle for this module
|
||||
enableProgram = config.enableWaybar or false;
|
||||
in
|
||||
{
|
||||
# --- Top-level toggle option ---
|
||||
options.enableWaybar = lib.mkEnableOption "Enable Waybar status bar";
|
||||
|
||||
# --- Only apply configuration if enabled ---
|
||||
config = lib.mkIf enableProgram {
|
||||
|
||||
# --- Dendritic container ---
|
||||
waybar = {
|
||||
enable = true;
|
||||
user = username;
|
||||
assetsDir = assetPath;
|
||||
files = files;
|
||||
};
|
||||
|
||||
# --- Deploy configuration to ~/.config/waybar ---
|
||||
home-manager.users.${username} = lib.mkIf assetPath != null {
|
||||
xdg.configFile =
|
||||
lib.mapAttrs' (name: value: {
|
||||
name = "${moduleName}/${name}";
|
||||
value.source = value.src;
|
||||
}) files;
|
||||
};
|
||||
|
||||
# --- Optional systemd service to sync configs ---
|
||||
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
|
||||
if [ -d "${assetPath}" ]; then
|
||||
for f in ${lib.concatStringsSep " " (builtins.attrNames files)}; do
|
||||
cp -u "${assetPath}/$f" "/home/${username}/.config/${moduleName}/$f"
|
||||
done
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
restartTriggers = [ assetPath ];
|
||||
path = [];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
# --- Module variables ---
|
||||
moduleName = "wayland";
|
||||
username = config.defaultUser or "henrov";
|
||||
|
||||
# Assets directory (optional)
|
||||
assetPath =
|
||||
if builtins.pathExists ../../../assets/system/conf/${moduleName}
|
||||
then ../../../assets/system/conf/${moduleName}
|
||||
else null;
|
||||
|
||||
programFiles =
|
||||
if assetPath != null
|
||||
then builtins.readDir assetPath
|
||||
else {};
|
||||
|
||||
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
|
||||
src = "${assetPath}/${name}";
|
||||
});
|
||||
|
||||
# Top-level toggle for this module
|
||||
enableProgram = config.enableWayland or true;
|
||||
in
|
||||
{
|
||||
# --- Declare the top-level toggle ---
|
||||
options.enableWayland = lib.mkEnableOption "Enable Wayland + portals";
|
||||
|
||||
# --- Only apply configuration if enabled ---
|
||||
config = lib.mkIf enableProgram {
|
||||
|
||||
# Example dendritic container (flat, self-contained)
|
||||
wayland = {
|
||||
enable = true;
|
||||
user = username;
|
||||
assetsDir = assetPath;
|
||||
files = files;
|
||||
|
||||
# Wayland-specific metadata
|
||||
portals = [ "hyprland" ];
|
||||
};
|
||||
|
||||
# Deploy assets to user's XDG config if they exist
|
||||
home-manager.users.${username} = lib.mkIf assetPath != null {
|
||||
xdg.configFile =
|
||||
lib.mapAttrs' (name: value: {
|
||||
name = "${moduleName}/${name}";
|
||||
value.source = value.src;
|
||||
}) files;
|
||||
};
|
||||
|
||||
# Example portal + packages configuration
|
||||
home-manager.users.${username} = {
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
|
||||
# Only reference pkgs if unavoidable
|
||||
extraPortals = [
|
||||
config.pkgs.xdg-desktop-portal-hyprland
|
||||
];
|
||||
|
||||
config.hyprland = {
|
||||
"org.freedesktop.impl.portal.Screencast" = [ "hyprland" ];
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
config.pkgs.uwsm
|
||||
];
|
||||
};
|
||||
|
||||
# Optional systemd service to sync configs (if needed)
|
||||
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
|
||||
if [ -d "${assetPath}" ]; then
|
||||
for f in ${lib.concatStringsSep " " (builtins.attrNames files)}; do
|
||||
cp -u "${assetPath}/$f" "/home/${username}/.config/${moduleName}/$f"
|
||||
done
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
restartTriggers = [ assetPath ];
|
||||
path = [];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user