41 Commits
master ... main

Author SHA1 Message Date
zimbatm
10b83cdcf1 ci: rename default branch from master to main 2025-12-02 16:41:38 +01:00
zimbatm
87459791ee README: update with mdsh 2025-12-02 15:05:08 +01:00
tomf
43fa5dba61 images/yarr: init (#98) 2025-12-02 15:03:13 +01:00
con-f-use
56ab7ed989 Add support for 25.11 (#101)
Closes #100

Co-authored-by: Jan Christoph Bischko <jbischko@barracuda.com>
2025-12-02 15:02:44 +01:00
dependabot[bot]
5db385d3d2 build(deps): bump actions/checkout from 5 to 6 (#99)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 16:42:14 +01:00
dependabot[bot]
cf8a38eded build(deps): bump actions/checkout from 4 to 5 (#96)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-22 16:53:07 +02:00
MiggL
369f75c190 Update nix version in nix-unstable-static to 2.30.3 (#97)
Fixes #92
2025-10-22 16:52:54 +02:00
zimbatm
64a3352bbf drop old 24.xx channels
CI is breaking
2025-08-10 08:50:06 +02:00
Cobalt
9a5876396f images/attic: init (#95)
Crate image with attic-client.
2025-08-10 08:47:03 +02:00
tomf
96c221d72c images/pocket-id: init (#93) 2025-07-01 13:31:24 +02:00
tomf
02f2b05be8 maddy: init (#94) 2025-07-01 13:31:00 +02:00
erikarvstedt
98e0048215 nix.conf: enable parallel building (#90)
This is a sensible default given Docker images are often used for CI and build jobs.
2025-06-04 16:19:54 +02:00
Jonas Chevalier
074dd32ad1 Merge pull request #89 from so-lar-is/master
Add support for 25.05
2025-06-04 16:18:35 +02:00
me@so.lar.is
fe1eb377ed Add support for 25.05 2025-05-26 14:49:22 +02:00
Jonas Chevalier
8fdb8770b3 Merge pull request #86 from generative-engineering/24.11
🆕 Target 24.11 too, now that it's out and non-beta
2024-12-05 15:24:07 +01:00
Nick Boultbee
8fab1455c9 Fix iproute -> iproute2 2024-12-02 15:00:03 +00:00
Nick Boultbee
f2d5bd9472 Fix deprecated nix versions vars 2024-12-02 14:59:59 +00:00
Nick Boultbee
35b2808180 🆕 Target 24.11 too, now that it's out and non-beta 2024-12-02 12:35:27 +00:00
Jonas Chevalier
bccad7f19e Revert "images are on docker hub (#82)" (#84)
This reverts commit 783f5a2444.
2024-08-06 21:42:30 +02:00
Paul Haerle
8e9c7e7c00 build linux images on darwin (#83)
The assert in pkgs.nix currently just throws if you try to build on
darwin. As there's no such thing as darwin in a container, I believe
it should be safe to assume that people want to build linux containers.

This defaults to the current platform, but still lets users specify
system to i.e. build x86_64-linux containers from an aarch64-darwin host.
2024-08-05 08:46:14 +02:00
Jonas Chevalier
0ce26f2035 ci: also publish to GitHub Packages (#54)
Allow Github users to not have another external dependency.
2024-07-24 13:53:51 +02:00
zimbatm
3edc0c92e1 ci: remove unsupported 23.05 and 23.11 channels 2024-07-23 16:02:11 +02:00
Domen Kožar
783f5a2444 images are on docker hub (#82) 2024-07-23 15:17:52 +02:00
Domen Kožar
891a767f37 add devenv image (#81) 2024-07-16 08:30:16 +02:00
Manuel
e7ea2bae4f [nix-flakes] add ~/.nix-profile/bin to PATH (#51)
See https://github.com/nix-community/docker-nixpkgs/issues/50
2024-06-08 08:30:40 +02:00
Domen Kožar
2e4deab4ce 24.05 (#80) 2024-06-08 08:29:23 +02:00
zimbatm
f6b4921246 nix-unstable: use nixVersions.latest by default
Release management has changed a bit and there is no nixUnstable
anymore.
2024-06-08 08:28:26 +02:00
Jonas Chevalier
bfac57f186 Merge pull request #77 from Scrumplex/aarch64-support-manifest
Generate multi-arch image manifests
2024-03-08 10:09:44 +01:00
Sefa Eyeoglu
1d40cd2059 Generate multi-arch image manifests
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-03-07 21:42:03 +01:00
Sefa Eyeoglu
16594d72d5 Bump shell.nix channel to 23.11
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-03-07 19:14:41 +01:00
Jonas Chevalier
88be071d17 Merge pull request #75 from Scrumplex/aarch64-support
Add aarch64 support
2024-03-07 15:59:07 +01:00
Sefa Eyeoglu
df76ac6e21 Add magic-nix-cache
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-03-07 13:15:35 +01:00
Sefa Eyeoglu
87327a573a Add aarch64 support
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-03-07 13:04:03 +01:00
dependabot[bot]
d08f067665 build(deps): bump cachix/install-nix-action from 24 to 25 (#74)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 24 to 25.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v24...v25)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-15 09:24:07 +01:00
dependabot[bot]
281a8d55c4 build(deps): bump cachix/install-nix-action from 23 to 24 (#72)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 23 to 24.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v23...v24)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-04 09:57:28 +01:00
erikarvstedt
fdaa456015 update to nixos-23.05 (#71) 2023-12-02 12:06:55 +01:00
Narek Asadorian
ce8ad614ce Fix broken link in error message (#70) 2023-11-28 12:07:05 +01:00
Jörg Thalheim
da4cebebdc Merge pull request #67 from nix-community/dependabot/github_actions/cachix/install-nix-action-23
build(deps): bump cachix/install-nix-action from 22 to 23
2023-09-11 13:11:21 +02:00
dependabot[bot]
9d83e5f909 build(deps): bump cachix/install-nix-action from 22 to 23
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 22 to 23.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v22...v23)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 10:57:23 +00:00
Jörg Thalheim
099ec84f5d Merge pull request #68 from nix-community/dependabot/github_actions/actions/checkout-4
build(deps): bump actions/checkout from 3 to 4
2023-09-11 12:56:32 +02:00
dependabot[bot]
50f172c442 build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 04:51:23 +00:00
25 changed files with 230 additions and 48 deletions

View File

@@ -2,12 +2,13 @@ name: Nix
on: on:
push: push:
branches: branches:
- master - main
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
schedule: schedule:
# Run once per day # Run once per day
- cron: '0 0 * * *' - cron: '0 0 * * *'
jobs: jobs:
build: build:
strategy: strategy:
@@ -16,14 +17,66 @@ jobs:
matrix: matrix:
channel: channel:
- nixos-unstable - nixos-unstable
- nixos-22.11 - nixos-25.05
- nixos-23.05 - nixos-25.11
runs-on: native system:
container: pjjw/nix-flake-runner:1 - aarch64-linux
- x86_64-linux
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v6
- run: nix-shell --run ./ci.sh - name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
extra-platforms = aarch64-linux
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Push to Docker Hub
run: nix-shell --run ./ci.sh
env: env:
CI_PROJECT_PATH: pjjw CI_PROJECT_PATH: 'nixpkgs'
CI_REGISTRY: 'docker.io'
CI_REGISTRY_AUTH: '${{ secrets.REGISTRY_AUTH }}' CI_REGISTRY_AUTH: '${{ secrets.REGISTRY_AUTH }}'
NIXPKGS_CHANNEL: '${{ matrix.channel }}' NIXPKGS_CHANNEL: '${{ matrix.channel }}'
NIX_SYSTEM_NAME: '${{ matrix.system }}'
- name: Push to GitHub Pages
run: nix-shell --run ./ci.sh
env:
CI_PROJECT_PATH: 'nix-community/docker-nixpkgs'
CI_REGISTRY: 'ghcr.io'
CI_REGISTRY_AUTH: '${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}'
NIXPKGS_CHANNEL: '${{ matrix.channel }}'
NIX_SYSTEM_NAME: '${{ matrix.system }}'
push-manifest:
needs: [build]
strategy:
fail-fast: false
matrix:
channel:
- nixos-unstable
- nixos-25.05
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
extra-platforms = aarch64-linux
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix-shell --run ./ci-manifests.sh
env:
CI_REGISTRY_AUTH: '${{ secrets.REGISTRY_AUTH }}'
NIXPKGS_CHANNEL: '${{ matrix.channel }}'
NIX_SYSTEM_NAME: '${{ matrix.system }}'

View File

@@ -3,12 +3,12 @@ stages:
build: build:
stage: build stage: build
image: nixpkgs/nix:nixos-22.11 image: nixpkgs/nix:nixos-25.05
script: nix-shell --run ./ci.sh script: nix-shell --run ./ci.sh
parallel: parallel:
matrix: matrix:
- NIXPKGS_CHANNEL: nixos-unstable - NIXPKGS_CHANNEL: nixos-unstable
IMAGE_TAG: latest IMAGE_TAG: latest
- NIXPKGS_CHANNEL: - NIXPKGS_CHANNEL:
- nixos-22.11 - nixos-25.05
- nixos-23.05 - nixos-25.11

View File

@@ -39,8 +39,8 @@ nixpkgs channel describes.
| Channel | Image Tag | Description | | Channel | Image Tag | Description |
| --- | --- | --- | | --- | --- | --- |
| nixos-22.11 | nixos-22.11 | only minor versions that include security updates | | nixos-25.05 | nixos-25.05 | only minor versions that include security updates |
| nixos-23.05 | nixos-23.05 | only minor versions that include security updates | | nixos-25.11 | nixos-25.11 | only minor versions that include security updates |
| nixos-unstable | latest | latest and greatest, major versions might change | | nixos-unstable | latest | latest and greatest, major versions might change |
## List of images ## List of images
@@ -52,9 +52,11 @@ All images are automatically built and published to Docker Hub, and served
on our custom domain, courtesy of [Scarf](https://scarf.sh). on our custom domain, courtesy of [Scarf](https://scarf.sh).
`> ./readme-image-matrix` `> ./readme-image-matrix`
<!-- BEGIN mdsh --> <!-- BEGIN mdsh -->
| Image / Tag | Pull | | Image / Tag | Pull |
| --- | --- | | --- | --- |
| [nixpkgs/attic](https://hub.docker.com/r/nixpkgs/attic)| `docker pull docker.nix-community.org/nixpkgs/attic` |
| [nixpkgs/bash](https://hub.docker.com/r/nixpkgs/bash)| `docker pull docker.nix-community.org/nixpkgs/bash` | | [nixpkgs/bash](https://hub.docker.com/r/nixpkgs/bash)| `docker pull docker.nix-community.org/nixpkgs/bash` |
| [nixpkgs/busybox](https://hub.docker.com/r/nixpkgs/busybox)| `docker pull docker.nix-community.org/nixpkgs/busybox` | | [nixpkgs/busybox](https://hub.docker.com/r/nixpkgs/busybox)| `docker pull docker.nix-community.org/nixpkgs/busybox` |
| [nixpkgs/cachix](https://hub.docker.com/r/nixpkgs/cachix)| `docker pull docker.nix-community.org/nixpkgs/cachix` | | [nixpkgs/cachix](https://hub.docker.com/r/nixpkgs/cachix)| `docker pull docker.nix-community.org/nixpkgs/cachix` |
@@ -62,15 +64,19 @@ on our custom domain, courtesy of [Scarf](https://scarf.sh).
| [nixpkgs/caddy](https://hub.docker.com/r/nixpkgs/caddy)| `docker pull docker.nix-community.org/nixpkgs/caddy` | | [nixpkgs/caddy](https://hub.docker.com/r/nixpkgs/caddy)| `docker pull docker.nix-community.org/nixpkgs/caddy` |
| [nixpkgs/curl](https://hub.docker.com/r/nixpkgs/curl)| `docker pull docker.nix-community.org/nixpkgs/curl` | | [nixpkgs/curl](https://hub.docker.com/r/nixpkgs/curl)| `docker pull docker.nix-community.org/nixpkgs/curl` |
| [nixpkgs/devcontainer](https://hub.docker.com/r/nixpkgs/devcontainer)| `docker pull docker.nix-community.org/nixpkgs/devcontainer` | | [nixpkgs/devcontainer](https://hub.docker.com/r/nixpkgs/devcontainer)| `docker pull docker.nix-community.org/nixpkgs/devcontainer` |
| [nixpkgs/devenv](https://hub.docker.com/r/nixpkgs/devenv)| `docker pull docker.nix-community.org/nixpkgs/devenv` |
| [nixpkgs/docker-compose](https://hub.docker.com/r/nixpkgs/docker-compose)| `docker pull docker.nix-community.org/nixpkgs/docker-compose` | | [nixpkgs/docker-compose](https://hub.docker.com/r/nixpkgs/docker-compose)| `docker pull docker.nix-community.org/nixpkgs/docker-compose` |
| [nixpkgs/hugo](https://hub.docker.com/r/nixpkgs/hugo)| `docker pull docker.nix-community.org/nixpkgs/hugo` | | [nixpkgs/hugo](https://hub.docker.com/r/nixpkgs/hugo)| `docker pull docker.nix-community.org/nixpkgs/hugo` |
| [nixpkgs/kubectl](https://hub.docker.com/r/nixpkgs/kubectl)| `docker pull docker.nix-community.org/nixpkgs/kubectl` | | [nixpkgs/kubectl](https://hub.docker.com/r/nixpkgs/kubectl)| `docker pull docker.nix-community.org/nixpkgs/kubectl` |
| [nixpkgs/kubernetes-helm](https://hub.docker.com/r/nixpkgs/kubernetes-helm)| `docker pull docker.nix-community.org/nixpkgs/kubernetes-helm` | | [nixpkgs/kubernetes-helm](https://hub.docker.com/r/nixpkgs/kubernetes-helm)| `docker pull docker.nix-community.org/nixpkgs/kubernetes-helm` |
| [nixpkgs/maddy](https://hub.docker.com/r/nixpkgs/maddy)| `docker pull docker.nix-community.org/nixpkgs/maddy` |
| [nixpkgs/nginx](https://hub.docker.com/r/nixpkgs/nginx)| `docker pull docker.nix-community.org/nixpkgs/nginx` | | [nixpkgs/nginx](https://hub.docker.com/r/nixpkgs/nginx)| `docker pull docker.nix-community.org/nixpkgs/nginx` |
| [nixpkgs/nix](https://hub.docker.com/r/nixpkgs/nix)| `docker pull docker.nix-community.org/nixpkgs/nix` | | [nixpkgs/nix](https://hub.docker.com/r/nixpkgs/nix)| `docker pull docker.nix-community.org/nixpkgs/nix` |
| [nixpkgs/nix-flakes](https://hub.docker.com/r/nixpkgs/nix-flakes)| `docker pull docker.nix-community.org/nixpkgs/nix-flakes` | | [nixpkgs/nix-flakes](https://hub.docker.com/r/nixpkgs/nix-flakes)| `docker pull docker.nix-community.org/nixpkgs/nix-flakes` |
| [nixpkgs/nix-unstable](https://hub.docker.com/r/nixpkgs/nix-unstable)| `docker pull docker.nix-community.org/nixpkgs/nix-unstable` | | [nixpkgs/nix-unstable](https://hub.docker.com/r/nixpkgs/nix-unstable)| `docker pull docker.nix-community.org/nixpkgs/nix-unstable` |
| [nixpkgs/nix-unstable-static](https://hub.docker.com/r/nixpkgs/nix-unstable-static)| `docker pull docker.nix-community.org/nixpkgs/nix-unstable-static` | | [nixpkgs/nix-unstable-static](https://hub.docker.com/r/nixpkgs/nix-unstable-static)| `docker pull docker.nix-community.org/nixpkgs/nix-unstable-static` |
| [nixpkgs/pocket-id](https://hub.docker.com/r/nixpkgs/pocket-id)| `docker pull docker.nix-community.org/nixpkgs/pocket-id` |
| [nixpkgs/yarr](https://hub.docker.com/r/nixpkgs/yarr)| `docker pull docker.nix-community.org/nixpkgs/yarr` |
<!-- END mdsh --> <!-- END mdsh -->
## Adding new images ## Adding new images

39
ci-manifests.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/env bash
#
# CI specific build script.
#
set -euo pipefail
channel=${NIXPKGS_CHANNEL:-nixos-unstable}
registry=${CI_REGISTRY:-docker.io}
registry_auth=${CI_REGISTRY_AUTH:-}
image_prefix=${CI_PROJECT_PATH:-nixpkgs}
if [[ $channel == nixos-unstable ]]; then
image_tag=latest
else
image_tag=$channel
fi
export NIX_PATH=channel:$channel
banner() {
echo "========================================================"
echo " $*"
echo "========================================================"
}
cd "$(dirname "$0")"
if [[ $(git rev-parse --abbrev-ref HEAD) != main ]]; then
banner "Skipping push on non-main branch"
exit
fi
if [[ -n "${registry_auth}" ]]; then
banner "docker login"
./docker-login "$registry_auth" "$registry"
fi
banner "generate manifests"
./generate-manifests "$registry" "$image_prefix" "$image_tag"

6
ci.sh
View File

@@ -8,6 +8,7 @@ channel=${NIXPKGS_CHANNEL:-nixos-unstable}
registry=${CI_REGISTRY:-docker.io} registry=${CI_REGISTRY:-docker.io}
registry_auth=${CI_REGISTRY_AUTH:-} registry_auth=${CI_REGISTRY_AUTH:-}
image_prefix=${CI_PROJECT_PATH:-nixpkgs} image_prefix=${CI_PROJECT_PATH:-nixpkgs}
system_name=${NIX_SYSTEM_NAME:-x86_64-linux}
if [[ $channel == nixos-unstable ]]; then if [[ $channel == nixos-unstable ]]; then
image_tag=latest image_tag=latest
@@ -30,9 +31,10 @@ banner "Building images"
nix-build \ nix-build \
--no-out-link \ --no-out-link \
--option sandbox true \ --option sandbox true \
--argstr system "$system_name"
if [[ $(git rev-parse --abbrev-ref HEAD) != master ]]; then if [[ $(git rev-parse --abbrev-ref HEAD) != main ]]; then
banner "Skipping push on non-master branch" banner "Skipping push on non-main branch"
exit exit
fi fi

View File

@@ -1,4 +1,14 @@
let {
pkgs = import ./pkgs.nix; system ? builtins.currentSystem
}: let
_parts = builtins.split "-" system;
arch = builtins.elemAt _parts 0;
os = builtins.elemAt _parts 2;
system' =
if os == "darwin"
then "${arch}-linux"
else system;
pkgs =
import ./pkgs.nix system';
in in
pkgs.docker-nixpkgs pkgs.docker-nixpkgs

View File

@@ -8,9 +8,10 @@ set -euo pipefail
user=$1 user=$1
org=${2:-nixpkgs} org=${2:-nixpkgs}
system_name=${NIX_SYSTEM_NAME:-x86_64-linux}
nix_eval() { nix_eval() {
nix-instantiate --strict --eval --json "$@" nix-instantiate --strict --eval --argstr system "$system_name" --json "$@"
} }
releases_json=$(nix_eval) releases_json=$(nix_eval)

25
generate-manifests Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
#
# Usage: ./push-all <registry> <image-prefix> <image-tag>
set -euo pipefail
registry=${1:-docker.io}
image_prefix=${2:-nixpkgs}
image_tag=${3:-latest}
system_name=${NIX_SYSTEM_NAME:-x86_64-linux}
releases_json=$(nix-instantiate --strict --argstr system "$system_name" --eval --json)
echo "=== Generating manifests for $registry"
for attr in $(echo "$releases_json" | jq -r "keys[]") ; do
repository=$registry/$image_prefix/$attr
target_image=${repository}:${image_tag}
echo "--- attr=$attr target=$target_image"
podman manifest create "$target_image"
podman manifest add "$target_image" "docker://$repository:${image_tag}-x86_64-linux"
podman manifest add "$target_image" "docker://$repository:${image_tag}-aarch64-linux"
podman manifest push --all "$target_image" "docker://$target_image"
done
echo OK

10
images/attic/default.nix Normal file
View File

@@ -0,0 +1,10 @@
{ docker-nixpkgs
, attic-client
}:
(docker-nixpkgs.nix.override {
extraContents = [ attic-client ];
}).overrideAttrs (prev: {
meta = (prev.meta or { }) // {
description = "Nix and Attic client image";
};
})

View File

@@ -14,7 +14,7 @@
, gnutar , gnutar
, gzip , gzip
, iana-etc , iana-etc
, iproute , iproute2
, less , less
, lib , lib
, nix , nix
@@ -42,7 +42,11 @@ let
nix nix
# runtime dependencies of nix # runtime dependencies of nix
cacert # HACK: don't include the "hashed" output. It has overlapping files with
# the "unbundled" output, and that breaks the build.
(cacert // {
outputs = builtins.filter (x: x != "hashed") cacert.outputs;
})
gitReallyMinimal gitReallyMinimal
gnutar gnutar
gzip gzip
@@ -61,7 +65,7 @@ let
(gcc-unwrapped // { (gcc-unwrapped // {
outputs = builtins.filter (x: x != "libgcc") gcc-unwrapped.outputs; outputs = builtins.filter (x: x != "libgcc") gcc-unwrapped.outputs;
}) })
iproute iproute2
]; ];
}; };
@@ -126,7 +130,7 @@ let
]; ];
Labels = { Labels = {
# https://github.com/microscaling/microscaling/blob/55a2d7b91ce7513e07f8b1fd91bbed8df59aed5a/Dockerfile#L22-L33 # https://github.com/microscaling/microscaling/blob/55a2d7b91ce7513e07f8b1fd91bbed8df59aed5a/Dockerfile#L22-L33
"org.label-schema.vcs-ref" = "master"; "org.label-schema.vcs-ref" = "main";
"org.label-schema.vcs-url" = "https://github.com/nix-community/docker-nixpkgs"; "org.label-schema.vcs-url" = "https://github.com/nix-community/docker-nixpkgs";
}; };
}; };

11
images/devenv/default.nix Normal file
View File

@@ -0,0 +1,11 @@
{ docker-nixpkgs
, devenv ? null
}:
(docker-nixpkgs.nix.override {
# only available since 24.05
extraContents = [ devenv ];
}).overrideAttrs (prev: {
meta = (prev.meta or { }) // {
description = "Nix and devenv image";
};
})

6
images/maddy/default.nix Normal file
View File

@@ -0,0 +1,6 @@
{ buildCLIImage
, maddy
}:
buildCLIImage {
drv = maddy;
}

View File

@@ -1,10 +0,0 @@
{ docker-nixpkgs
, nodejs
, extraContents ? [ ]
}:
docker-nixpkgs.nix-flakes.override {
extraContents = [
# nodejs for runner
nodejs
] ++ extraContents;
}

View File

@@ -1,10 +1,10 @@
{ docker-nixpkgs { docker-nixpkgs
, nixFlakes , nixVersions
, writeTextFile , writeTextFile
, extraContents ? [ ] , extraContents ? [ ]
}: }:
docker-nixpkgs.nix.override { docker-nixpkgs.nix.override {
nix = nixFlakes; nix = nixVersions.stable;
extraContents = [ extraContents = [
(writeTextFile { (writeTextFile {
name = "nix.conf"; name = "nix.conf";
@@ -12,7 +12,12 @@ docker-nixpkgs.nix.override {
text = '' text = ''
accept-flake-config = true accept-flake-config = true
experimental-features = nix-command flakes experimental-features = nix-command flakes
max-jobs = auto
''; '';
}) })
] ++ extraContents; ] ++ extraContents;
extraEnv = [
"PATH=/root/.nix-profile/bin:/usr/bin:/bin" # Not sure how to just prepend
];
} }

View File

@@ -19,8 +19,8 @@ let
# Get nix from Hydra because the nixpkgs one is not fully static # Get nix from Hydra because the nixpkgs one is not fully static
nixStaticBin = fetchurl { nixStaticBin = fetchurl {
url = "https://hydra.nixos.org/build/181573550/download/1/nix"; url = "https://hydra.nixos.org/build/305222051/download/1/nix";
hash = "sha256-zO2xJhQIrLtL/ReTlcorjwsaTO1W5Rnr+sXwcLcujok="; hash = "sha256-OahnvQ/OKnRhbXaIJ7iEQYu86ECGtUqwW8XrryVkXaM=";
}; };
nixSymlinks = [ nixSymlinks = [
@@ -84,11 +84,12 @@ let
mkdir -p libexec/nix mkdir -p libexec/nix
ln -s /bin/nix libexec/nix/build-remote ln -s /bin/nix libexec/nix/build-remote
# Enable flakes # Enable flakes and parallel building
mkdir -p etc/nix mkdir -p etc/nix
cat <<NIX_CONFIG > etc/nix/nix.conf cat <<NIX_CONFIG > etc/nix/nix.conf
accept-flake-config = true accept-flake-config = true
experimental-features = nix-command flakes experimental-features = nix-command flakes
max-jobs = auto
NIX_CONFIG NIX_CONFIG
# Add run-as-user script # Add run-as-user script

View File

@@ -1,6 +1,6 @@
{ docker-nixpkgs { docker-nixpkgs
, nixUnstable , pkgs
}: }:
docker-nixpkgs.nix.override { docker-nixpkgs.nix.override {
nix = nixUnstable; nix = pkgs.nixVersions.latest;
} }

View File

@@ -11,6 +11,7 @@
, openssh , openssh
, xz , xz
, extraContents ? [ ] , extraContents ? [ ]
, extraEnv ? [ ]
}: }:
let let
image = dockerTools.buildImageWithNixDb { image = dockerTools.buildImageWithNixDb {
@@ -58,7 +59,7 @@ let
"PATH=/usr/bin:/bin" "PATH=/usr/bin:/bin"
"SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt" "SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt"
"USER=root" "USER=root"
]; ] ++ extraEnv;
}; };
}; };
in in

View File

@@ -3,7 +3,7 @@ throw ''
This container doesn't include nixpkgs. This container doesn't include nixpkgs.
The best way to work around that is to pin your dependencies. See The best way to work around that is to pin your dependencies. See
https://nix.dev/tutorials/towards-reproducibility-pinning-nixpkgs.html https://nix.dev/tutorials/first-steps/towards-reproducibility-pinning-nixpkgs.html
Or if you must, override the NIX_PATH environment variable with eg: Or if you must, override the NIX_PATH environment variable with eg:
"NIX_PATH=nixpkgs=channel:nixos-unstable" "NIX_PATH=nixpkgs=channel:nixos-unstable"

View File

@@ -0,0 +1,6 @@
{ buildCLIImage
, pocket-id
}:
buildCLIImage {
drv = pocket-id;
}

6
images/yarr/default.nix Normal file
View File

@@ -0,0 +1,6 @@
{ buildCLIImage
, yarr
}:
buildCLIImage {
drv = yarr;
}

View File

@@ -28,7 +28,7 @@ let
]; ];
Labels = { Labels = {
# https://github.com/microscaling/microscaling/blob/55a2d7b91ce7513e07f8b1fd91bbed8df59aed5a/Dockerfile#L22-L33 # https://github.com/microscaling/microscaling/blob/55a2d7b91ce7513e07f8b1fd91bbed8df59aed5a/Dockerfile#L22-L33
"org.label-schema.vcs-ref" = "master"; "org.label-schema.vcs-ref" = "main";
"org.label-schema.vcs-url" = "https://github.com/nix-community/docker-nixpkgs"; "org.label-schema.vcs-url" = "https://github.com/nix-community/docker-nixpkgs";
}; };
}; };

View File

@@ -1,7 +1,9 @@
import <nixpkgs> { system:
# docker images run on Linux # docker images run on Linux
system = "x86_64-linux"; assert builtins.elem system ["x86_64-linux" "aarch64-linux"];
import <nixpkgs> {
config = { }; config = { };
inherit system;
overlays = [ overlays = [
(import ./overlay.nix) (import ./overlay.nix)
]; ];

View File

@@ -6,15 +6,16 @@ set -euo pipefail
registry=${1:-docker.io} registry=${1:-docker.io}
image_prefix=${2:-nixpkgs} image_prefix=${2:-nixpkgs}
image_tag=${3:-latest} image_tag=${3:-latest}
system_name=${NIX_SYSTEM_NAME:-x86_64-linux}
releases_json=$(nix-instantiate --strict --eval --json) releases_json=$(nix-instantiate --strict --argstr system "$system_name" --eval --json)
echo "=== Pushing images to $registry" echo "=== Pushing images to $registry"
for attr in $(echo "$releases_json" | jq -r "keys[]") ; do for attr in $(echo "$releases_json" | jq -r "keys[]") ; do
file=$(echo "$releases_json" | jq -r ".\"$attr\"") file=$(echo "$releases_json" | jq -r ".\"$attr\"")
src=docker-archive://$file src=docker-archive://$file
dst=docker://$registry/$image_prefix/$attr:$image_tag dst=docker://$registry/$image_prefix/$attr:${image_tag}-${system_name}
echo "--- attr=$attr src=$src dst=$dst" echo "--- attr=$attr src=$src dst=$dst"
skopeo copy --insecure-policy "$src" "$dst" skopeo copy --insecure-policy "$src" "$dst"
done done

View File

@@ -3,9 +3,11 @@
# Usage: ./dockerhub-image-matrix # Usage: ./dockerhub-image-matrix
set -euo pipefail set -euo pipefail
system_name=${NIX_SYSTEM_NAME:-x86_64-linux}
## Main ## ## Main ##
releases_json=$(nix-instantiate --strict --eval --json) releases_json=$(nix-instantiate --strict --argstr system "$system_name" --eval --json)
echo "| Image / Tag | Pull |" echo "| Image / Tag | Pull |"
echo "| --- | --- |" echo "| --- | --- |"

View File

@@ -1,5 +1,5 @@
let let
nixpkgs = builtins.fetchTarball "channel:nixos-22.05"; nixpkgs = builtins.fetchTarball "channel:nixos-23.11";
pkgs = import nixpkgs { config = { }; overlays = [ ]; }; pkgs = import nixpkgs { config = { }; overlays = [ ]; };
in in
with pkgs; with pkgs;
@@ -8,6 +8,7 @@ mkShell {
dive dive
jq jq
skopeo skopeo
podman
] ++ lib.optional (pkgs ? mdsh) pkgs.mdsh; ] ++ lib.optional (pkgs ? mdsh) pkgs.mdsh;
shellHook = '' shellHook = ''