mirror of
https://codeberg.org/muon/home.git
synced 2026-03-08 03:25:16 +00:00
54 lines
1.3 KiB
Nix
54 lines
1.3 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}: let
|
|
monitorModule = lib.types.submodule {
|
|
options = {
|
|
name = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "monitor name";
|
|
example = "HDMI-1";
|
|
};
|
|
config = lib.mkOption {
|
|
type = lib.types.attrs;
|
|
description = "autorandr profile config";
|
|
};
|
|
};
|
|
};
|
|
in {
|
|
options.mods = {
|
|
xorg.enable = lib.mkEnableOption "enables xorg";
|
|
monitors = lib.mkOption {
|
|
type = lib.types.attrsOf monitorModule;
|
|
default = {};
|
|
};
|
|
};
|
|
|
|
config = let
|
|
startupTargets = [
|
|
"systemd-user-sessions.service"
|
|
"multi-user.target"
|
|
"network-online.target"
|
|
];
|
|
in
|
|
lib.mkIf config.mods.xorg.enable {
|
|
services.xserver.enable = true;
|
|
services.xserver.xkb = {
|
|
layout = "us";
|
|
variant = "altgr-intl";
|
|
options = "caps:escape";
|
|
};
|
|
services.xserver.dpi = 96;
|
|
|
|
# services.xserver.displayManager.gdm.enable = true;
|
|
services.displayManager.sddm.enable = true;
|
|
services.displayManager.sddm.enableHidpi = false;
|
|
services.displayManager.autoLogin.enable = true;
|
|
services.displayManager.autoLogin.user = config.mods.user.name;
|
|
|
|
systemd.services.display-manager.wants = startupTargets;
|
|
systemd.services.display-manager.after = startupTargets;
|
|
};
|
|
}
|