mirror of
https://gitlab.com/TECHNOFAB/coder-templates.git
synced 2025-12-11 17:50:06 +01:00
fix(image): set ownership of most image contents to 1000:1000 to fix permission issues
This commit is contained in:
parent
67f5115048
commit
058e2f73e8
1 changed files with 10 additions and 2 deletions
12
image.nix
12
image.nix
|
|
@ -20,7 +20,9 @@ pkgs.dockerTools.buildLayeredImage {
|
|||
(pkgs.writeShellScriptBin "reload-dotfiles" ''
|
||||
${pkgs.home-manager}/bin/home-manager switch --flake ''${DOTFILES_REPO:-$1}
|
||||
'')
|
||||
(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/shadow" "coder:!:::::::")
|
||||
(pkgs.writeTextDir "etc/group" "coder:x:1000:")
|
||||
|
|
@ -30,11 +32,17 @@ pkgs.dockerTools.buildLayeredImage {
|
|||
};
|
||||
maxLayers = 5;
|
||||
|
||||
uid = 1000;
|
||||
gid = 1000;
|
||||
fakeRootCommands = ''
|
||||
mkdir -p ./home/coder ./tmp ./nix/var/nix
|
||||
mkdir -p /home/coder /tmp /nix/var/nix
|
||||
chown -R 1000:1000 /
|
||||
'';
|
||||
enableFakechroot = true;
|
||||
|
||||
config = {
|
||||
Cmd = ["/bin/bash"];
|
||||
User = "1000:1000";
|
||||
Env = [
|
||||
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||
"HOME=/home/coder"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue