user services + wm in hjr, some qs workaround

This commit is contained in:
atagen 2025-10-29 12:27:35 +11:00
parent 9e3aa574eb
commit cb44e16d76
19 changed files with 393 additions and 361 deletions

View file

@ -0,0 +1,55 @@
input {
keyboard {
xkb {
layout ""
model ""
rules ""
variant ""
}
repeat-delay 600
repeat-rate 25
track-layout "global"
}
mouse {
accel-profile "flat"
}
warp-mouse-to-focus
focus-follows-mouse
}
screenshot-path "~/screenshots/%Y-%m-%d_%H-%M-%S.png"
prefer-no-csd
layout {
gaps %GAPS%
struts {
left 0
right 0
top 0
bottom 0
}
focus-ring {
width %BORDER%
active-color "%ACTIVE%"
inactive-color "%INACTIVE%"
}
border { off; }
default-column-width { proportion 0.500000; }
preset-column-widths {
proportion 0.666667
proportion 0.500000
proportion 0.333333
}
center-focused-column "never"
always-center-single-column
}
cursor {
xcursor-theme "%CURSOR%"
xcursor-size 16
hide-when-typing
hide-after-inactive-ms 5000
}
hotkey-overlay { skip-at-startup; }
window-rule {
geometry-corner-radius 0.000000 %ROUNDING%.000000 0.000000 %ROUNDING%.000000
clip-to-geometry true
}
xwayland-satellite { path "%SATELLITE%"; }

View file

@ -6,7 +6,7 @@ import Quickshell.Io
Singleton {
id: data
property var tags: {}
property var tags: ({})
property var keys: []
Timer {
id: reconnectTimer

View file

@ -0,0 +1,43 @@
{
pkgs,
lib,
inputs,
mainUser,
getPkgs,
getFlakePkg',
...
}:
let
inherit (lib) getExe getExe';
stable = inputs.nixpkgs-stable;
inherit (stable.legacyPackages.x86_64-linux) quickshell;
in
{
user.packages = getPkgs {
# quickshell stuff
inherit (pkgs.kdePackages) qtbase qtdeclarative;
inherit (pkgs) wl-clipboard;
inherit quickshell;
};
quick.services = {
swaync = "${getExe pkgs.swaynotificationcenter}";
quickshell = "${getExe quickshell}";
swayidle =
let
niri = getFlakePkg' inputs.niri "niri-unstable";
systemctl = getExe' pkgs.systemd "systemctl";
in
''
${lib.getExe pkgs.swayidle} -w \
timeout 1800 '${systemctl} suspend' \
timeout 600 '${niri} msg action power-off-monitors'
'';
};
environment.files."/home/${mainUser}/.config/quickshell" = {
source = "/home/${mainUser}/.nix/graphical/desktop/quickshell";
uid = 1000;
gid = 100;
};
}

74
graphical/desktop/wm.nix Normal file
View file

@ -0,0 +1,74 @@
{
mainUser,
inputs,
getFlakePkg',
lib,
config,
...
}:
let
niri = (getFlakePkg' inputs.niri "niri-unstable");
xwayland-satellite = (getFlakePkg' inputs.niri "xwayland-satellite-unstable");
inherit (config) rice;
in
{
imports = [
inputs.niri.nixosModules.niri
inputs.niri-tag.nixosModules.niri-tag
];
user.desktops.niri = {
enable = true;
config =
let
template = builtins.readFile ./niri.kdl;
baseConfig =
with rice;
lib.replaceStrings
[
"%CURSOR%"
"%ROUNDING%"
"%GAPS%"
"%BORDER%"
"%ACTIVE%"
"%INACTIVE%"
"%SATELLITE%"
]
[
cursor.name
(toString borders.rounding)
(toString borders.gaps)
(toString borders.thickness)
palette.shortHex.bright.yellow
palette.shortHex.normal.yellow
(lib.getExe xwayland-satellite)
]
template;
in
baseConfig;
};
user.packages = [
niri
xwayland-satellite
];
services.greetd = {
enable = true;
restart = false;
settings =
let
session = {
command = "niri-session";
user = "${mainUser}";
};
in
{
default_session = session;
initial_session = session;
};
};
programs.niri = {
enable = true;
package = niri;
};
services.niri-tag.enable = true;
}