3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/virtualization/extra-container/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.1 KiB
Nix
Raw Normal View History

2020-11-01 15:00:59 +00:00
{ stdenv, lib, nixos-container, openssh, glibcLocales, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "extra-container";
2022-06-26 16:11:35 +01:00
version = "0.10";
2020-11-01 15:00:59 +00:00
src = fetchFromGitHub {
owner = "erikarvstedt";
repo = pname;
rev = version;
2022-06-26 16:11:35 +01:00
hash = "sha256-vtCZ0w1Kaiw9bIrzwEb4Jnv7QoQLp8JDjaGmAP91hpE=";
2020-11-01 15:00:59 +00:00
};
buildCommand = ''
install -D $src/extra-container $out/bin/extra-container
patchShebangs $out/bin
share=$out/share/extra-container
install $src/eval-config.nix -Dt $share
# Use existing PATH for systemctl and machinectl
2022-06-26 16:11:35 +01:00
scriptPath="export PATH=${lib.makeBinPath [ openssh ]}:\$PATH"
2020-11-01 15:00:59 +00:00
2022-06-26 16:11:35 +01:00
sed -i "
s|evalConfig=.*|evalConfig=$share/eval-config.nix|
s|LOCALE_ARCHIVE=.*|LOCALE_ARCHIVE=${glibcLocales}/lib/locale/locale-archive|
2i$scriptPath
2inixosContainer=${nixos-container}/bin
" $out/bin/extra-container
2020-11-01 15:00:59 +00:00
'';
meta = with lib; {
description = "Run declarative containers without full system rebuilds";
homepage = "https://github.com/erikarvstedt/extra-container";
2020-11-01 15:00:59 +00:00
license = licenses.mit;
platforms = platforms.linux;
maintainers = [ maintainers.erikarvstedt ];
2020-11-01 15:00:59 +00:00
};
}