refactor(niri): simplify config

This commit is contained in:
Moritz Böhme 2025-07-31 16:19:36 +02:00
parent 0018b0cd99
commit 461ac51552
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9

View file

@ -7,7 +7,7 @@
}: let
cfg = config.my.programs.niri;
inherit (config.home-manager.users.moritz.lib.niri) actions;
inherit (lib) mkEnableOption getExe mkIf mkPackageOption;
inherit (lib) mkEnableOption mkIf mkPackageOption;
in {
imports = [
inputs.niri.nixosModules.niri
@ -64,10 +64,7 @@ in {
enable = true;
# start using systemd service
systemd = {
enable = true;
target = "niri.service";
};
systemd.enable = true;
settings = {
mainBar = {
@ -89,8 +86,12 @@ in {
color = "000000";
};
};
systemd.user.services.waybar.Unit.After = ["graphical-session.target"];
systemd.user.services.swayidle.Unit.After = ["graphical-session.target"];
wayland.systemd.target = "niri.service";
systemd.user.services.waybar.Unit.After = [ "graphical-session.target" ];
systemd.user.services.swayidle.Unit.After = [ "graphical-session.target" ];
services.swayidle = {
enable = true;
events = [
@ -115,16 +116,14 @@ in {
command = "${pkgs.systemd}/bin/loginctl lock-session";
}
];
systemdTarget = "niri.service";
};
services.dunst.enable = true;
services.kanshi = {
enable = true;
systemdTarget = "niri.service";
};
services.kanshi.enable = true;
programs.niri = {
package = pkgs.niri;
settings = {
xwayland-satellite.path = lib.getExe inputs.niri.packages.${pkgs.system}.xwayland-satellite-unstable;
environment = {
"NIXOS_OZONE_WL" = "1";
"QT_QPA_PLATFORM" = "wayland";
@ -202,9 +201,6 @@ in {
"XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+" "-l" "1.0"];
"XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"];
};
environment = {
DISPLAY = ":0";
};
gestures.hot-corners.enable = false;
layout = {
border.enable = false;
@ -263,23 +259,6 @@ in {
};
};
systemd.user.services.xwayland-satellite = {
description = "Xwayland outside your Wayland";
after = ["graphical-session.target"];
wantedBy = ["graphical-session.target"];
partOf = ["graphical-session.target"];
bindsTo = ["graphical-session.target"];
requisite = ["graphical-session.target"];
serviceConfig = {
Type = "notify";
Restart = "always";
RestartSec = "1s";
ExecStart = "${getExe pkgs.xwayland-satellite}";
StandardOutput = "journal";
NotifyAccess = "all";
};
};
services = {
dbus.enable = true;
# use pipewire (needed for screensharing)