From b9df9ca2c4bd21f89a1fcbfc3a1c9f65077fada2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Wed, 28 Apr 2021 04:29:09 +0200 Subject: [PATCH] virtualisation.lxc: indent config --- .../modules/virtualisation/lxc-container.nix | 74 ++++++++++--------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/nixos/modules/virtualisation/lxc-container.nix b/nixos/modules/virtualisation/lxc-container.nix index a6f82e4436f3..3b70ed14f550 100644 --- a/nixos/modules/virtualisation/lxc-container.nix +++ b/nixos/modules/virtualisation/lxc-container.nix @@ -7,48 +7,50 @@ with lib; ../profiles/docker-container.nix # FIXME, shouldn't include something from profiles/ ]; - system.build.tarball = mkForce (pkgs.callPackage ../../lib/make-system-tarball.nix { - extraArgs = "--owner=0"; + config = { + system.build.tarball = mkForce (pkgs.callPackage ../../lib/make-system-tarball.nix { + extraArgs = "--owner=0"; - storeContents = [ - config.system.build.toplevel - ]; + storeContents = [ + config.system.build.toplevel + ]; - contents = [ - { - source = pkgs.writeText "metadata.yaml" '' - architecture: ${builtins.elemAt (builtins.match "^([a-z0-9_]+).+" (toString pkgs.system)) 0} - creation_date: 0 - properties: - description: NixOS ${config.system.nixos.codeName} ${config.system.nixos.label} ${pkgs.system} - os: nixos - release: ${config.system.nixos.codeName} - ''; - target = "/metadata.yaml"; - } - { - source = config.system.build.toplevel + "/init"; - target = "/sbin/init"; - } - ]; + contents = [ + { + source = pkgs.writeText "metadata.yaml" '' + architecture: ${builtins.elemAt (builtins.match "^([a-z0-9_]+).+" (toString pkgs.system)) 0} + creation_date: 0 + properties: + description: NixOS ${config.system.nixos.codeName} ${config.system.nixos.label} ${pkgs.system} + os: nixos + release: ${config.system.nixos.codeName} + ''; + target = "/metadata.yaml"; + } + { + source = config.system.build.toplevel + "/init"; + target = "/sbin/init"; + } + ]; - extraCommands = "mkdir -p proc sys dev"; - }); + extraCommands = "mkdir -p proc sys dev"; + }); - # Allow the user to login as root without password. - users.users.root.initialHashedPassword = mkOverride 150 ""; + # Allow the user to login as root without password. + users.users.root.initialHashedPassword = mkOverride 150 ""; - # Some more help text. - services.getty.helpLine = - '' + # Some more help text. + services.getty.helpLine = + '' - Log in as "root" with an empty password. - ''; + Log in as "root" with an empty password. + ''; - # Containers should be light-weight, so start sshd on demand. - services.openssh.enable = mkDefault true; - services.openssh.startWhenNeeded = mkDefault true; + # Containers should be light-weight, so start sshd on demand. + services.openssh.enable = mkDefault true; + services.openssh.startWhenNeeded = mkDefault true; - # Allow ssh connections - networking.firewall.allowedTCPPorts = [ 22 ]; + # Allow ssh connections + networking.firewall.allowedTCPPorts = [ 22 ]; + }; }