complete rework v3

This commit is contained in:
Nickolaj Jepsen 2025-02-18 20:17:57 +01:00
parent 7409e9ca10
commit 366a0e221a
131 changed files with 20171 additions and 585 deletions

View file

@ -3,18 +3,20 @@
config,
...
}:
with lib; {
imports = [
./hyprpolkitagent.nix
];
with lib; let
cfg = config.fireproof;
mkKeyboard = name: {
inherit name;
kb_layout = "eu";
};
in {
config = {
assertions = [
{
message = "The terminal must be set to enable Hyprland";
assertion = config.defaults.terminal != null;
}
];
# assertions = [
# {
# message = "The terminal must be set to enable Hyprland";
# assertion = config.defaults.terminal != null;
# }
# ];
programs.uwsm.enable = true;
programs.hyprland = {
@ -35,33 +37,56 @@ with lib; {
environment.sessionVariables.NIXOS_OZONE_WL = "1";
user.home-manager = {
fireproof.home-manager = {
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
systemd.enable = false; # Conficts with UWSM
settings = {
monitor = map (
m: let
name =
if m.name != null
then m.name
else "";
resolution =
if m.resolution != null
then m.resolution
else "preferred";
refreshRate =
if m.refreshRate != null
then "@${m.refreshRate}"
else "";
position =
if m.position != null
then m.position
else "auto";
in "${name}, ${resolution}${refreshRate}, ${position}, 1"
) [config.monitor.primary];
monitor =
map (
m: let
name =
if m.name != null
then m.name
else "";
resolution =
if m.resolution != null
then m.resolution
else "preferred";
refreshRate =
if m.refreshRate != null
then "@${builtins.toString m.refreshRate}"
else "";
position =
if m.position != null
then m.position
else "auto";
in "${name}, ${resolution}${refreshRate}, ${position}, 1"
)
config.monitors;
input = {
# Most unknown keyboards will be of the DK layout, we set known keyboards to eu in `devices`
kb_layout = "dk";
kb_options = "caps:backspace";
# Cursor focus will be detached from keyboard focus. Clicking on a window will move keyboard focus to that window.
follow_mouse = 2;
touchpad = {
natural_scroll = false;
};
};
# Names can be found with:
# $ hyprctl devices -j | jq '.["keyboards"].[].name' -r | grep -vE "(system|consumer)-control"
device = map mkKeyboard [
"splitkb-kyria-rev1"
"zsa-technology-labs-inc-ergodox-ez-shine"
"zsa-technology-labs-inc-ergodox-ez-shine-keyboard"
];
general = {
gaps_in = 5;
@ -109,9 +134,9 @@ with lib; {
use_active_for_splits = true;
};
bind = [
"SUPER, RETURN, exec, ${getExe config.programs.uwsm.package} app -- ${config.defaults.terminal}"
"SUPER, RETURN, exec, ${getExe config.programs.uwsm.package} app -- ${cfg.default-apps.terminal}"
"SUPER, BACKSPACE, killactive"
# "SUPER, SPACE, exec, uwsm app -- walker"
"SUPER, SPACE, exec, ${getExe config.programs.uwsm.package} app -- walker"
# "SUPER SHIFT, SPACE, exec, uwsm app -- walker --modules applications"
"SUPER, p, exec, ${getExe config.programs.uwsm.package} app -- loginctl lock-session"
"SUPER, S, togglefloating"

View file

@ -1,6 +1,10 @@
{pkgs, ...}: {
{
pkgs,
config,
...
}: {
config = {
user.home-manager.systemd.user.services.hyprpolkitagent = {
fireproof.home-manager.systemd.user.services.hyprpolkitagent = {
Unit = {
Description = "Hyprland Polkit Authentication Agent";
};