mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-31 14:41:27 +00:00
nixos/tools: generate an xserver config
The desktop configuration won't enable xserver. If there's multiple desktops enabled they will now evaluate properly.
This commit is contained in:
parent
94f0210e60
commit
452f7e14d4
@ -585,6 +585,22 @@ EOF
|
||||
return $config;
|
||||
}
|
||||
|
||||
sub generateXserverConfig {
|
||||
my $xserverEnabled = "@xserverEnabled@";
|
||||
|
||||
my $config = "";
|
||||
if ($xserverEnabled eq "1") {
|
||||
$config = <<EOF;
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
EOF
|
||||
} else {
|
||||
$config = <<EOF;
|
||||
# Enable the X11 windowing system.
|
||||
# services.xserver.enable = true;
|
||||
EOF
|
||||
}
|
||||
}
|
||||
|
||||
if ($showHardwareConfig) {
|
||||
print STDOUT $hwConfig;
|
||||
@ -630,6 +646,8 @@ EOF
|
||||
|
||||
my $networkingDhcpConfig = generateNetworkingDhcpConfig();
|
||||
|
||||
my $xserverConfig = generateXserverConfig();
|
||||
|
||||
(my $desktopConfiguration = <<EOF)=~s/^/ /gm;
|
||||
@desktopConfiguration@
|
||||
EOF
|
||||
|
@ -36,6 +36,7 @@ let
|
||||
path = lib.optionals (lib.elem "btrfs" config.boot.supportedFilesystems) [ pkgs.btrfs-progs ];
|
||||
perl = "${pkgs.perl}/bin/perl -I${pkgs.perlPackages.FileSlurp}/${pkgs.perl.libPrefix}";
|
||||
inherit (config.system.nixos-generate-config) configuration desktopConfiguration;
|
||||
xserverEnabled = config.services.xserver.enable;
|
||||
};
|
||||
|
||||
nixos-option =
|
||||
@ -136,6 +137,8 @@ in
|
||||
# keyMap = "us";
|
||||
# };
|
||||
|
||||
$xserverConfig
|
||||
|
||||
$desktopConfiguration
|
||||
# Configure keymap in X11
|
||||
# services.xserver.layout = "us";
|
||||
|
@ -199,7 +199,6 @@ in
|
||||
# Seed our configuration into nixos-generate-config
|
||||
system.nixos-generate-config.desktopConfiguration = [''
|
||||
# Enable the GNOME 3 Desktop Environment.
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.desktopManager.gnome3.enable = true;
|
||||
''];
|
||||
|
@ -186,7 +186,6 @@ in
|
||||
# Seed our configuration into nixos-generate-config
|
||||
system.nixos-generate-config.desktopConfiguration = [''
|
||||
# Enable the Plasma 5 Desktop Environment.
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.sddm.enable = true;
|
||||
services.xserver.desktopManager.plasma5.enable = true;
|
||||
''];
|
||||
|
@ -13,9 +13,8 @@ import ./make-test-python.nix ({ lib, ... } : {
|
||||
|
||||
system.nixos-generate-config.desktopConfiguration = [''
|
||||
# DESKTOP
|
||||
# services.xserver.enable = true;
|
||||
# services.xserver.displayManager.gdm.enable = true;
|
||||
# services.xserver.desktopManager.gnome3.enable = true;
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.desktopManager.gnome3.enable = true;
|
||||
''];
|
||||
};
|
||||
testScript = ''
|
||||
|
Loading…
Reference in New Issue
Block a user