feat: custom nix store

This commit is contained in:
Serhii Khoma 2019-02-13 11:04:17 +02:00
parent 57d5370e76
commit 59f97876e3
3 changed files with 8 additions and 5 deletions

View File

@ -9,7 +9,7 @@
- docker-compose.services - docker-compose.services
*/ */
{ pkgs, uid, lib, config, ... }: { pkgs, uid, lib, config, customNixRootPath, ... }:
let let
evalService = name: modules: evalService = name: modules:
@ -30,6 +30,7 @@ let
key = ./docker-compose-module.nix; key = ./docker-compose-module.nix;
config._module.args.pkgs = lib.mkForce pkgs; config._module.args.pkgs = lib.mkForce pkgs;
config._module.args.uid = uid; config._module.args.uid = uid;
config._module.args.customNixRootPath = customNixRootPath;
}; };
in in

View File

@ -1,4 +1,4 @@
{ modules ? [], uid ? 0, pkgs }: { modules ? [], uid ? 0, pkgs, customNixRootPath ? "", }:
let _pkgs = pkgs; let _pkgs = pkgs;
in in
@ -26,6 +26,7 @@ let
key = ./eval-composition.nix; key = ./eval-composition.nix;
config._module.args.pkgs = lib.mkIf (pkgs != null) (lib.mkForce pkgs); config._module.args.pkgs = lib.mkIf (pkgs != null) (lib.mkForce pkgs);
config._module.args.uid = uid; config._module.args.uid = uid;
config._module.args.customNixRootPath = customNixRootPath;
}; };
in in

View File

@ -4,7 +4,8 @@
when the service.useHostStore option is set to true. when the service.useHostStore option is set to true.
*/ */
{ lib, config, pkgs, ... }: { lib, config, pkgs, customNixRootPath, ... }:
let let
inherit (lib) mkOption types mkIf; inherit (lib) mkOption types mkIf;
in in
@ -20,8 +21,8 @@ in
service.image = "arion-base"; service.image = "arion-base";
service.build.context = "${../arion-image}"; service.build.context = "${../arion-image}";
service.volumes = [ service.volumes = [
"/nix/store:/nix/store" "${customNixRootPath}/nix/store:/nix/store"
"${pkgs.buildEnv { name = "container-system-env"; paths = [ pkgs.bashInteractive pkgs.coreutils ]; }}:/run/system" "${customNixRootPath}${pkgs.buildEnv { name = "container-system-env"; paths = [ pkgs.bashInteractive pkgs.coreutils ]; }}:/run/system"
]; ];
}; };
} }