1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00
Commit graph

30 commits

Author SHA1 Message Date
Pol Dellaiera
e27a062783 docker: remove last use of pkgs.
Follow-up of https://github.com/NixOS/nix/pull/13354
2025-06-14 10:38:20 +02:00
Jörg Thalheim
82397e220d
Merge branch 'master' into push-rrzylpqynznw 2025-06-13 07:06:11 +02:00
Pol Dellaiera
6eb4ee6855 docker: replace git with gitMinimal 2025-06-12 19:50:52 +02:00
Pol Dellaiera
5862f38d00 docker: use callPackage, parametrise the image build 2025-06-12 19:50:31 +02:00
Pol Dellaiera
5abaf361a4 docker: reduce duplicates, use coreutils-full 2025-06-12 19:06:48 +02:00
Pol Dellaiera
57c72dee9b docker: make sure nix config check works 2025-06-12 11:01:17 +02:00
Eelco Dolstra
0a87ba0e39 Prevent double copy of nixpkgs source tree 2025-06-05 13:46:08 +02:00
PopeRigby
cfc15d6921 Modify docker.nix to use mapAttrsToList instead of mapAttrsFlatten
The latter alias is deprecated in favor of the former, and produces a
warning.
2025-06-03 13:26:09 -07:00
Vincent Breitmoser
6d0f174cd9
Reduce maxLayers to 70 in docker build
The nixos/nix docker image is built using `buildLayeredImage`, which spreads the nix store over a configured number of layers. This number was set to create an image with 100 layers. Because there is a limit of (typically) 127 layers in AUFS, this only left 27 layers to build on top. At the same time, nearly half of the created layers were only <100kb in size, many even <10kb, negating the intended advantage in cachability.

This commit moves the tradeoff a bit by reducing the number of layers to 70.

Layer sizes for the 2.28.3 nixos/nix image: https://hub.docker.com/layers/nixos/nix/2.28.3/images/sha256-d078d7153763895fce17c5fbbdeb86fcfcac414ca0ba875d413c1df57be19931
2025-05-08 09:56:14 +02:00
Robert Hensing
96e550efc5 Format .nix files
... with nixfmt (rfc style)
2025-01-24 17:04:02 +01:00
h0nIg
a5c7709f97
docker: Fix command "nix profile install", Don't require --impure 2024-11-27 13:24:46 +01:00
WxNzEMof
e194e27f85 docker: Allow building for non-root user
Add options uid, gid, uname, and gname to docker.nix.

Setting these to e.g. 1000, 1000, "user", "user" will build an image
which runs and allows using Nix as that user.
2024-11-10 20:34:08 +00:00
Markus S. Wamser
908bc9a957 fix "add an option to include flake-registry..."
commit 6dbce3215f was missing a pair of
parentheses
2023-05-16 14:35:31 +02:00
Alex Wied
6dbce3215f
docker.nix: add an option to include flake-registry inside docker image (#6750)
Co-authored-by: Alex Wied <centromere@users.noreply.github.com>
Co-authored-by: Rok Garbas <rok@floxdev.com>
2023-03-22 20:55:02 +01:00
Rok Garbas
46a6be28be Add nobody user/group to Nix docker image 2022-11-29 10:01:46 +00:00
Matthew Kenigsberg
02af02854d
dockerImage: fix root shell
Currently root's shell is set to a path that does not exist; this change
sets it to the correct path to bash
2022-09-14 16:20:58 -06:00
Alex Wied
0eb9946e1d docker.nix: Provide boolean for whether to bundle nixpkgs 2022-08-09 23:21:27 -04:00
Alex Wied
228028fc1a docker.nix: Allow Nix configuration to be customized 2022-07-28 03:36:39 -04:00
Alex Wied
07416a6005 Allow specification of extra packages, maxLayers in Docker image 2022-07-01 17:53:14 -04:00
Jairo Llopis
aa3927f0f1
feat: include openssh in docker image
When leveraging remote builders or cache in CI workloads, sometimes you need to configure nix to connect via SSH to a remote server.

It is the case for example when using nixbuild.net.

By including `openssh` package, CI should be able to reach remote builders when configured i.e. with environment variables.
2022-04-14 13:49:47 +01:00
John Axel Eriksson
84507daaaa docker: var/tmp make add -p option to mkdir to also create parent dirs 2022-01-15 14:11:37 +01:00
John Axel Eriksson
3fff0196cd docker: also create var/tmp as some tools rely on it 2022-01-15 10:20:18 +01:00
regnat
1dace02866 Add git to the docker image
Fix #5896

See https://github.com/NixOS/docker/issues/33
2022-01-14 15:55:36 +01:00
Sandro
9dd45dfc3d
Add iana-etc for /etc/protocols to default packages 2022-01-04 12:49:02 +01:00
Wolfgang Thaller
d9aabb7acb docker.nix: set correct permissions on /tmp 2022-01-01 16:47:05 +01:00
Rok Garbas
534bc5a3d1
Add cacert to /etc/ssl/certs in the docker image
Fixes #5797
2021-12-21 21:17:29 +01:00
John Axel Eriksson
6942ee8a84 docker: fix image so that nix profile works
nix profile will otherwise throw this error:

error: path '/nix/var/nix/profiles/default/manifest.nix' is not in the Nix store

That's not entirely true since manifest.nix is within a directory in
the nix store but nix profile seems to require the manifest.nix itself
to be a store path.
2021-12-16 11:29:05 +01:00
John Ericson
8368a8aff1 Make docker.nix match Nixpkgs's idioms
1. `target` is the wrong name, that is just for compilers per out
standard terminology. We just need to worry about "build" and "host".

2. We only need one `pkgs`. `pkgs.buildPackages` is how we get anything
we need at build time.

3. `crossSystem` is the name of a nixpkgs parameter that is actually an
attribute set, not a 2-part "cpu-os" string.

3. `pkgsCross` effectively evaluates Nixpkgs twice, which is
inefficient. It is just there for people poking around the CLI / REPL
(and I am skeptical even that is a good idea), and *not* what written
code should use, especially code that is merely parametric in the package set
it is given.

4. We don't need to memoize Nixpkgs here because we are only doing one
pkg set at a time (no `genAttrs`) so it's better to just delete all this
stuff. `flake.nix` instead would do something like that, with
`genAttrs` (though without `pkgsCross`), if and when we have hydra jobs
for cross builds.
2021-11-16 11:04:25 -05:00
Eelco Dolstra
c1bf9e39f1
docker.nix: Use 'with'
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-11-11 16:07:01 +01:00
Rok Garbas
93f7fb6e74
Docker image with Nix inside 2021-11-11 16:07:01 +01:00