From 572967d3adc5f7be9d9fff1bddcf8f048021ccb8 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Sun, 27 Sep 2020 12:43:24 +0200 Subject: [PATCH] extra-container: pre-release -> 0.5-pre --- pkgs/extra-container/default.nix | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/pkgs/extra-container/default.nix b/pkgs/extra-container/default.nix index 0cccec0..9f93667 100644 --- a/pkgs/extra-container/default.nix +++ b/pkgs/extra-container/default.nix @@ -1,19 +1,30 @@ -{ stdenv, lib }: +{ stdenv, lib, nixos-container, openssh +, glibcLocales +}: stdenv.mkDerivation rec { name = "extra-container-${version}"; - version = "0.3"; + version = "0.5-pre"; src = builtins.fetchTarball { - url = "https://github.com/erikarvstedt/extra-container/archive/6cced2c26212cc1c8cc7cac3547660642eb87e71.tar.gz"; - sha256 = "0qr41mma2iwxckdhqfabw3vjcbp2ffvshnc3k11kwriwj14b766v"; + url = "https://github.com/erikarvstedt/extra-container/archive/${version}.tar.gz"; + sha256 = "0gdy2dpqrdv7f4kyqz88j34x1p2fpav04kznv41hwqq88hmzap90"; }; buildCommand = '' install -D $src/extra-container $out/bin/extra-container patchShebangs $out/bin - install $src/eval-config.nix -Dt $out/src - sed -i "s|evalConfig=.*|evalConfig=$out/src/eval-config.nix|" $out/bin/extra-container + share=$out/share/extra-container + install $src/eval-config.nix -Dt $share + + # Use existing PATH for systemctl and machinectl (for nixos-container) + scriptPath="export PATH=${lib.makeBinPath [ nixos-container openssh ]}:\$PATH" + + sed -i \ + -e "s|evalConfig=.*|evalConfig=$share/eval-config.nix|" \ + -e "s|LOCALE_ARCHIVE=.*|LOCALE_ARCHIVE=${glibcLocales}/lib/locale/locale-archive|" \ + -e "2i$scriptPath" \ + $out/bin/extra-container ''; meta = with lib; {