Closed rbrewer123 closed 5 years ago
Was this fixed by? https://github.com/NixOS/nixpkgs/pull/36357
cc @matthewbauer
Can we confirm that this is still an issue in 18.03? @rbrewer123
I recall something changing here but can’t remember if it’s been included.
@matthewbauer @Mic92 I checked the 18.03 virtualbox appliance and /etc/nixos/configuration.nix
appears the same as for 17.09.
Okay I think I understand what you are wanting. You want there to be some example config and docs on how to edit it? Something like this:
We can probably do this although it gets tricky with how this is all setup in https://github.com/NixOS/nixpkgs/blob/1e23a5a6e916ad5992916d7517af7b4fa928c812/nixos/modules/virtualisation/virtualbox-image.nix
Right. The friendly configuration.nix
is only present when you install from scratch. The one in the virtualbox image hides its configuration deep in the repository.
The goal of this issue would be that using the virtualbox image just bypasses doing the various partitioning and install steps. But the end result in /etc/nixos
looks like you ran those steps just the same.
I'm not far enough along to know how to implement that or how difficult it would be.
Here's an example configuration that I think might meet most user's needs:
{ config, pkgs, lib, ... }:
# This file is used to generate your NixOS system.
# After editing it, you can run:
# $ nixos-rebuild switch
# To try out the changes and
# $ nixos-rebuild fallback
# To go back to the old version.
# A few example configurations are provided below.
# Try them out by uncommenting those lines.
{
# Base configuration for VirtualBox image.
imports = [ <nixpkgs/nixos/modules/installer/virtualbox-demo.nix> ];
# 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;
}
Contains some basic suggestions for what options to try.
Issue description
The 17.09 virtualbox appliance
/etc/nixos/configuration.nix
contains just an import, with no comments and nohardware-configuration.nix
at all. As installing the appliance is a common way for new users to try out NixOS, I suggest making/etc/nixos
contain a fullconfiguration.nix
andhardware-configuration.nix
as if a normal install were done. This allows new users to more easily build up a configuration and reuse it in a "real" install.Further background
As a new user, I installed the 17.09 virtualbox appliance to get a feel for NixOS and start building up a
configuration.nix
before installing on real hardware. However, I soon realized the/etc/nixos/configuration.nix
difference described above. It was difficult to find where the imported files actually lived on the system, and I didn't even havevi
available. Eventually, I did a "normal" install inside a virtualbox VM and things made much more sense. The defaultconfiguration.nix
has nice comments and I was able to find bits of configuration via google to get going. I've now installed on a laptop for further use.Steps to reproduce
Install 17.09 virtualbox appliance. Look at files in
/etc/nixos
.