feat(mibook): boot to terminal, launch KDE on demand
Add my.profiles.kde-desktop.startOnBoot (default true, no change for existing consumers). When false, boot to multi-user.target, keep SDDM out of any boot target's wants, and provide a 'desktop' command that starts the display manager on demand. Enable this on mibook. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CfozKLQdUh5TzqyjSigLUx
This commit is contained in:
@@ -6,6 +6,7 @@ in
|
|||||||
{
|
{
|
||||||
my.profiles = {
|
my.profiles = {
|
||||||
kde-desktop.enable = true;
|
kde-desktop.enable = true;
|
||||||
|
kde-desktop.startOnBoot = false;
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
apps = {
|
apps = {
|
||||||
desktop_apps = true;
|
desktop_apps = true;
|
||||||
|
|||||||
@@ -11,9 +11,19 @@ in
|
|||||||
{
|
{
|
||||||
options.my.profiles.kde-desktop = with lib; {
|
options.my.profiles.kde-desktop = with lib; {
|
||||||
enable = mkEnableOption "KDE Desktop Environment";
|
enable = mkEnableOption "KDE Desktop Environment";
|
||||||
|
startOnBoot = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether the display manager (SDDM) starts automatically at boot.
|
||||||
|
When false, the system boots to a text console and KDE can be
|
||||||
|
launched on demand with the `desktop` command.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||||
|
{
|
||||||
services = {
|
services = {
|
||||||
displayManager.sddm.enable = true;
|
displayManager.sddm.enable = true;
|
||||||
displayManager.sddm.wayland.enable = true;
|
displayManager.sddm.wayland.enable = true;
|
||||||
@@ -23,5 +33,15 @@ in
|
|||||||
# Programms can be added here...
|
# Programms can be added here...
|
||||||
numix-icon-theme
|
numix-icon-theme
|
||||||
];
|
];
|
||||||
};
|
}
|
||||||
|
(lib.mkIf (!cfg.startOnBoot) {
|
||||||
|
# Boot to a text console; SDDM stays installed but is not pulled in
|
||||||
|
# by any boot target. Launch KDE on demand with `desktop`.
|
||||||
|
systemd.services.display-manager.wantedBy = lib.mkForce [ ];
|
||||||
|
systemd.defaultUnit = lib.mkForce "multi-user.target";
|
||||||
|
environment.systemPackages = [
|
||||||
|
(pkgs.writeShellScriptBin "desktop" "exec sudo systemctl start display-manager.service")
|
||||||
|
];
|
||||||
|
})
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user