64 lines
1.4 KiB
Nix
64 lines
1.4 KiB
Nix
{ 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 ---
|
|
mySystem.${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
|
|
];
|
|
};
|
|
};
|
|
}
|