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.

41 lines
1.3 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";
2023-06-15 09:54:21 +00:00
version = "0.12";
2020-11-01 15:00:59 +00:00
src = fetchFromGitHub {
owner = "erikarvstedt";
repo = pname;
rev = version;
2023-06-15 09:54:21 +00:00
hash = "sha256-/5wPv962ZHvZoZMOr4nMz7qcvbzlExRYS2nrnay/PU8=";
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 15:11:35 +00:00
scriptPath="export PATH=${lib.makeBinPath [ openssh ]}:\$PATH"
2020-11-01 15:00:59 +00:00
2022-06-26 15:11:35 +00: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";
2023-06-15 09:54:21 +00:00
changelog = "https://github.com/erikarvstedt/extra-container/blob/${version}/CHANGELOG.md";
2020-11-01 15:00:59 +00:00
license = licenses.mit;
platforms = platforms.linux;
maintainers = [ maintainers.erikarvstedt ];
2023-11-23 21:09:35 +00:00
mainProgram = "extra-container";
2020-11-01 15:00:59 +00:00
};
}