68 lines
1.9 KiB
Nix
68 lines
1.9 KiB
Nix
{ pkgs, lib, config, ... }:
|
|
let
|
|
# Same wallpaper niri displays (see home/dotfiles.nix).
|
|
wallpaper = ../../assets/wallpaper.png;
|
|
|
|
sddmTheme =
|
|
(pkgs.sddm-astronaut.override {
|
|
themeConfig = {
|
|
Background = "Backgrounds/wallpaper.png";
|
|
CropBackground = "true";
|
|
};
|
|
}).overrideAttrs
|
|
(old: {
|
|
postInstall = (old.postInstall or "") + ''
|
|
chmod u+w $out/share/sddm/themes/sddm-astronaut-theme/Backgrounds
|
|
install -Dm644 ${wallpaper} $out/share/sddm/themes/sddm-astronaut-theme/Backgrounds/wallpaper.png
|
|
'';
|
|
});
|
|
|
|
# Weston (the greeter compositor) must use the same modes as niri
|
|
# (home/config/niri/outputs.kdl), otherwise the monitors do a full
|
|
# modeset when niri takes over, causing a black screen on login.
|
|
xkb = config.services.xserver.xkb;
|
|
westonIni = (pkgs.formats.iniWithGlobalSection { }).generate "weston.ini" {
|
|
sections = {
|
|
libinput = {
|
|
enable-tap = config.services.libinput.mouse.tapping;
|
|
left-handed = config.services.libinput.mouse.leftHanded;
|
|
};
|
|
keyboard = {
|
|
keymap_model = xkb.model;
|
|
keymap_layout = xkb.layout;
|
|
keymap_variant = xkb.variant;
|
|
keymap_options = xkb.options;
|
|
};
|
|
};
|
|
};
|
|
westonOutputs = pkgs.writeText "weston-outputs.ini" ''
|
|
[output]
|
|
name=DP-2
|
|
mode=2560x1440@240
|
|
|
|
[output]
|
|
name=DP-3
|
|
mode=1920x1080@144
|
|
transform=rotate-90
|
|
'';
|
|
westonConfig = pkgs.runCommand "weston.ini" { } ''
|
|
cat ${westonIni} > $out
|
|
echo >> $out
|
|
cat ${westonOutputs} >> $out
|
|
'';
|
|
in
|
|
{
|
|
services.displayManager.sddm = {
|
|
enable = true;
|
|
wayland = {
|
|
enable = true;
|
|
compositorCommand = "${lib.getExe pkgs.weston} --shell=kiosk -c ${westonConfig}";
|
|
};
|
|
package = pkgs.kdePackages.sddm;
|
|
theme = "sddm-astronaut-theme";
|
|
extraPackages = [ sddmTheme ];
|
|
};
|
|
|
|
environment.systemPackages = [ sddmTheme ];
|
|
}
|