Merge pull request #46510 from worldofpeace/installer-refactor
installer: refactor
This commit is contained in:
commit
b0987f2013
@ -0,0 +1,49 @@
|
||||
# This module contains the basic configuration for building a graphical NixOS
|
||||
# installation CD.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [ ./installation-cd-base.nix ];
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
|
||||
# Don't start the X server by default.
|
||||
autorun = mkForce false;
|
||||
|
||||
# Automatically login as root.
|
||||
displayManager.slim = {
|
||||
enable = true;
|
||||
defaultUser = "root";
|
||||
autoLogin = true;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
# Provide networkmanager for easy wireless configuration.
|
||||
networking.networkmanager.enable = true;
|
||||
networking.wireless.enable = mkForce false;
|
||||
|
||||
# KDE complains if power management is disabled (to be precise, if
|
||||
# there is no power management backend such as upower).
|
||||
powerManagement.enable = true;
|
||||
|
||||
environment.systemPackages = [
|
||||
# Include gparted for partitioning disks.
|
||||
pkgs.gparted
|
||||
|
||||
# Include some editors.
|
||||
pkgs.vim
|
||||
pkgs.bvi # binary editor
|
||||
pkgs.joe
|
||||
|
||||
# Firefox for reading the manual.
|
||||
pkgs.firefox
|
||||
|
||||
pkgs.glxinfo
|
||||
];
|
||||
|
||||
}
|
@ -6,47 +6,11 @@
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [ ./installation-cd-base.nix ];
|
||||
imports = [ ./installation-cd-graphical-base.nix ];
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
# GDM doesn't start in virtual machines with ISO
|
||||
displayManager.slim = {
|
||||
enable = true;
|
||||
defaultUser = "root";
|
||||
autoLogin = true;
|
||||
};
|
||||
desktopManager.gnome3 = {
|
||||
enable = true;
|
||||
extraGSettingsOverrides = ''
|
||||
[org.gnome.desktop.background]
|
||||
show-desktop-icons=true
|
||||
services.xserver.desktopManager.gnome3.enable = true;
|
||||
|
||||
[org.gnome.nautilus.desktop]
|
||||
trash-icon-visible=false
|
||||
volumes-visible=false
|
||||
home-icon-visible=false
|
||||
network-icon-visible=false
|
||||
'';
|
||||
|
||||
extraGSettingsOverridePackages = [ pkgs.gnome3.nautilus ];
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages =
|
||||
[ # Include gparted for partitioning disks.
|
||||
pkgs.gparted
|
||||
|
||||
# Include some editors.
|
||||
pkgs.vim
|
||||
pkgs.bvi # binary editor
|
||||
pkgs.joe
|
||||
|
||||
pkgs.glxinfo
|
||||
];
|
||||
|
||||
# Don't start the X server by default.
|
||||
services.xserver.autorun = mkForce false;
|
||||
services.xserver.displayManager.slim.enable = mkForce false;
|
||||
|
||||
# Auto-login as root.
|
||||
services.xserver.displayManager.gdm.autoLogin = {
|
||||
@ -54,25 +18,4 @@ with lib;
|
||||
user = "root";
|
||||
};
|
||||
|
||||
system.activationScripts.installerDesktop = let
|
||||
# Must be executable
|
||||
desktopFile = pkgs.writeScript "nixos-manual.desktop" ''
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Link
|
||||
Name=NixOS Manual
|
||||
URL=${config.system.build.manual.manual}/share/doc/nixos/index.html
|
||||
Icon=system-help
|
||||
'';
|
||||
|
||||
# use cp and chmod +x, we must be sure the apps are in the nix store though
|
||||
in ''
|
||||
mkdir -p /root/Desktop
|
||||
ln -sfT ${desktopFile} /root/Desktop/nixos-manual.desktop
|
||||
cp ${pkgs.gnome3.gnome-terminal}/share/applications/gnome-terminal.desktop /root/Desktop/gnome-terminal.desktop
|
||||
chmod a+rx /root/Desktop/gnome-terminal.desktop
|
||||
cp ${pkgs.gparted}/share/applications/gparted.desktop /root/Desktop/gparted.desktop
|
||||
chmod a+rx /root/Desktop/gparted.desktop
|
||||
'';
|
||||
|
||||
}
|
||||
|
@ -1,23 +1,14 @@
|
||||
# This module defines a NixOS installation CD that contains X11 and
|
||||
# KDE 5.
|
||||
# Plasma5.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [ ./installation-cd-base.nix ];
|
||||
imports = [ ./installation-cd-graphical-base.nix ];
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
|
||||
# Automatically login as root.
|
||||
displayManager.slim = {
|
||||
enable = true;
|
||||
defaultUser = "root";
|
||||
autoLogin = true;
|
||||
};
|
||||
|
||||
desktopManager.plasma5 = {
|
||||
enable = true;
|
||||
enableQt4Support = false;
|
||||
@ -27,34 +18,14 @@ with lib;
|
||||
synaptics.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages =
|
||||
[ pkgs.glxinfo
|
||||
|
||||
# Include gparted for partitioning disks.
|
||||
pkgs.gparted
|
||||
|
||||
# Firefox for reading the manual.
|
||||
pkgs.firefox
|
||||
|
||||
# Include some editors.
|
||||
pkgs.vim
|
||||
pkgs.bvi # binary editor
|
||||
pkgs.joe
|
||||
];
|
||||
|
||||
# Provide networkmanager for easy wireless configuration.
|
||||
networking.networkmanager.enable = true;
|
||||
networking.wireless.enable = mkForce false;
|
||||
|
||||
# KDE complains if power management is disabled (to be precise, if
|
||||
# there is no power management backend such as upower).
|
||||
powerManagement.enable = true;
|
||||
|
||||
# Don't start the X server by default.
|
||||
services.xserver.autorun = mkForce false;
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Graphical text editor
|
||||
kate
|
||||
];
|
||||
|
||||
system.activationScripts.installerDesktop = let
|
||||
desktopFile = pkgs.writeText "nixos-manual.desktop" ''
|
||||
|
||||
manualDesktopFile = pkgs.writeScript "nixos-manual.desktop" ''
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
@ -65,7 +36,7 @@ with lib;
|
||||
|
||||
in ''
|
||||
mkdir -p /root/Desktop
|
||||
ln -sfT ${desktopFile} /root/Desktop/nixos-manual.desktop
|
||||
ln -sfT ${manualDesktopFile} /root/Desktop/nixos-manual.desktop
|
||||
ln -sfT ${pkgs.konsole}/share/applications/org.kde.konsole.desktop /root/Desktop/org.kde.konsole.desktop
|
||||
ln -sfT ${pkgs.gparted}/share/applications/gparted.desktop /root/Desktop/gparted.desktop
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user