diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2018-11-23 15:40:10 +0000 |
---|---|---|
committer | Jörg Thalheim <joerg@thalheim.io> | 2018-11-23 15:40:10 +0000 |
commit | 50daffc4b828894e076c190fbd88bac19148b4f0 (patch) | |
tree | 03f77b75dcf4205246cc1f82e3a8a83296c8cd5f /nixos/modules/virtualisation/docker-image.nix | |
parent | ceececbd0404d180b34d1eecfcd4cea728fb1f4a (diff) |
nixos/docker-image: add example usage
Diffstat (limited to 'nixos/modules/virtualisation/docker-image.nix')
-rw-r--r-- | nixos/modules/virtualisation/docker-image.nix | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/nixos/modules/virtualisation/docker-image.nix b/nixos/modules/virtualisation/docker-image.nix index 2f304094d55b..baac3a35a78e 100644 --- a/nixos/modules/virtualisation/docker-image.nix +++ b/nixos/modules/virtualisation/docker-image.nix @@ -17,3 +17,41 @@ # Socket activated ssh presents problem in Docker. services.openssh.startWhenNeeded = false; } + +# Example usage: +# +## default.nix +# let +# nixos = import <nixpkgs/nixos> { +# configuration = ./configuration.nix; +# system = "x86_64-linux"; +# }; +# in +# nixos.config.system.build.tarball +# +## configuration.nix +# { pkgs, config, lib, ... }: +# { +# imports = [ +# <nixpkgs/nixos/modules/virtualisation/docker-image.nix> +# <nixpkgs/nixos/modules/installer/cd-dvd/channel.nix> +# ]; +# +# documentation.doc.enable = false; +# +# environment.systemPackages = with pkgs; [ +# bashInteractive +# cacert +# nix +# ]; +# } +# +## Run +# Build the tarball: +# $ nix-build default.nix +# Load into docker: +# $ docker import result/tarball/nixos-system-*.tar.xz nixos-docker +# Boots into systemd +# $ docker run --privileged -it nixos-docker /init +# Log into the container +# $ docker exec -it <container-name> /run/current-system/sw/bin/bash |