mirror of
https://gitlab.com/TECHNOFAB/coder-templates.git
synced 2025-12-12 02:00:11 +01:00
chore(image): create various directories, add normal bash and git and switch to layered image
This commit is contained in:
parent
5ac20ae506
commit
8fd40e2e6e
1 changed files with 13 additions and 3 deletions
16
image.nix
16
image.nix
|
|
@ -3,30 +3,40 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
pkgs.dockerTools.buildImage {
|
pkgs.dockerTools.buildLayeredImage {
|
||||||
name = "nix-coder";
|
name = "nix-coder";
|
||||||
tag = "latest";
|
tag = "latest";
|
||||||
|
|
||||||
copyToRoot = pkgs.buildEnv {
|
contents = pkgs.buildEnv {
|
||||||
name = "image-root";
|
name = "image-root";
|
||||||
paths = [
|
paths = [
|
||||||
|
pkgs.bash
|
||||||
pkgs.bashInteractive
|
pkgs.bashInteractive
|
||||||
pkgs.nixFlakes
|
pkgs.nix
|
||||||
pkgs.coreutils-full
|
pkgs.coreutils-full
|
||||||
|
pkgs.git
|
||||||
pkgs.curl
|
pkgs.curl
|
||||||
pkgs.home-manager
|
pkgs.home-manager
|
||||||
pkgs.direnv
|
pkgs.direnv
|
||||||
(pkgs.writeTextDir "etc/nix/nix.conf" "experimental-features = nix-command flakes")
|
(pkgs.writeTextDir "etc/nix/nix.conf" "experimental-features = nix-command flakes")
|
||||||
(pkgs.writeTextDir "etc/passwd" "coder:x:1000:1000::/home/coder:/bin/bash")
|
(pkgs.writeTextDir "etc/passwd" "coder:x:1000:1000::/home/coder:/bin/bash")
|
||||||
|
(pkgs.writeTextDir "etc/shadow" "coder:!:::::::")
|
||||||
|
(pkgs.writeTextDir "etc/group" "coder:x:1000:")
|
||||||
|
(pkgs.writeTextDir "etc/gshadow" "coder:x::")
|
||||||
];
|
];
|
||||||
pathsToLink = ["/bin" "/etc"];
|
pathsToLink = ["/bin" "/etc"];
|
||||||
};
|
};
|
||||||
|
maxLayers = 5;
|
||||||
|
|
||||||
|
fakeRootCommands = ''
|
||||||
|
mkdir -p ./home/coder ./tmp ./nix/var/nix
|
||||||
|
'';
|
||||||
config = {
|
config = {
|
||||||
Cmd = ["/bin/bash"];
|
Cmd = ["/bin/bash"];
|
||||||
Env = [
|
Env = [
|
||||||
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
|
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||||
"HOME=/home/coder"
|
"HOME=/home/coder"
|
||||||
|
"USER=coder"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue