-
-
Save fuad-ibrahimzade/880615337edb6783598730434e64d5b2 to your computer and use it in GitHub Desktop.
nested NixOS containers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import <nixpkgs/nixos/tests/make-test-python.nix> ({pkgs, ...}: rec { | |
| name = "nesting"; | |
| meta = with pkgs.stdenv.lib.maintainers; { | |
| maintainers = [ sorki ]; | |
| }; | |
| machine = { lib, ... }: | |
| let makeNested = subConf: { | |
| boot.enableContainers = true; | |
| containers.nested = { | |
| autoStart = true; | |
| privateNetwork = true; | |
| config = subConf; | |
| }; | |
| }; | |
| in makeNested (makeNested {}); | |
| testScript = '' | |
| machine.start() | |
| machine.wait_for_unit("[email protected]") | |
| machine.succeed("systemd-run --pty --machine=nested -- machinectl list | grep nested") | |
| print( | |
| machine.succeed( | |
| "systemd-run --pty --machine=nested -- systemd-run --pty --machine=nested -- systemctl status" | |
| ) | |
| ) | |
| ''; | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment