Add niri for yoga

This commit is contained in:
Natsu Kagami 2025-01-16 16:11:27 +01:00
parent 0103e72ee6
commit c00150dd95
Signed by: nki
GPG key ID: 55A032EB38B49ADB

View file

@ -1,5 +1,20 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, ... }:
let
iio-sway = pkgs.stdenv.mkDerivation {
name = "iio-sway";
version = "0.0.1";
src = pkgs.fetchFromGitHub {
owner = "okeri";
repo = "iio-sway";
rev = "e07477d1b2478fede1446e97424a94c80767819d";
hash = "sha256-JGacKajslCOvd/BFfFSf7s1/hgF6rJqJ6H6xNnsuMb4=";
};
buildInputs = with pkgs; [ dbus ];
nativeBuildInputs = with pkgs; [ meson ninja pkg-config ];
meta.mainProgram = "iio-sway";
};
in
{ {
imports = [ imports = [
# Common configuration # Common configuration
@ -49,25 +64,23 @@
startup = [ startup = [
# rotation # rotation
( { command = "${lib.getExe iio-sway}"; }
let
iio-sway = pkgs.stdenv.mkDerivation {
name = "iio-sway";
version = "0.0.1";
src = pkgs.fetchFromGitHub {
owner = "okeri";
repo = "iio-sway";
rev = "e07477d1b2478fede1446e97424a94c80767819d";
hash = "sha256-JGacKajslCOvd/BFfFSf7s1/hgF6rJqJ6H6xNnsuMb4=";
};
buildInputs = with pkgs; [ dbus ];
nativeBuildInputs = with pkgs; [ meson ninja pkg-config ];
};
in
{ command = "${iio-sway}/bin/iio-sway"; }
)
]; ];
}; };
programs.my-niri.enable = true;
programs.niri.settings = {
# input.keyboard.xkb.options = "ctrl:swapcaps";
input.mouse = lib.mkForce {
# Make M575 fast for now
accel-profile = "adaptive";
accel-speed = 0.4;
};
input.touch.map-to-output = "eDP-1";
switch-events = with config.lib.niri.actions; {
tablet-mode-on.action = spawn "systemctl" "--user" "kill" "--signal" "SIGUSR2" "wvkbd";
tablet-mode-off.action = spawn "systemctl" "--user" "kill" "--signal" "SIGUSR1" "wvkbd";
};
};
## Virtual keyboard ## Virtual keyboard
systemd.user.services.wvkbd = { systemd.user.services.wvkbd = {
Unit = { Unit = {
@ -99,7 +112,7 @@
settings = [ settings = [
{ {
profile.name = "undocked"; profile.name = "undocked";
profile.outputs = [{ criteria = "LVDS-1"; }]; profile.outputs = [{ criteria = "eDP-1"; }];
} }
{ {
profile.name = "work-both"; profile.name = "work-both";