mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
45 lines
1.2 KiB
Nix
45 lines
1.2 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";
|
|
services.xserver.xkb.options = "caps:escape";
|
|
|
|
# services.xserver.displayManager.gdm.enable = true;
|
|
services.xserver.displayManager.sddm.enable = true;
|
|
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;
|
|
};
|
|
}
|