summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-10-28 19:05:16 -0500
committerGitHub <noreply@github.com>2018-10-28 19:05:16 -0500
commita943bc9e0499933d3ca80171f14bdc83b841aca9 (patch)
tree58396a0e3bb578cec303d1e5e81382c3f345f5ea /nixos
parentb770be49b934e7b8065a76c1d4d3d9f56be5ba4e (diff)
parent1902adb4375d3df5a231e41676c3157ebd571beb (diff)
downloadnixlib-a943bc9e0499933d3ca80171f14bdc83b841aca9.tar
nixlib-a943bc9e0499933d3ca80171f14bdc83b841aca9.tar.gz
nixlib-a943bc9e0499933d3ca80171f14bdc83b841aca9.tar.bz2
nixlib-a943bc9e0499933d3ca80171f14bdc83b841aca9.tar.lz
nixlib-a943bc9e0499933d3ca80171f14bdc83b841aca9.tar.xz
nixlib-a943bc9e0499933d3ca80171f14bdc83b841aca9.tar.zst
nixlib-a943bc9e0499933d3ca80171f14bdc83b841aca9.zip
Merge pull request #48801 from matthewbauer/cloneConfigExtra
ova: add cloneConfigExtra option
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/installer/virtualbox-demo.nix38
-rw-r--r--nixos/modules/profiles/clone-config.nix9
2 files changed, 47 insertions, 0 deletions
diff --git a/nixos/modules/installer/virtualbox-demo.nix b/nixos/modules/installer/virtualbox-demo.nix
index 8ca3592f3800..2e1b4b3998b5 100644
--- a/nixos/modules/installer/virtualbox-demo.nix
+++ b/nixos/modules/installer/virtualbox-demo.nix
@@ -22,4 +22,42 @@ with lib;
 
   powerManagement.enable = false;
   system.stateVersion = mkDefault "18.03";
+
+  installer.cloneConfigExtra = ''
+  # Let demo build as a trusted user.
+  # nix.trustedUsers = [ "demo" ];
+
+  # Mount a VirtualBox shared folder.
+  # This is configurable in the VirtualBox menu at
+  # Machine / Settings / Shared Folders.
+  # fileSystems."/mnt" = {
+  #   fsType = "vboxsf";
+  #   device = "nameofdevicetomount";
+  #   options = [ "rw" ];
+  # };
+
+  # By default, the NixOS VirtualBox demo image includes SDDM and Plasma.
+  # If you prefer another desktop manager or display manager, you may want
+  # to disable the default.
+  # services.xserver.desktopManager.plasma5.enable = lib.mkForce false;
+  # services.xserver.displayManager.sddm.enable = lib.mkForce false;
+
+  # Enable GDM/GNOME by uncommenting above two lines and two lines below.
+  # services.xserver.displayManager.gdm.enable = true;
+  # services.xserver.desktopManager.gnome3.enable = true;
+
+  # Set your time zone.
+  # time.timeZone = "Europe/Amsterdam";
+
+  # List packages installed in system profile. To search, run:
+  # \$ nix search wget
+  # environment.systemPackages = with pkgs; [
+  #   wget vim
+  # ];
+
+  # Enable the OpenSSH daemon.
+  # services.openssh.enable = true;
+
+  system.stateVersion = mkDefault "18.03";
+  '';
 }
diff --git a/nixos/modules/profiles/clone-config.nix b/nixos/modules/profiles/clone-config.nix
index 99d4774584f1..3f669ba7d2e1 100644
--- a/nixos/modules/profiles/clone-config.nix
+++ b/nixos/modules/profiles/clone-config.nix
@@ -48,6 +48,8 @@ let
 
       {
         imports = [ ${toString config.installer.cloneConfigIncludes} ];
+
+        ${config.installer.cloneConfigExtra}
       }
     '';
 
@@ -73,6 +75,13 @@ in
       '';
     };
 
+    installer.cloneConfigExtra = mkOption {
+      default = "";
+      description = ''
+        Extra text to include in the cloned configuration.nix included in this
+        installer.
+      '';
+    };
   };
 
   config = {