From ff2b9bbc446cd900ebdf90faf91559bd95808966 Mon Sep 17 00:00:00 2001 From: kghugo Date: Sun, 17 Oct 2021 20:35:14 +0100 Subject: [PATCH 1/2] Fix missing sh in PATH --- examples/flake/arion-compose.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/flake/arion-compose.nix b/examples/flake/arion-compose.nix index 9531a9f..141dba7 100644 --- a/examples/flake/arion-compose.nix +++ b/examples/flake/arion-compose.nix @@ -4,6 +4,7 @@ config.services = { webserver = { + image.contents = with pkgs; [ bash ]; service.useHostStore = true; service.command = [ "sh" "-c" '' cd "$$WEB_ROOT" From 600aa2c8ac71ad28ba515a123933657c10061dce Mon Sep 17 00:00:00 2001 From: kghugo Date: Sun, 17 Oct 2021 21:02:51 +0100 Subject: [PATCH 2/2] Link only sh from bash package to reduce image size --- examples/flake/arion-compose.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/flake/arion-compose.nix b/examples/flake/arion-compose.nix index 141dba7..b4ddbc5 100644 --- a/examples/flake/arion-compose.nix +++ b/examples/flake/arion-compose.nix @@ -1,10 +1,20 @@ { pkgs, ... }: -{ +let + sh = pkgs.stdenv.mkDerivation { + name = "sh"; + phases = [ "installPhase" ]; + + installPhase = '' + mkdir -p "$out"/bin + ln -s ${pkgs.bash}/bin/sh "$out"/bin/sh + ''; + }; +in{ config.project.name = "webapp"; config.services = { webserver = { - image.contents = with pkgs; [ bash ]; + image.contents = [ sh ]; service.useHostStore = true; service.command = [ "sh" "-c" '' cd "$$WEB_ROOT"