nixos/home/modules/programs/niri.nix

78 lines
1.7 KiB
Nix
Raw Normal View History

{
pkgs,
config,
lib,
osConfig ? null,
...
}:
let
cfg = config.youthlic.programs.niri;
niri = osConfig.programs.niri.package;
in
{
options = {
youthlic.programs.niri = {
enable = lib.mkEnableOption "niri";
config = lib.mkOption {
type = lib.types.path;
example = ./config.kdl;
description = ''
the pach to config.kdl
'';
};
};
};
config = lib.mkIf cfg.enable {
home.packages =
(with pkgs; [
swaynotificationcenter
swaybg
xwayland-satellite
kdePackages.polkit-kde-agent-1
wl-clipboard
cliphist
])
++ [ niri ];
2025-03-10 00:24:32 +08:00
qt = {
enable = true;
};
xdg.portal = {
configPackages = [ niri ];
2025-03-10 00:24:32 +08:00
enable = true;
extraPortals = lib.mkIf (
!niri.cargoBuildNoDefaultFeatures || builtins.elem "xdp-gnome-screencast" niri.cargoBuildFeatures
2025-03-10 00:24:32 +08:00
) [ pkgs.xdg-desktop-portal-gnome ];
};
xdg.configFile =
let
qtctConf =
''
[Appearance]
standard_dialogs=xdgdesktopportal
''
+ lib.optionalString (config.qt.style ? name) ''
style=${config.qt.style.name}
'';
in
{
"qt5ct/qt5ct.conf" = lib.mkForce {
text = qtctConf;
};
"qt6ct/qt6ct.conf" = lib.mkForce {
text = qtctConf;
};
};
youthlic.programs = {
fuzzel.enable = true;
wluma.enable = true;
waybar.enable = true;
2025-01-25 12:18:41 +08:00
swaync.enable = true;
2025-01-25 16:31:58 +08:00
swaylock.enable = true;
};
programs.niri = {
config = builtins.readFile cfg.config;
package = niri;
};
};
}