Working on reshuffling
This commit is contained in:
+52
-25
@@ -1039,39 +1039,66 @@ This file installs and configures fonts
|
||||
** =generated/modules/desktop/eww.nix=
|
||||
This file installs and configures eww
|
||||
#+BEGIN_SRC nix :tangle generated/modules/desktop/eww.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ lib, config, pkgs, flakeRoot, user, ... }:
|
||||
{ lib, pkgs, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
ewwConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/eww";
|
||||
# Dynamically read all files in assets/system/conf/eww/
|
||||
ewwConfs = lib.genAttrs (builtins.attrNames (builtins.readDir "${flakeRoot}/assets/system/conf/eww")) (name: {
|
||||
text = builtins.readFile "${flakeRoot}/assets/system/conf/eww/${name}";
|
||||
# --- 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
|
||||
{
|
||||
mySystem = {
|
||||
apps.wallpaper = {
|
||||
enable = true;
|
||||
packages = [ "eww" ]; # just symbolic names
|
||||
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.users.${user.username} = {
|
||||
home.file = {
|
||||
"${ewwConfigDir}" = {
|
||||
source = "${flakeRoot}/assets/system/conf/eww";
|
||||
recursive = true;
|
||||
# --- 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" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
EWW_BIN = "${pkgs.eww}/bin/eww";
|
||||
};
|
||||
|
||||
# Start eww with Hyprland/MangoWC
|
||||
wayland.windowManager.hyprland.settings = lib.mkForce {
|
||||
exec-once = [ "eww daemon" ];
|
||||
exec = [ "eww open-many ${ewwConfigDir}/widgets" ]; # Adjust as needed
|
||||
};
|
||||
};
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
@@ -1,35 +1,62 @@
|
||||
{ lib, config, pkgs, flakeRoot, user, ... }:
|
||||
{ lib, pkgs, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
ewwConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/eww";
|
||||
# Dynamically read all files in assets/system/conf/eww/
|
||||
ewwConfs = lib.genAttrs (builtins.attrNames (builtins.readDir "${flakeRoot}/assets/system/conf/eww")) (name: {
|
||||
text = builtins.readFile "${flakeRoot}/assets/system/conf/eww/${name}";
|
||||
# --- 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
|
||||
{
|
||||
mySystem = {
|
||||
apps.wallpaper = {
|
||||
enable = true;
|
||||
packages = [ "eww" ]; # just symbolic names
|
||||
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.users.${user.username} = {
|
||||
home.file = {
|
||||
"${ewwConfigDir}" = {
|
||||
source = "${flakeRoot}/assets/system/conf/eww";
|
||||
recursive = true;
|
||||
# --- 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" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
EWW_BIN = "${pkgs.eww}/bin/eww";
|
||||
};
|
||||
|
||||
# Start eww with Hyprland/MangoWC
|
||||
wayland.windowManager.hyprland.settings = lib.mkForce {
|
||||
exec-once = [ "eww daemon" ];
|
||||
exec = [ "eww open-many ${ewwConfigDir}/widgets" ]; # Adjust as needed
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user