New structure since I kept struggling with the home-manager implemnentation

This commit is contained in:
2026-03-18 15:05:33 +00:00
parent 86c3f52851
commit 084cd4c0f1
86 changed files with 507 additions and 4509 deletions
@@ -0,0 +1,30 @@
{ lib, config, pkgs, flakeRoot, user, ... }:
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}";
});
in
{
environment.systemPackages = with pkgs; [ eww ];
home-manager.users.${user.username} = {
home.file = {
"${ewwConfigDir}" = {
source = "${flakeRoot}/assets/system/conf/eww";
recursive = true;
};
};
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
};
};
}
@@ -0,0 +1,6 @@
{ config, pkgs, ... }:
{
fonts.packages = with pkgs; [
pkgs.nerd-fonts.iosevka
];
}
@@ -0,0 +1,43 @@
{
config,
pkgs,
lib,
user,
flakeRoot,
...
}:
let
hyprlandFiles = builtins.attrNames (builtins.readDir "${flakeRoot}/assets/hyprland/conf/hypr");
# Filter out hyprland.conf from the list of files to symlink
otherHyprlandFiles = lib.filter (name: name != "hyprland.conf") hyprlandFiles;
# Generate xdg.configFile entries for all files except hyprland.conf
otherConfigs = lib.genAttrs otherHyprlandFiles (name: {
target = "hypr/${name}";
source = "${flakeRoot}/assets/hyprland/conf/hypr/${name}";
});
in
{
programs.hyprland = {
enable = true;
};
home-manager.users.${user.username} = {
home.stateVersion = "25.11";
home.username = user.username;
home.homeDirectory =
config.home-manager.users.${user.username}.homeDirectory or "/home/${user.username}";
wayland.windowManager.hyprland = {
enable = true;
settings.general."col.active_border" = lib.mkForce "0xff97cbcd 0xff89b4fa";
};
xdg.configFile = otherConfigs // {
"hypr/hyprland.conf".text = ''
${builtins.readFile "${flakeRoot}/assets/hyprland/conf/hypr/hyprland.conf"}
'';
"hypr/.keep".text = "";
};
};
}
@@ -0,0 +1,25 @@
{ config, pkgs, lib, flakeRoot, ... }:
let
# Pad naar de wallpaper config in de flake
wallpaperConf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.toml";
in
{
# Installeer wpaperd voor de gebruiker
home.packages = [ pkgs.wpaperd ];
# Plaats wallpaper.toml automatisch in $HOME/.config/wpaperd
home.file.".config/wpaperd/wallpaper.toml".source = wallpaperConf;
# Systemd user service
systemd.user.services.wpaperd = {
description = "wpaperd wallpaper daemon";
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.wpaperd}/bin/wpaperd --config ${config.home.homeDirectory}/.config/wpaperd/wallpaper.toml";
Restart = "on-failure";
RestartSec = 1;
};
};
}
@@ -0,0 +1,33 @@
{ lib, pkgs, config, flakeRoot, ... }:
let
username = "henrov";
waybar-config = pkgs.writeText "waybar-config" (builtins.readFile (flakeRoot + "/assets/system/conf/waybar/config"));
waybar-style = pkgs.writeText "waybar-style" (builtins.readFile (flakeRoot + "/assets/system/conf/waybar/style.css"));
in
{
programs.waybar = {
enable = true;
package = pkgs.waybar;
};
systemd.user.services.waybar = {
description = "Waybar (status bar for Wayland)";
wantedBy = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${config.programs.waybar.package}/bin/waybar -c ${waybar-config} -s ${waybar-style}";
Restart = "on-failure";
RestartSec = "5s";
};
};
# Create symlinks for config and style
system.activationScripts.waybarSetup = lib.mkAfter ''
mkdir -p /home/${username}/.config/waybar
ln -sf ${waybar-config} /home/${username}/.config/waybar/config
ln -sf ${waybar-style} /home/${username}/.config/waybar/style.css
chown -R ${username}:users /home/${username}/.config/waybar
'';
}
@@ -0,0 +1,16 @@
{ config, pkgs, lib, user, ... }:
{
home-manager.users.${user.username} = {
xdg.portal = {
enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-hyprland ];
config.hyprland = {
"org.freedesktop.impl.portal.Screencast" = [ "hyprland" ];
};
};
home.packages = with pkgs; [
uwsm
];
};
}