lol

nixos/docker-image: add example usage

+38
+38
nixos/modules/virtualisation/docker-image.nix
··· 17 17 # Socket activated ssh presents problem in Docker. 18 18 services.openssh.startWhenNeeded = false; 19 19 } 20 + 21 + # Example usage: 22 + # 23 + ## default.nix 24 + # let 25 + # nixos = import <nixpkgs/nixos> { 26 + # configuration = ./configuration.nix; 27 + # system = "x86_64-linux"; 28 + # }; 29 + # in 30 + # nixos.config.system.build.tarball 31 + # 32 + ## configuration.nix 33 + # { pkgs, config, lib, ... }: 34 + # { 35 + # imports = [ 36 + # <nixpkgs/nixos/modules/virtualisation/docker-image.nix> 37 + # <nixpkgs/nixos/modules/installer/cd-dvd/channel.nix> 38 + # ]; 39 + # 40 + # documentation.doc.enable = false; 41 + # 42 + # environment.systemPackages = with pkgs; [ 43 + # bashInteractive 44 + # cacert 45 + # nix 46 + # ]; 47 + # } 48 + # 49 + ## Run 50 + # Build the tarball: 51 + # $ nix-build default.nix 52 + # Load into docker: 53 + # $ docker import result/tarball/nixos-system-*.tar.xz nixos-docker 54 + # Boots into systemd 55 + # $ docker run --privileged -it nixos-docker /init 56 + # Log into the container 57 + # $ docker exec -it <container-name> /run/current-system/sw/bin/bash