1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00
nixpkgs/nixos
aszlig 9e9af4f9c0
nixos/confinement: Allow to include the full unit
From @edolstra at [1]:

  BTW we probably should take the closure of the whole unit rather than
  just the exec commands, to handle things like Environment variables.

With this commit, there is now a "fullUnit" option, which can be enabled
to include the full closure of the service unit into the chroot.

However, I did not enable this by default, because I do disagree here
and *especially* things like environment variables or environment files
shouldn't be in the closure of the chroot.

For example if you have something like:

  { pkgs, ... }:

  {
    systemd.services.foobar = {
      serviceConfig.EnvironmentFile = ${pkgs.writeText "secrets" ''
        user=admin
        password=abcdefg
      '';
    };
  }

We really do not want the *file* to end up in the chroot, but rather
just the environment variables to be exported.

Another thing is that this makes it less predictable what actually will
end up in the chroot, because we have a "globalEnvironment" option that
will get merged in as well, so users adding stuff to that option will
also make it available in confined units.

I also added a big fat warning about that in the description of the
fullUnit option.

[1]: https://github.com/NixOS/nixpkgs/pull/57519#issuecomment-472855704

Signed-off-by: aszlig <aszlig@nix.build>
2019-03-14 20:04:33 +01:00
..
doc nixos/doc: add types prefix to addCheck example 2019-03-11 22:56:56 +01:00
lib nixos: doc: optionally include all modules in manual generation 2019-03-05 09:41:40 +00:00
maintainers Merge pull request #44573 from vincentbernat/feature/cloudstack 2019-02-24 08:28:42 -08:00
modules nixos/confinement: Allow to include the full unit 2019-03-14 20:04:33 +01:00
tests nixos/confinement: Allow to include the full unit 2019-03-14 20:04:33 +01:00
COPYING
default.nix
README
release-combined.nix pantheon: init a 5.0 2019-01-24 20:54:14 +00:00
release-small.nix Add the boot test to release-small.nix 2018-02-27 20:09:07 +01:00
release.nix nixos/sd-image-aarch64-new-kernel: Added to release 2018-12-26 11:03:32 +00:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
http://nixos.org/nixos and in the manual in doc/manual.