Compare commits
2 Commits
a0fe8baf72
...
c3b2799155
| Author | SHA1 | Date | |
|---|---|---|---|
| c3b2799155 | |||
| b848963be6 |
+49
-22
@@ -1071,39 +1071,66 @@ settings = {
|
|||||||
** =generated/modules/desktop/wayland.nix=
|
** =generated/modules/desktop/wayland.nix=
|
||||||
This file sets up wayland
|
This file sets up wayland
|
||||||
#+BEGIN_SRC nix :tangle generated/modules/desktop/wayland.nix :noweb tangle :mkdirp yes :eval never-html
|
#+BEGIN_SRC nix :tangle generated/modules/desktop/wayland.nix :noweb tangle :mkdirp yes :eval never-html
|
||||||
{ lib, ... }:
|
{ 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
|
||||||
{
|
{
|
||||||
flake.nixosModules.wayland = { config, pkgs, lib, ... }:
|
# --- Option ---
|
||||||
|
options.enableWayland =
|
||||||
|
lib.mkEnableOption "Enable Wayland + portals";
|
||||||
|
|
||||||
let
|
# --- Config ---
|
||||||
username = "henrov"; # <-- simpel en stabiel
|
config = lib.mkIf enableProgram {
|
||||||
in
|
|
||||||
{
|
|
||||||
options.mySystem.desktop.wayland.enable =
|
|
||||||
lib.mkEnableOption "Enable Wayland + portals";
|
|
||||||
|
|
||||||
config = lib.mkIf (config.mySystem.desktop.wayland.enable or false) {
|
# --- Dendritic app definition ---
|
||||||
|
myApps.${programName} = {
|
||||||
|
enable = true;
|
||||||
|
assetsDir = programAssets;
|
||||||
|
files = files;
|
||||||
|
inherit user;
|
||||||
|
|
||||||
home-manager.users.${username} = {
|
# Wayland-specific metadata
|
||||||
|
portals = [ "hyprland" ];
|
||||||
|
};
|
||||||
|
|
||||||
xdg.portal = {
|
# --- Actual system wiring ---
|
||||||
enable = true;
|
home-manager.users.${user} = {
|
||||||
|
|
||||||
extraPortals = with pkgs; [
|
xdg.portal = {
|
||||||
xdg-desktop-portal-hyprland
|
enable = true;
|
||||||
];
|
|
||||||
|
|
||||||
config.hyprland = {
|
# pkgs is unavoidable here (real package dependency)
|
||||||
"org.freedesktop.impl.portal.Screencast" = [ "hyprland" ];
|
extraPortals = [
|
||||||
};
|
config.pkgs.xdg-desktop-portal-hyprland
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
uwsm
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
config.hyprland = {
|
||||||
|
"org.freedesktop.impl.portal.Screencast" = [ "hyprland" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.packages = [
|
||||||
|
config.pkgs.uwsm
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,63 @@
|
|||||||
{ lib, ... }:
|
{ 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
|
||||||
{
|
{
|
||||||
flake.nixosModules.wayland = { config, pkgs, lib, ... }:
|
# --- Option ---
|
||||||
|
options.enableWayland =
|
||||||
|
lib.mkEnableOption "Enable Wayland + portals";
|
||||||
|
|
||||||
let
|
# --- Config ---
|
||||||
username = "henrov"; # <-- simpel en stabiel
|
config = lib.mkIf enableProgram {
|
||||||
in
|
|
||||||
{
|
|
||||||
options.mySystem.desktop.wayland.enable =
|
|
||||||
lib.mkEnableOption "Enable Wayland + portals";
|
|
||||||
|
|
||||||
config = lib.mkIf (config.mySystem.desktop.wayland.enable or false) {
|
# --- Dendritic app definition ---
|
||||||
|
myApps.${programName} = {
|
||||||
|
enable = true;
|
||||||
|
assetsDir = programAssets;
|
||||||
|
files = files;
|
||||||
|
inherit user;
|
||||||
|
|
||||||
home-manager.users.${username} = {
|
# Wayland-specific metadata
|
||||||
|
portals = [ "hyprland" ];
|
||||||
|
};
|
||||||
|
|
||||||
xdg.portal = {
|
# --- Actual system wiring ---
|
||||||
enable = true;
|
home-manager.users.${user} = {
|
||||||
|
|
||||||
extraPortals = with pkgs; [
|
xdg.portal = {
|
||||||
xdg-desktop-portal-hyprland
|
enable = true;
|
||||||
];
|
|
||||||
|
|
||||||
config.hyprland = {
|
# pkgs is unavoidable here (real package dependency)
|
||||||
"org.freedesktop.impl.portal.Screencast" = [ "hyprland" ];
|
extraPortals = [
|
||||||
};
|
config.pkgs.xdg-desktop-portal-hyprland
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
uwsm
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
config.hyprland = {
|
||||||
|
"org.freedesktop.impl.portal.Screencast" = [ "hyprland" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.packages = [
|
||||||
|
config.pkgs.uwsm
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user