feature(niri): Init module

This commit is contained in:
DashieTM 2025-10-05 13:24:30 +02:00
parent 9be8a82a29
commit 1857504bac
13 changed files with 1446 additions and 254 deletions

View file

@ -18,7 +18,10 @@
'';
};
monitor = lib.mkOption {
default = "${config.mods.hypr.hyprland.defaultMonitor}";
default =
if config.mods.wm.monitors != []
then (builtins.elemAt config.mods.wm.monitors 0).name
else "";
example = "eDP-1";
type = lib.types.str;
description = ''
@ -27,7 +30,10 @@
'';
};
scale = lib.mkOption {
default = "${config.mods.hypr.hyprland.defaultMonitorScale}";
default =
if config.mods.wm.monitors != []
then builtins.toString (builtins.elemAt config.mods.wm.monitors 0).scale
else "";
example = "1.5";
type = lib.types.str;
description = ''
@ -46,7 +52,14 @@
description = "The compositor/greeter command to run";
};
resolution = lib.mkOption {
default = "${config.mods.hypr.hyprland.defaultMonitorMode}";
default =
if config.mods.wm.monitors != []
then let
resX = builtins.toString (builtins.elemAt config.mods.wm.monitors 0).resolutionX;
resY = builtins.toString (builtins.elemAt config.mods.wm.monitors 0).resolutionY;
refresh = builtins.toString (builtins.elemAt config.mods.wm.monitors 0).refreshrate;
in "${resX}x${resY}@${refresh}"
else "";
example = "3440x1440@180";
type = lib.types.str;
description = ''
@ -55,7 +68,8 @@
};
environments = lib.mkOption {
default = [
inputs.hyprland.packages.${config.conf.system}.hyprland
(lib.mkIf config.mods.hypr.hyprland.enable inputs.hyprland.packages.${config.conf.system}.hyprland)
(lib.mkIf config.mods.niri.enable pkgs.niri)
];
# no idea if these are written correctly
example = [
@ -82,7 +96,7 @@
};
config = let
username = config.conf.username;
inherit (config.conf) username;
in
lib.mkIf config.mods.greetd.enable (
lib.optionalAttrs (options ? environment) {