1 { stdenv, lib, nixos-container, openssh, glibcLocales, fetchFromGitHub }:
3 stdenv.mkDerivation rec {
4 pname = "extra-container";
7 src = fetchFromGitHub {
8 owner = "erikarvstedt";
11 hash = "sha256-/5wPv962ZHvZoZMOr4nMz7qcvbzlExRYS2nrnay/PU8=";
15 install -D $src/extra-container $out/bin/extra-container
16 patchShebangs $out/bin
17 share=$out/share/extra-container
18 install $src/eval-config.nix -Dt $share
20 # Use existing PATH for systemctl and machinectl
21 scriptPath="export PATH=${lib.makeBinPath [ openssh ]}:\$PATH"
24 s|evalConfig=.*|evalConfig=$share/eval-config.nix|
25 s|LOCALE_ARCHIVE=.*|LOCALE_ARCHIVE=${glibcLocales}/lib/locale/locale-archive|
27 2inixosContainer=${nixos-container}/bin
28 " $out/bin/extra-container
32 description = "Run declarative containers without full system rebuilds";
33 homepage = "https://github.com/erikarvstedt/extra-container";
34 changelog = "https://github.com/erikarvstedt/extra-container/blob/${version}/CHANGELOG.md";
35 license = licenses.mit;
36 platforms = platforms.linux;
37 maintainers = [ maintainers.erikarvstedt ];
38 mainProgram = "extra-container";