-
Notifications
You must be signed in to change notification settings - Fork 16
/
default.nix
36 lines (30 loc) · 1.1 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ stdenv, lib, nixos-container, openssh, glibcLocales
, pkgSrc ? lib.cleanSource ./.
}:
stdenv.mkDerivation rec {
pname = "extra-container";
version = "0.13";
src = pkgSrc;
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
scriptPath="export PATH=${lib.makeBinPath [ openssh ]}:\$PATH"
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
'';
meta = with lib; {
description = "Run declarative containers without full system rebuilds";
homepage = "https://github.com/erikarvstedt/extra-container";
changelog = "https://github.com/erikarvstedt/extra-container/blob/master/CHANGELOG.md";
license = licenses.mit;
platforms = platforms.linux;
maintainers = [ maintainers.erikarvstedt ];
};
}