Skip to content

Commit

Permalink
Revert "nixos/containers: add unprivileged option"
Browse files Browse the repository at this point in the history
  • Loading branch information
mmahut committed Aug 23, 2019
1 parent 611fbf7 commit 4aef221
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 71 deletions.
16 changes: 2 additions & 14 deletions nixos/modules/virtualisation/containers.nix
Expand Up @@ -139,7 +139,6 @@ let
--bind="/nix/var/nix/profiles/per-container/$INSTANCE:/nix/var/nix/profiles" \
--bind="/nix/var/nix/gcroots/per-container/$INSTANCE:/nix/var/nix/gcroots" \
${optionalString (!cfg.ephemeral) "--link-journal=try-guest"} \
${optionalString (cfg.unprivileged) "-U"} \
--setenv PRIVATE_NETWORK="$PRIVATE_NETWORK" \
--setenv HOST_BRIDGE="$HOST_BRIDGE" \
--setenv HOST_ADDRESS="$HOST_ADDRESS" \
Expand Down Expand Up @@ -239,8 +238,8 @@ let
ExecReload = pkgs.writeScript "reload-container"
''
#! ${pkgs.runtimeShell} -e
${pkgs.systemd}/bin/machinectl shell "$INSTANCE" \
''${SYSTEM_PATH:-/nix/var/nix/profiles/system}/bin/switch-to-configuration test
${pkgs.nixos-container}/bin/nixos-container run "$INSTANCE" -- \
bash --login -c "''${SYSTEM_PATH:-/nix/var/nix/profiles/system}/bin/switch-to-configuration test"
'';

SyslogIdentifier = "container %i";
Expand Down Expand Up @@ -424,7 +423,6 @@ let
extraVeths = {};
additionalCapabilities = [];
ephemeral = false;
unprivileged = false;
allowedDevices = [];
hostAddress = null;
hostAddress6 = null;
Expand Down Expand Up @@ -518,16 +516,6 @@ in
'';
};

unprivileged = mkOption {
type = types.bool;
default = false;
description = ''
Run container in unprivileged mode using private users feature of <command>systemd-nspawn</command>.
This option is eqvivalent of adding -U parameter to <command>systemd-nspawn</command> command.
See <literal>systemd-nspawn(1)</literal> man page for more information.
'';
};

ephemeral = mkOption {
type = types.bool;
default = false;
Expand Down
1 change: 0 additions & 1 deletion nixos/tests/all-tests.nix
Expand Up @@ -48,7 +48,6 @@ in
colord = handleTest ./colord.nix {};
containers-bridge = handleTest ./containers-bridge.nix {};
containers-ephemeral = handleTest ./containers-ephemeral.nix {};
containers-unprivileged = handleTest ./containers-unprivileged.nix {};
containers-extra_veth = handleTest ./containers-extra_veth.nix {};
containers-hosts = handleTest ./containers-hosts.nix {};
containers-imperative = handleTest ./containers-imperative.nix {};
Expand Down
56 changes: 0 additions & 56 deletions nixos/tests/containers-unprivileged.nix

This file was deleted.

0 comments on commit 4aef221

Please sign in to comment.