Commit Graph

8 Commits

Author SHA1 Message Date
Wilhelm Schuster
c37e76b4d2 nixos-container: Use machinectl shell (#18825)
Using nsenter+su was suboptimal since the environment they provided was
not quite the same as the real container environment. See [1] for more
background.

Note that we directly invoke /bin/sh for `nixos-container root-login`
since setting the user's shell is quite complex. See [2] for a related
systemd issue.

[1]: https://github.com/systemd/systemd/issues/825#issuecomment-127917622
[2]: https://github.com/systemd/systemd/issues/1395
2016-09-24 00:40:41 +02:00
aszlig
9f0acda7eb
nixos-container: Fix missing comma in GetOptions
Regression introduced by fe8f0dbd53.

Tested using "nix-build nixos/tests/containers-imperative.nix".

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @ericbmerritt
2016-08-07 14:29:33 +02:00
Joachim F
dece583a94 Merge pull request #17484 from srp/nixos-container-terminate
nixos-container: add 'terminate' command which 'destroy' now uses
2016-08-05 23:03:38 +02:00
Eric Merritt
a2feaf6d79 nixos-container: feature add 'config-file' option
This adds a config file option to nixos-container.pl that makes it quite
a bit easier to use.
2016-08-04 07:08:56 -07:00
Eric Merritt
fe8f0dbd53 nixos-container: fix allow alternative nixos paths
This should be completely backwards compatible. It allows the '-f' part
of the nix-env command to be configured. This greatly eases using
nixos-container as part of development where several nixpkgs
repositories might be tested at the same time.
2016-08-04 07:08:05 -07:00
Scott R. Parish
d6c55c16f6 nixos-container: replace 'kill' command with 'terminate'
My earlier commit to have `nixos-container destroy` use `kill` broke
the `container-imperative` test, see[1]. As suggested by @aszlig,
`machinectl terminate` doesn't have that problem, and is the command
that should have been used to begin with rather then `kill`.

1| 60c6c7bc9a (commitcomment-18478032)
2016-08-03 11:08:32 -07:00
Scott R. Parish
60c6c7bc9a nixos-container: add 'kill' command, 'destroy' to use 'kill'
Using 'machinectl kill' is much faster then gracefully stopping the
container.

In the case of 'destroy', since we're destroying it anyway, there's no
reason to do a graceful shutdown.
2016-07-21 14:58:05 -07:00
Eric Merritt
eb92804f91 nixos-containers: init package (#16959)
This moves nixos-containers into its own package so that it can be
relied upon by other packages/systems. This should make development
using dynamic containers much easier.
2016-07-19 08:13:06 +02:00