Skip to content

Commit

Permalink
include /etc/{passwd,group,nsswitch.conf} into resources (NixOS#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
dingxiangfei2009 committed May 22, 2019
1 parent 6656603 commit d2d7f4a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@ let
"GIT_SSL_CAINFO=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
];
extraCommands = ''
chmod +w etc
cat >etc/passwd <<EOF
root:x:0:0::/root:/bin/sh
EOF
cat >etc/group <<EOF
root:x:0:
EOF
cat >etc/nsswitch.conf <<EOF
hosts: files dns
EOF
'';
};

dir =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let
paths = with pkgs; [
bashInteractive
cacert
coreutils
busybox
docker
gawk
git
Expand All @@ -39,14 +39,6 @@ let
postBuild = ''
mkdir -p $out/root $out/opt/resource
cp -a ${src}/assets/. $out/opt/resource/
cat >$out/etc/gitconfig <<EOF
[user]
email = git@localhost
name = git
[http]
sslcainfo = ${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
EOF
'';
};

Expand All @@ -60,6 +52,26 @@ let
"GIT_SSL_CAINFO=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
];
extraCommands = ''
chmod +w etc
cat >etc/gitconfig <<EOF
[user]
email = git@localhost
name = git
[http]
sslcainfo = ${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
EOF
cat >etc/passwd <<EOF
root:x:0:0::/root:/bin/sh
EOF
cat >etc/group <<EOF
root:x:0:
EOF
cat >etc/nsswitch.conf <<EOF
hosts: files dns
EOF
'';
};

dir =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ let
"GIT_SSL_CAINFO=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
];
extraCommands = ''
chmod +w etc
cat >etc/passwd <<EOF
root:x:0:0::/root:/bin/sh
EOF
cat >etc/group <<EOF
root:x:0:
EOF
cat >etc/nsswitch.conf <<EOF
hosts: files dns
EOF
'';
};

dir =
Expand Down

0 comments on commit d2d7f4a

Please sign in to comment.