From 58a88f0dceb10b69001aa0acb6934af3f4c79020 Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 22 Aug 2026 18:37:58 +0200 Subject: [PATCH 01/15] testing --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d08fc82..ce42d72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,10 @@ jobs: steps: - uses: actions/checkout@v4 - name: Nix build - run: nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}} + run: | + ls -la + echo "nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}} --debug" + HOME="/" nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}} --debug - name: Setup skopeo run: curl -o /etc/containers/policy.json --create-dirs https://raw.githubusercontent.com/containers/skopeo/refs/heads/main/default-policy.json - name: Push Image From a555801be6f0154b5b70cb0824c4db4c3bed4ca4 Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 22 Aug 2026 18:39:01 +0200 Subject: [PATCH 02/15] run this as well --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ce42d72..0b8f025 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,7 @@ on: push: branches: - main + - "*" jobs: buildAndPush: From 8b0f6d3d2d1f7100356c9d524e277de6c43c4aff Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 22 Aug 2026 18:40:02 +0200 Subject: [PATCH 03/15] add `.nix` --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b8f025..221bbfb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,8 @@ jobs: - name: Nix build run: | ls -la + pwd + mkdir -p .nix echo "nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}} --debug" HOME="/" nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}} --debug - name: Setup skopeo From 39e45b1e93e2cb9a2164843d7d53f7ea041c9a34 Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 22 Aug 2026 18:46:07 +0200 Subject: [PATCH 04/15] so what is in `.nix`? --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 221bbfb..c816544 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,8 +21,9 @@ jobs: ls -la pwd mkdir -p .nix - echo "nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}} --debug" - HOME="/" nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}} --debug + echo "nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}}" + HOME="/" nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}} + ls -la .nix - name: Setup skopeo run: curl -o /etc/containers/policy.json --create-dirs https://raw.githubusercontent.com/containers/skopeo/refs/heads/main/default-policy.json - name: Push Image From 23f836e2c851d176cb03ef857fff3bc01ef457ac Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 22 Aug 2026 18:47:03 +0200 Subject: [PATCH 05/15] fix: `nix build .nix` is woefully different from `nix build .#nix` --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c816544..fcefe10 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,8 +21,8 @@ jobs: ls -la pwd mkdir -p .nix - echo "nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}}" - HOME="/" nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}} + echo "nix build --extra-experimental-features "flakes nix-command" .#${{matrix.containers}}" + HOME="/" nix build --extra-experimental-features "flakes nix-command" .#${{matrix.containers}} ls -la .nix - name: Setup skopeo run: curl -o /etc/containers/policy.json --create-dirs https://raw.githubusercontent.com/containers/skopeo/refs/heads/main/default-policy.json From c5765850091603fb933b193b82b9e520b2b65c1d Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 22 Aug 2026 18:48:55 +0200 Subject: [PATCH 06/15] feat: add `nix` as a package to `flake.nix` so the matrix works --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index cdca942..3d56404 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,7 @@ { packages.${system} = rec { default = nix-with-tools; + nix = nix-with-tools; minimal-nix = import (nix + "/docker.nix") { inherit pkgs; From c84bf9b88340145a45ad5512c77d0fb7531bd90d Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 22 Aug 2026 18:52:57 +0200 Subject: [PATCH 07/15] fix: rename the input nix to `inputs.nix` --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 3d56404..a7c616c 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { nixpkgs, nix, self, ... }@inputs: + outputs = { nixpkgs, ... }@inputs: let system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; }; @@ -19,7 +19,7 @@ default = nix-with-tools; nix = nix-with-tools; - minimal-nix = import (nix + "/docker.nix") { + minimal-nix = import (inputs.nix + "/docker.nix") { inherit pkgs; extraPkgs = [ pkgs.nodejs pkgs.busybox ]; @@ -31,7 +31,7 @@ "org.opencontainers.image.description" = "Nix container image with nodejs"; }; }; - nix-with-tools = import (nix + "/docker.nix") { + nix-with-tools = import (inputs.nix + "/docker.nix") { inherit pkgs; extraPkgs = [ pkgs.nodejs From 0c26f377c71af0aa7b4a0739cafef49c20d9f887 Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 22 Aug 2026 19:24:10 +0200 Subject: [PATCH 08/15] chore: remove debug output from `build.yml` --- .github/workflows/build.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fcefe10..7fea7dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,12 +18,7 @@ jobs: - uses: actions/checkout@v4 - name: Nix build run: | - ls -la - pwd - mkdir -p .nix - echo "nix build --extra-experimental-features "flakes nix-command" .#${{matrix.containers}}" - HOME="/" nix build --extra-experimental-features "flakes nix-command" .#${{matrix.containers}} - ls -la .nix + nix build --extra-experimental-features "flakes nix-command" .#${{matrix.containers}} - name: Setup skopeo run: curl -o /etc/containers/policy.json --create-dirs https://raw.githubusercontent.com/containers/skopeo/refs/heads/main/default-policy.json - name: Push Image From a5703817fe03f346ecf4d13d153815fe6bda2269 Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 22 Aug 2026 20:25:22 +0200 Subject: [PATCH 09/15] feat: `nix-host` updates - set up minimal fhs - use root, things work with it - add cache note - correct ordering of `PATH` --- flake.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index a7c616c..b90afe3 100644 --- a/flake.nix +++ b/flake.nix @@ -64,24 +64,28 @@ tag = "latest"; runAsRoot = '' - ${dockerTools.shadowSetup} - useradd -m -s /run/current-system/sw/bin/bash docker-ci + mkdir /etc + # ${pkgs.shadow}/bin/useradd -m -s /run/current-system/sw/bin/bash docker-ci + + chmod 777 /tmp + mkdir -p /var/tmp + chmod 777 /var/tmp ''; # volumes to mount # -v /nix:/nix:ro # -v /run/current-system:/run/current-system + # -v /var/cache/docker-ci:/.cache # -v ${pkgs.buildEnv ... }:/run/container-env config = { Entrypoint = [ "/run/current-system/sw/bin/bash" ]; - User = "1000:1000"; + # User = "1000:1000"; Env = [ "NIX_REMOTE=daemon" "PATH=${lib.concatStringsSep ":" [ + "/run/container-env/bin" "/run/current-system/sw/bin" "/run/current-system/sw/sbin" - "/run/container-env/bin" - # "/run/container-env/sbin" # This might not be needed ]}" "SSL_CERT_FILE=/run/current-system/etc/ssl/certs/ca-bundle.crt" From 6816d1c663094f1d06f4b7b87132597dc119a85e Mon Sep 17 00:00:00 2001 From: Tamipes Date: Tue, 8 Sep 2026 16:53:13 +0200 Subject: [PATCH 10/15] doc: better identation --- flake.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index b90afe3..9480db0 100644 --- a/flake.nix +++ b/flake.nix @@ -83,10 +83,10 @@ Env = [ "NIX_REMOTE=daemon" "PATH=${lib.concatStringsSep ":" [ - "/run/container-env/bin" - "/run/current-system/sw/bin" - "/run/current-system/sw/sbin" - ]}" + "/run/container-env/bin" + "/run/current-system/sw/bin" + "/run/current-system/sw/sbin" + ]}" "SSL_CERT_FILE=/run/current-system/etc/ssl/certs/ca-bundle.crt" "GIT_SSL_CAINFO=/run/current-system/etc/ssl/certs/ca-bundle.crt" From a3696b88fc281fa988cfdfaf3ef19e2ae6f62bb3 Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 22 Aug 2026 18:39:01 +0200 Subject: [PATCH 11/15] feat: run `build.yml` on all branches --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d08fc82..d299a9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,7 @@ on: push: branches: - main + - "*" jobs: buildAndPush: From f1105d9ccbb5a4652a6b4bc706b5b74fd5f1adfb Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 12 Sep 2026 16:58:31 +0200 Subject: [PATCH 12/15] fix: forgot to add `#` in `nix build .#$NAME` --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d299a9d..5142be5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Nix build - run: nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}} + run: nix build --extra-experimental-features "flakes nix-command" .#${{matrix.containers}} - name: Setup skopeo run: curl -o /etc/containers/policy.json --create-dirs https://raw.githubusercontent.com/containers/skopeo/refs/heads/main/default-policy.json - name: Push Image From 7643d4f14a1972173ef7a87f50be227b78a9efcf Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 22 Aug 2026 18:48:55 +0200 Subject: [PATCH 13/15] feat: add `nix` as a package to `flake.nix` so the matrix works --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index cdca942..3d56404 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,7 @@ { packages.${system} = rec { default = nix-with-tools; + nix = nix-with-tools; minimal-nix = import (nix + "/docker.nix") { inherit pkgs; From 6c242c2a7552533538f6d795138c71f86c0c1aec Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 22 Aug 2026 18:52:57 +0200 Subject: [PATCH 14/15] fix: rename the input nix to `inputs.nix` --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 3d56404..a7c616c 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { nixpkgs, nix, self, ... }@inputs: + outputs = { nixpkgs, ... }@inputs: let system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; }; @@ -19,7 +19,7 @@ default = nix-with-tools; nix = nix-with-tools; - minimal-nix = import (nix + "/docker.nix") { + minimal-nix = import (inputs.nix + "/docker.nix") { inherit pkgs; extraPkgs = [ pkgs.nodejs pkgs.busybox ]; @@ -31,7 +31,7 @@ "org.opencontainers.image.description" = "Nix container image with nodejs"; }; }; - nix-with-tools = import (nix + "/docker.nix") { + nix-with-tools = import (inputs.nix + "/docker.nix") { inherit pkgs; extraPkgs = [ pkgs.nodejs From 4e83bf9761382490fe81e8ff7fc7c41dc1be54dc Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sat, 22 Aug 2026 20:25:22 +0200 Subject: [PATCH 15/15] feat: `nix-host` updates - set up minimal fhs - use root, things work with it - add cache note - correct ordering of `PATH` --- flake.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index a7c616c..9480db0 100644 --- a/flake.nix +++ b/flake.nix @@ -64,25 +64,29 @@ tag = "latest"; runAsRoot = '' - ${dockerTools.shadowSetup} - useradd -m -s /run/current-system/sw/bin/bash docker-ci + mkdir /etc + # ${pkgs.shadow}/bin/useradd -m -s /run/current-system/sw/bin/bash docker-ci + + chmod 777 /tmp + mkdir -p /var/tmp + chmod 777 /var/tmp ''; # volumes to mount # -v /nix:/nix:ro # -v /run/current-system:/run/current-system + # -v /var/cache/docker-ci:/.cache # -v ${pkgs.buildEnv ... }:/run/container-env config = { Entrypoint = [ "/run/current-system/sw/bin/bash" ]; - User = "1000:1000"; + # User = "1000:1000"; Env = [ "NIX_REMOTE=daemon" "PATH=${lib.concatStringsSep ":" [ - "/run/current-system/sw/bin" - "/run/current-system/sw/sbin" - "/run/container-env/bin" - # "/run/container-env/sbin" # This might not be needed - ]}" + "/run/container-env/bin" + "/run/current-system/sw/bin" + "/run/current-system/sw/sbin" + ]}" "SSL_CERT_FILE=/run/current-system/etc/ssl/certs/ca-bundle.crt" "GIT_SSL_CAINFO=/run/current-system/etc/ssl/certs/ca-bundle.crt"