Working on reshuffling
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
{ lib, pkgs, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
# --- Define user locally ---
|
||||
username = "henrov";
|
||||
|
||||
# --- Eww config directory in flake ---
|
||||
ewwAssetsDir = "${flakeRoot}/assets/system/conf/eww";
|
||||
|
||||
# --- Read all files in ewwAssetsDir dynamically ---
|
||||
ewwFiles = builtins.attrNames (builtins.readDir ewwAssetsDir);
|
||||
|
||||
# --- Generate xdg.configFile entries for all files ---
|
||||
ewwConfigs = lib.genAttrs ewwFiles (name: {
|
||||
text = builtins.readFile "${ewwAssetsDir}/${name}";
|
||||
});
|
||||
|
||||
# --- Full config directory path in user's config home ---
|
||||
ewwConfigDir = "/home/${username}/.config/eww";
|
||||
in
|
||||
{
|
||||
flake.nixosModules.eww = { config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
options.mySystem.apps.eww.enable =
|
||||
lib.mkEnableOption "Enable Eww widgets";
|
||||
|
||||
config = lib.mkIf (config.mySystem.apps.eww.enable or false) {
|
||||
|
||||
mySystem = {
|
||||
apps.wallpaper = {
|
||||
enable = true;
|
||||
packages = [ "eww" ]; # symbolic, actual package below
|
||||
};
|
||||
};
|
||||
|
||||
# --- Home Manager user config ---
|
||||
home-manager.users.${username} = {
|
||||
home.stateVersion = "25.11";
|
||||
home.username = username;
|
||||
home.homeDirectory = "/home/${username}";
|
||||
|
||||
# Deploy eww configs
|
||||
home.file."${ewwConfigDir}" = {
|
||||
source = ewwAssetsDir;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
# Session variables
|
||||
home.sessionVariables = {
|
||||
EWW_BIN = "${pkgs.eww}/bin/eww";
|
||||
};
|
||||
|
||||
# Wayland/Hyprland startup hooks
|
||||
wayland.windowManager.hyprland.settings = lib.mkForce {
|
||||
exec-once = [ "eww daemon" ];
|
||||
exec = [ "eww open-many ${ewwConfigDir}/widgets" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
{ lib, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
programName = "fonts";
|
||||
|
||||
# --- Assets (if any) ---
|
||||
programAssets = "${flakeRoot}/assets/system/conf/${programName}";
|
||||
programFiles =
|
||||
if builtins.pathExists programAssets
|
||||
then builtins.readDir programAssets
|
||||
else {};
|
||||
|
||||
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
|
||||
src = "${programAssets}/${name}";
|
||||
});
|
||||
|
||||
# Enable toggle (matches option defined below)
|
||||
enableProgram = config.enableFonts or true;
|
||||
|
||||
# Default user
|
||||
user = config.defaultUser or "henrov";
|
||||
in
|
||||
{
|
||||
# --- Top-level toggle ---
|
||||
options.enableFonts =
|
||||
lib.mkEnableOption "Enable system fonts";
|
||||
|
||||
# --- Configuration applied only if enabled ---
|
||||
config = lib.mkIf enableProgram {
|
||||
|
||||
# Dendritic container for this program
|
||||
myApps.${programName} = {
|
||||
enable = true;
|
||||
assetsDir = programAssets;
|
||||
files = files;
|
||||
user = user;
|
||||
|
||||
# Example font packages (without referencing pkgs directly outside mkIf)
|
||||
packages = [
|
||||
"nerd-fonts-iosevka"
|
||||
"nerd-fonts-fira-code"
|
||||
];
|
||||
};
|
||||
|
||||
# Actual NixOS/Home Manager config
|
||||
fonts.packages = with pkgs; [
|
||||
nerd-fonts.iosevka
|
||||
nerd-fonts.fira-code
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
{ lib, config, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
# --- Program definition ---
|
||||
programName = "hyprland";
|
||||
|
||||
# --- Assets ---
|
||||
programAssets = "${flakeRoot}/assets/hyprland/conf/hypr";
|
||||
|
||||
programFiles =
|
||||
if builtins.pathExists programAssets
|
||||
then builtins.readDir programAssets
|
||||
else {};
|
||||
|
||||
fileNames = builtins.attrNames programFiles;
|
||||
|
||||
# Exclude main config (handled separately)
|
||||
otherFiles = lib.filter (name: name != "hyprland.conf") fileNames;
|
||||
|
||||
# Generate file mappings
|
||||
files = lib.genAttrs otherFiles (name: {
|
||||
src = "${programAssets}/${name}";
|
||||
});
|
||||
|
||||
# Main config (inline)
|
||||
mainConfigPath = "${programAssets}/hyprland.conf";
|
||||
|
||||
# Enable toggle (must match option)
|
||||
enableProgram = config.enableHyprland or true;
|
||||
|
||||
# Resolve user safely
|
||||
user = config.defaultUser or "henrov";
|
||||
in
|
||||
{
|
||||
# --- Option ---
|
||||
options.enableHyprland =
|
||||
lib.mkEnableOption "Enable Hyprland desktop";
|
||||
|
||||
# --- Config ---
|
||||
config = lib.mkIf enableProgram {
|
||||
|
||||
# --- Dendritic app definition ---
|
||||
myApps.${programName} = {
|
||||
enable = true;
|
||||
assetsDir = programAssets;
|
||||
files = files;
|
||||
inherit user;
|
||||
|
||||
compositor = "hyprland";
|
||||
};
|
||||
|
||||
# --- System-level enable ---
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
# --- Home Manager wiring ---
|
||||
home-manager.users.${user} = {
|
||||
|
||||
home.stateVersion = "25.11";
|
||||
home.username = user;
|
||||
home.homeDirectory = "/home/${user}";
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
|
||||
settings.general."col.active_border" =
|
||||
lib.mkForce "0xff97cbcd 0xff89b4fa";
|
||||
};
|
||||
|
||||
# --- Config files ---
|
||||
xdg.configFile =
|
||||
(lib.mapAttrs' (name: value: {
|
||||
name = "hypr/${name}";
|
||||
value.source = value.src;
|
||||
}) files)
|
||||
// {
|
||||
"hypr/hyprland.conf".text =
|
||||
if builtins.pathExists mainConfigPath
|
||||
then builtins.readFile mainConfigPath
|
||||
else "";
|
||||
|
||||
"hypr/.keep".text = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
{ lib, config, pkgs, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
# --- Program definition ---
|
||||
programName = "stylix";
|
||||
|
||||
# Assets (theme + wallpaper)
|
||||
programAssets = "${flakeRoot}/assets/system/theming/${programName}";
|
||||
programFiles =
|
||||
if builtins.pathExists programAssets
|
||||
then builtins.readDir programAssets
|
||||
else {};
|
||||
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
|
||||
src = "${programAssets}/${name}";
|
||||
});
|
||||
|
||||
# Enable toggle (must match option)
|
||||
enableProgram = config.enableStylix or true;
|
||||
|
||||
# Resolve user safely (outside mkIf)
|
||||
user = config.defaultUser or "henrov";
|
||||
|
||||
# --- Stylix configuration (self-contained) ---
|
||||
stylixCfg = {
|
||||
enable = true;
|
||||
|
||||
base16Scheme =
|
||||
"${flakeRoot}/assets/system/theming/stylix/catppuccin-mocha.yaml";
|
||||
|
||||
image =
|
||||
"${flakeRoot}/assets/hyprland/wallpaperstuff/pictures/wall1.jpg";
|
||||
|
||||
polarity = "dark";
|
||||
|
||||
cursor = {
|
||||
package = pkgs.phinger-cursors;
|
||||
name = "phinger-cursors-light";
|
||||
size = 24;
|
||||
};
|
||||
|
||||
fonts = {
|
||||
monospace = {
|
||||
package = pkgs.nerd-fonts.fira-code;
|
||||
name = "Fira Code Nerd Font";
|
||||
};
|
||||
sansSerif = {
|
||||
package = pkgs.lato;
|
||||
name = "Lato";
|
||||
};
|
||||
};
|
||||
|
||||
icons = {
|
||||
enable = true;
|
||||
package = pkgs.papirus-icon-theme;
|
||||
dark = "Papirus-Dark";
|
||||
light = "Papirus-Light";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
# --- Option ---
|
||||
options.enableStylix =
|
||||
lib.mkEnableOption "Enable Stylix system theming";
|
||||
|
||||
# --- Config ---
|
||||
config = lib.mkIf enableProgram {
|
||||
|
||||
# --- Dendritic app definition ---
|
||||
myApps.${programName} = {
|
||||
enable = true;
|
||||
assetsDir = programAssets;
|
||||
files = files;
|
||||
inherit user;
|
||||
|
||||
theme = "catppuccin-mocha";
|
||||
polarity = "dark";
|
||||
};
|
||||
|
||||
# --- Stylix theming ---
|
||||
stylix = stylixCfg;
|
||||
|
||||
# --- Optional: wallpaper helper (kept dendritic) ---
|
||||
myApps.wallpaper = {
|
||||
enable = true;
|
||||
packages = [ "feh" "st" ];
|
||||
};
|
||||
|
||||
# --- Cursor environment variables ---
|
||||
home-manager.users.${user}.home.sessionVariables = {
|
||||
XCURSOR_THEME = stylixCfg.cursor.name;
|
||||
XCURSOR_SIZE = toString stylixCfg.cursor.size;
|
||||
HYPRCURSOR_THEME = stylixCfg.cursor.name;
|
||||
HYPRCURSOR_SIZE = toString stylixCfg.cursor.size;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{ lib, ... }:
|
||||
|
||||
let
|
||||
username = "henrov";
|
||||
waybarAssets = ../../../assets/system/conf/waybar;
|
||||
waybarFiles = builtins.readDir waybarAssets;
|
||||
waybarConfs = lib.genAttrs (builtins.attrNames waybarFiles) (name: {
|
||||
src = "${waybarAssets}/${name}";
|
||||
});
|
||||
|
||||
enableWaybar = true;
|
||||
in
|
||||
{
|
||||
# Declare a top-level option
|
||||
options.myApps = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.any;
|
||||
default = {};
|
||||
description = "Top-level collection of custom apps";
|
||||
};
|
||||
|
||||
options.enableWaybar = lib.mkEnableOption "Enable Waybar status bar";
|
||||
|
||||
# Everything goes under config safely
|
||||
config = lib.mkIf enableWaybar {
|
||||
myApps = {
|
||||
waybar = {
|
||||
enable = true;
|
||||
user = username;
|
||||
assetsDir = waybarAssets;
|
||||
files = waybarConfs;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
# --- Program definition ---
|
||||
programName = "wayland";
|
||||
|
||||
# Assets (optional, kept for consistency with template)
|
||||
programAssets = ../../../assets/system/conf/${programName};
|
||||
programFiles =
|
||||
if builtins.pathExists programAssets
|
||||
then builtins.readDir programAssets
|
||||
else {};
|
||||
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
|
||||
src = "${programAssets}/${name}";
|
||||
});
|
||||
|
||||
# Enable toggle (must match option name)
|
||||
enableProgram = config.enableWayland or true;
|
||||
|
||||
# Resolve user safely (outside mkIf)
|
||||
user = config.defaultUser or "henrov";
|
||||
in
|
||||
{
|
||||
# --- Option ---
|
||||
options.enableWayland =
|
||||
lib.mkEnableOption "Enable Wayland + portals";
|
||||
|
||||
# --- Config ---
|
||||
config = lib.mkIf enableProgram {
|
||||
|
||||
# --- Dendritic app definition ---
|
||||
myApps.${programName} = {
|
||||
enable = true;
|
||||
assetsDir = programAssets;
|
||||
files = files;
|
||||
inherit user;
|
||||
|
||||
# Wayland-specific metadata
|
||||
portals = [ "hyprland" ];
|
||||
};
|
||||
|
||||
# --- Actual system wiring ---
|
||||
home-manager.users.${user} = {
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
|
||||
# pkgs is unavoidable here (real package dependency)
|
||||
extraPortals = [
|
||||
config.pkgs.xdg-desktop-portal-hyprland
|
||||
];
|
||||
|
||||
config.hyprland = {
|
||||
"org.freedesktop.impl.portal.Screencast" = [ "hyprland" ];
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
config.pkgs.uwsm
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user