-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos-containers: init package #16959
nixos-containers: init package #16959
Conversation
@ericbmerritt, thanks for your PR! By analyzing the annotation information on this pull request, we identified @edolstra, @matthiasbeyer and @aszlig to be potential reviewers |
Sorry, can you elaborate on what else might use this? I'm not opposed to it but I'm not seeing the use case. |
@copumpkin Our use case is that we standup systems to do testing in various contexts. In one of those contexts, (first pass integration testing) we stand up the system as a set of containers on build host. The testing system is running as an algorithmic user. Unfortunately, to use containers that user needs passwordless sudo rights to run nixos-container. It gives me the heebie-jeebies to grant sudo to that kind of user in any fashion. To limit our risk, only to that very specific nixos-container command. With nixos-containers as its own package this is fairly trivial to do in the configuration.nix of the build host. That is the primary driver for this. Essentially, being able to treat the nixos-container command as I do any other command in nix. The other side of that is that I have functionality that calls 'nixos-container'. Leaving that as an implicit dependency rather than placing it in the dependency list so nix can manage the relationship seems off. |
cp ${./nixos-container-completion.sh} $t/nixos-container | ||
''; | ||
}; | ||
in nixos-container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The let nixos-container = ... in nixos-container
is redundant here, also instead of pulling in pkgs
as a whole I'd refer to the dependencies explicitly in the expressions input attributes, like:
{ substituteAll, perl, perlPackages, shadow, utillinux }:
substituteAll {
...
}
Also, lib
isn't used either.
Another thing that is missing is the callPackage
from all-packages.nix
.
@aszlig updated in response to your comments. |
@@ -0,0 +1,17 @@ | |||
{ pkgs, ... }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :-) However, the function signature still doesn't say something like: { substituteAll, perl, perlPackages, shadow, utillinux }:
and pulls out the whole pkgs
attrset instead of stating dependencies explicitly, see http://nixos.org/nixpkgs/manual/#sec-syntax (Functions should list their expected arguments as precisely as possible. ...
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. I will make the changes.
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.
I'm not sure why I'm pinged by the bot. I will now unsubscribe from this PR as I don't think I'm qualified enough to review this. Edit: Feel free to ping me again if you think I should review this. |
This broke travis tests: https://travis-ci.org/NixOS/nixpkgs/jobs/145759096 Fixed with 6bcf194. |
Update to latest stable version from the 5.1 branch. Also fixes compilation of the host driver on 4.15. Changelog: * GUI: mouse events did not reach host windows behind the transparent VM window (Mac OS X hosts only; bug NixOS#16246) * Audio: fixed accidental crashes when using the AC'97 sound emulation (bug NixOS#16959) * Audio: fixed crash when default input or output devices have changed (bugs NixOS#16968, NixOS#16969, NixOS#17004) * Audio: fixed recording when using the ALSA backend * Audio: fixed handle leak when using the OSS backend * E1000: fixed a crash related to VLAN traffic over internal network (5.1.26 regression; bug NixOS#16960) * NAT: apply --natbindip1 to TCP connections (bug NixOS#16478) * OVF: when importing an appliance with XHCI controller, don't add an OHCI controller. * Mac OS X hosts: fixed a GUI crash if Spotlight is used from file dialogs (5.1.20 regression; bugs NixOS#16935, NixOS#16953) * Linux hosts: fixed creating fixed sized VDI images (bug NixOS#17010) * Linux hosts / guests: fixes for Linux 4.4 of openSUSE Leap 42.3 (bug NixOS#16966) * Bridged networking: align outgoing packet at word boundary, preventing Windows host crash in MsLbfoProvider. * Linux Additions: kernel drm driver support for custom EL7 Linux 3.10 kernel * Solaris Additions: hide an informational message on the bootup console * GUI: translation updates * GUI: Fixed double mouse cursor when using mouse integration without Guest Additions, actually a Qt 5.6 bug fixed with QT 5.6.3 (Mac OS X hosts only; bug NixOS#15610) * Solaris hosts: allow increasing MTU size for host-only adapter to 9706 bytes to support jumbo frames * Linux hosts: glibc 2.26 compile fix * Windows Additions: 3D related crash fix (bugs NixOS#17082, NixOS#17092) * GUI: fixed occasional screen corruption when host screen resolution is changed * User interface: increase proposed disk size when creating new VMs for Windows 7 and newer * Serial: fixed broken communication with certain devices on Linux hosts * VMM: Fixed problems using 256MB VRAM in raw-mode VMs * Audio: added HDA support for more exotic guests (e.g. Haiku) * Audio: fixed playback with ALSA backend (5.1.28 regression) * USB/OHCI: fixed a problem where OHCI emulation might sporadically drop data transfers * Windows hosts: VirtualBoxManager in the Python API no longer calls CoUninitialize when destroyed * Linux hosts: fixed VBoxNetFlt kernel module compilation failure with Linux kernel 4.14 * Linux guests: fixed kernel module compilation and other problems with Linux kernel 4.14
Motivation for this change
Things done
(nix.useChroot on NixOS,
or option
build-use-chroot
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)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.
This change is