buda things
This commit is contained in:
parent
adaefcb7b4
commit
268673f04b
23 changed files with 1428 additions and 0 deletions
68
docker/nix/default.nix
Normal file
68
docker/nix/default.nix
Normal file
|
@ -0,0 +1,68 @@
|
|||
{ dockerTools
|
||||
, bashInteractive
|
||||
, cacert
|
||||
, coreutils
|
||||
, curl
|
||||
, gitReallyMinimal
|
||||
, gnutar
|
||||
, gzip
|
||||
, iana-etc
|
||||
, nix
|
||||
, openssh
|
||||
, xz
|
||||
, fromImage
|
||||
, extraContents ? [ ]
|
||||
, extraEnv ? [ ]
|
||||
}:
|
||||
let
|
||||
image = dockerTools.buildImageWithNixDb {
|
||||
inherit (nix) name;
|
||||
inherit fromImage;
|
||||
|
||||
contents = [
|
||||
./root
|
||||
coreutils
|
||||
# add /bin/sh
|
||||
bashInteractive
|
||||
nix
|
||||
|
||||
# runtime dependencies of nix
|
||||
cacert
|
||||
gitReallyMinimal
|
||||
gnutar
|
||||
gzip
|
||||
openssh
|
||||
xz
|
||||
|
||||
# for haskell binaries
|
||||
iana-etc
|
||||
] ++ extraContents;
|
||||
|
||||
extraCommands = ''
|
||||
# for /usr/bin/env
|
||||
mkdir usr
|
||||
ln -s ../bin usr/bin
|
||||
|
||||
# make sure /tmp exists
|
||||
mkdir -m 1777 tmp
|
||||
|
||||
# need a HOME
|
||||
mkdir -vp root
|
||||
'';
|
||||
|
||||
config = {
|
||||
Cmd = [ "/bin/bash" ];
|
||||
Env = [
|
||||
"ENV=/etc/profile.d/nix.sh"
|
||||
"BASH_ENV=/etc/profile.d/nix.sh"
|
||||
"NIX_BUILD_SHELL=/bin/bash"
|
||||
"NIX_PATH=nixpkgs=${./fake_nixpkgs}"
|
||||
"PAGER=cat"
|
||||
"PATH=/usr/bin:/bin"
|
||||
"SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||
"USER=root"
|
||||
] ++ extraEnv;
|
||||
};
|
||||
};
|
||||
in
|
||||
image // { meta = nix.meta // image.meta; }
|
Loading…
Add table
Add a link
Reference in a new issue