From a5e08b23a34f428dec76b86de1e904b3d6e7e3f0 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 5 Mar 2019 19:42:32 +0100 Subject: [PATCH] Add service.useHostNixDaemon --- src/nix/modules/service/host-store.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/nix/modules/service/host-store.nix b/src/nix/modules/service/host-store.nix index ae6a1e5..2060517 100644 --- a/src/nix/modules/service/host-store.nix +++ b/src/nix/modules/service/host-store.nix @@ -16,6 +16,11 @@ in default = false; description = "Bind mounts the host store if enabled, avoiding copying."; }; + service.useHostNixDaemon = mkOption { + type = types.bool; + default = false; + description = "Make the host Nix daemon available."; + }; }; config = mkIf config.service.useHostStore { service.image = "arion-base"; @@ -23,6 +28,6 @@ in service.volumes = [ "${config.host.nixStorePrefix}/nix/store:/nix/store" "${config.host.nixStorePrefix}${pkgs.buildEnv { name = "container-system-env"; paths = [ pkgs.bashInteractive pkgs.coreutils ]; }}:/run/system" - ]; + ] ++ lib.optional config.service.useHostNixDaemon "/nix/var/nix/daemon-socket:/nix/var/nix/daemon-socket"; }; }