summary refs log tree commit diff
path: root/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix
blob: 4c4e69d60d9c701aae370a39f9def061f66fcf18 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# This module defines a NixOS installation CD that contains X11 and
# GNOME 3.

{ config, lib, pkgs, ... }:

with lib;

{
  imports = [ ./installation-cd-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

        [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;

  # Auto-login as root.
  services.xserver.displayManager.gdm.autoLogin = {
    enable = true;
    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
  '';

}