1 parent
80ec3dfdd3
commit
079cceb554
57 files changed
+4092
-538
No files matched your search
@@ -1,11 +1,12 @@
|
||||
# Hyprland desktop, both halves of one feature:
|
||||
# NixOS UWSM-managed compositor, SDDM with autologin of the owner,
|
||||
# portals, keyring and the small services a desktop needs.
|
||||
# NixOS UWSM-managed compositor, portals, keyring and the small
|
||||
# services a desktop needs.
|
||||
# home-manager the user configuration. Hyprland reads Lua: the real config
|
||||
# is in the .lua files next to this file; Nix only passes in the
|
||||
# values that come from elsewhere (`require("nixvars")`).
|
||||
# The NixOS half adds the home-manager half to the owner, so a host imports
|
||||
# `nixos.hyprland` once. Noctalia, audio and fonts are separate aspects.
|
||||
# `nixos.hyprland` once. The display manager (sddm), Noctalia, audio and fonts
|
||||
# are separate aspects.
|
||||
{ config, ... }:
|
||||
let
|
||||
inherit (config.meta) owner;
|
||||
@@ -24,15 +25,6 @@ in
|
||||
xwayland.enable = true;
|
||||
};
|
||||
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
settings.Autologin = {
|
||||
Session = "hyprland.desktop";
|
||||
User = owner.name;
|
||||
};
|
||||
};
|
||||
|
||||
xdg.portal.extraPortals = [
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
pkgs.xdg-desktop-portal-hyprland
|
||||
@@ -44,9 +36,6 @@ in
|
||||
|
||||
programs.dconf.enable = true;
|
||||
|
||||
# Electron/Chromium apps use native Wayland.
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
# Removable drives and trash/mounts in the file manager.
|
||||
services.udisks2.enable = true;
|
||||
services.gvfs.enable = true;
|
||||
@@ -89,9 +78,29 @@ in
|
||||
kbOptions = osConfig.services.xserver.xkb.options;
|
||||
terminal = "wezterm";
|
||||
fileManager = "dolphin";
|
||||
# Binds start apps through this, so each runs as its own scope of the
|
||||
# session (app-graphical.slice) and is stopped before the compositor at
|
||||
# logout, instead of living inside Hyprland's unit.
|
||||
appLauncher = "${lib.getExe' osConfig.programs.uwsm.package "uwsm-app"} --";
|
||||
cursorSize = if cursor.enable then cursor.size else 24;
|
||||
cursorTheme = if cursor.enable then cursor.name else "";
|
||||
};
|
||||
|
||||
# The only place these are defined. UWSM sources uwsm/env-<desktop>
|
||||
# (lowercased XDG_CURRENT_DESKTOP) before the compositor starts and puts
|
||||
# the result into the systemd and D-Bus activation environments, so every
|
||||
# app of the Hyprland session sees them, and nothing outside it does.
|
||||
waylandEnv = {
|
||||
# Electron/Chromium apps use native Wayland.
|
||||
NIXOS_OZONE_WL = "1";
|
||||
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
||||
GDK_BACKEND = "wayland,x11,*";
|
||||
QT_QPA_PLATFORM = "wayland;xcb";
|
||||
# Falls back to X11 when an SDL app has no Wayland support, but some
|
||||
# older SDL games still break with it (set SDL_VIDEODRIVER=x11 for those).
|
||||
SDL_VIDEODRIVER = "wayland,x11";
|
||||
CLUTTER_BACKEND = "wayland";
|
||||
};
|
||||
in
|
||||
{
|
||||
wayland.windowManager.hyprland = {
|
||||
@@ -123,6 +132,26 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
xdg.configFile."uwsm/env-hyprland".text = lib.concatLines (
|
||||
lib.mapAttrsToList (name: value: "export ${name}=${lib.escapeShellArg value}") waylandEnv
|
||||
);
|
||||
|
||||
# Home-manager's session variables (hm-session-vars.sh) reach shells only.
|
||||
# The compositor, and so the binds, and the user services (Noctalia, and
|
||||
# so the launcher) inherit the systemd user manager's environment instead,
|
||||
# which systemd.user.sessionVariables (environment.d) feeds. Of the
|
||||
# variables home-manager sets, the editor is the one programs outside a
|
||||
# shell look for. Taken from home.sessionVariables, so the neovim aspect
|
||||
# stays the only place that defines them (and nothing breaks when it is
|
||||
# not imported). They apply from the next login.
|
||||
systemd.user.sessionVariables = lib.filterAttrs (
|
||||
name: _:
|
||||
builtins.elem name [
|
||||
"EDITOR"
|
||||
"VISUAL"
|
||||
]
|
||||
) config.home.sessionVariables;
|
||||
|
||||
# Tools the binds call (screenshots, file manager).
|
||||
home.packages = with pkgs; [
|
||||
grim
|
||||
|
||||
Reference in new issue
Block a user