deleted generated files
This commit is contained in:
+65
-33
@@ -641,56 +641,88 @@ Finally, it creates a systemd user service (wpaperd.service) that automatically
|
||||
** =generated/modules/desktop/hyprland.nix=
|
||||
Setting up Hyprland
|
||||
#+BEGIN_SRC nix :tangle generated/modules/desktop/hyprland.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ lib, pkgs, flakeRoot, ... }:
|
||||
{ lib, config, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
# --- Define user locally ---
|
||||
username = "henrov";
|
||||
# --- Program definition ---
|
||||
programName = "hyprland";
|
||||
|
||||
# --- Hyprland conf directory ---
|
||||
hyprConfDir = "${flakeRoot}/assets/hyprland/conf/hypr";
|
||||
# --- Assets ---
|
||||
programAssets = "${flakeRoot}/assets/hyprland/conf/hypr";
|
||||
|
||||
# --- Read files ---
|
||||
hyprlandFiles = builtins.attrNames (builtins.readDir hyprConfDir);
|
||||
programFiles =
|
||||
if builtins.pathExists programAssets
|
||||
then builtins.readDir programAssets
|
||||
else {};
|
||||
|
||||
# --- Exclude main hyprland.conf from automatic symlinks ---
|
||||
otherHyprlandFiles = lib.filter (name: name != "hyprland.conf") hyprlandFiles;
|
||||
fileNames = builtins.attrNames programFiles;
|
||||
|
||||
# --- Generate xdg.configFile entries for the other files ---
|
||||
otherConfigs = lib.genAttrs otherHyprlandFiles (name: {
|
||||
target = "hypr/${name}";
|
||||
source = "${hyprConfDir}/${name}";
|
||||
# Exclude main config (handled separately)
|
||||
otherFiles = lib.filter (name: name != "hyprland.conf") fileNames;
|
||||
|
||||
# Generate file mappings
|
||||
files = lib.genAttrs otherFiles (name: {
|
||||
src = "${programAssets}/${name}";
|
||||
});
|
||||
|
||||
# --- Add main hyprland.conf separately ---
|
||||
hyprlandConf = {
|
||||
"hypr/hyprland.conf".text = builtins.readFile "${hyprConfDir}/hyprland.conf";
|
||||
"hypr/.keep".text = "";
|
||||
};
|
||||
# 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
|
||||
{
|
||||
flake.nixosModules.hyprland = { config, pkgs, lib, ... }:
|
||||
# --- Option ---
|
||||
options.enableHyprland =
|
||||
lib.mkEnableOption "Enable Hyprland desktop";
|
||||
|
||||
{
|
||||
options.mySystem.desktop.hyprland.enable =
|
||||
lib.mkEnableOption "Enable Hyprland Desktop";
|
||||
# --- Config ---
|
||||
config = lib.mkIf enableProgram {
|
||||
|
||||
config = lib.mkIf (config.mySystem.desktop.hyprland.enable or false) {
|
||||
# --- Dendritic app definition ---
|
||||
myApps.${programName} = {
|
||||
enable = true;
|
||||
assetsDir = programAssets;
|
||||
files = files;
|
||||
inherit user;
|
||||
|
||||
programs.hyprland.enable = true;
|
||||
compositor = "hyprland";
|
||||
};
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home.stateVersion = "25.11";
|
||||
home.username = username;
|
||||
home.homeDirectory = "/home/${username}";
|
||||
# --- System-level enable ---
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
settings.general."col.active_border" = lib.mkForce "0xff97cbcd 0xff89b4fa";
|
||||
};
|
||||
# --- Home Manager wiring ---
|
||||
home-manager.users.${user} = {
|
||||
|
||||
xdg.configFile = otherConfigs // hyprlandConf;
|
||||
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 = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user