Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the base image compatible with common network services #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

let
inherit (pkgs) dockerTools stdenv buildEnv writeText;
inherit (pkgs) bashInteractive coreutils cacert nix openssh shadow;
inherit (pkgs) bashInteractive coreutils cacert nix openssh shadow iana-etc;

inherit (native.lib) concatStringsSep genList;

Expand Down Expand Up @@ -36,7 +36,7 @@ let
phases = [ "installPhase" "fixupPhase" ];

exportReferencesGraph =
map (drv: [("closure-" + baseNameOf drv) drv]) [ path cacert unstable ];
map (drv: [("closure-" + baseNameOf drv) drv]) [ path cacert iana-etc unstable ];

installPhase = ''
mkdir -p $out/run/current-system $out/var
Expand All @@ -46,11 +46,16 @@ let
mkdir -p $out/bin $out/usr/bin $out/sbin
ln -s ${stdenv.shell} $out/bin/sh
ln -s ${coreutils}/bin/env $out/usr/bin/env
ln -s ${bashInteractive}/bin/bash $out/bin/bash
ln -s ${bashInteractive}/bin/bash $out/usr/bin/bash
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't exist on a nixos system either.


mkdir -p $out/etc
echo '${passwd}' > $out/etc/passwd
echo '${group}' > $out/etc/group
echo '${nsswitch}' > $out/etc/nsswitch.conf
ln -s ${iana-etc}/etc/protocols $out/etc/
ln -s ${iana-etc}/etc/services $out/etc/
ln -s ${cacert}/etc/ssl $out/etc/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libraries like openssl honor NIX_SSL_CERT_FILE which is set, this should't be necessary.


printRegistration=1 ${pkgs.perl}/bin/perl ${pkgs.pathsFromGraph} closure-* > $out/.reginfo
'';
Expand All @@ -69,6 +74,7 @@ let
"NIX_PATH=nixpkgs=${unstable}"
"GIT_SSL_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt"
"SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt"
"USER=root"
];
};

Expand Down