@@ -20,17 +20,18 @@ in {
2020 contents = [];
2121 extraArgs = "--owner=0";
2222
23− # Some container managers like lxc need these
24− extraCommands = "mkdir -p proc sys dev";
25−
2623 # Add init script to image
2724 storeContents = [
2825 { object = config.system.build.toplevel + "/init";
2926 symlink = "/init";
3027 }
3128 ] ++ (pkgs2storeContents [ pkgs.stdenv ]);
29+
30+ # Some container managers like lxc need these
31+ extraCommands = "mkdir -p proc sys dev";
3232 };
3333
34+ boot.isContainer = true;
3435 boot.postBootCommands =
3536 ''
3637 # After booting, register the contents of the Nix store in the Nix
@@ -46,12 +47,12 @@ in {
4647 ${config.nix.package}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system
4748 '';
4849
49− boot.isContainer = true;
50−
5150 # Disable some features that are not useful in a container.
5251 sound.enable = mkDefault false;
5352 services.udisks2.enable = mkDefault false;
5453
55− # Shut up warnings about not having a boot loader.
56− system.build.installBootLoader = "${pkgs.coreutils}/bin/true";
54+ # Install new init script
55+ system.activationScripts.installInitScript = ''
56+ ln -fs $systemConfig/init /init
57+ '';
5758}