From 7c58135f4aa7bd9db64719a6c611038eebb001a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Mon, 27 Jun 2022 16:53:08 +0100 Subject: [PATCH] fix the buildimage --- .drone.yml | 5 +---- flake.nix | 4 +++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2d2ea7f..c469600 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,11 +7,8 @@ steps: - name: buildImage image: git.chir.rs/darkkirb/nixos-containers:buildimage commands: - - echo "substituters = https://cache.nixos.org/ https://f000.backblazeb2.com/file/cache-chir-rs/" >> /etc/nix/nix.conf - - echo "trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg= hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=" >> /etc/nix/nix.conf - - echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf - nix build '.#buildImage' - - ./result | gzip --fast | skopeo copy --dest-creds=darkkirb:$GITEA_KEY docker-archive:/dev/stdin docker://git.chir.rs/darkkirb/nixos-containers:buildImage --dest-compress-format gzip --dest-compress-level 9 + - cat reuslt | skopeo copy --dest-creds=darkkirb:$GITEA_KEY docker-archive:/dev/stdin docker://git.chir.rs/darkkirb/nixos-containers:buildImage --dest-compress-format gzip --dest-compress-level 9 environment: GITEA_KEY: from_secret: DOCKER_KEY diff --git a/flake.nix b/flake.nix index 9a18bb5..ffc7064 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,7 @@ in rec { formatter = pkgs.alejandra; packages = { - buildImage = pkgs.dockerTools.streamLayeredImage { + buildImage = pkgs.dockerTools.buildLayeredImageWithNixDb { name = "darkkirb/nix-containers"; tag = "build-container"; contents = with pkgs; [ @@ -32,7 +32,9 @@ "USER=nobody" ]; maxLayers = 125; + enableFakechroot = true; fakeRootCommands = '' + mkdir /etc/nix echo "substituters = https://cache.nixos.org/ https://f000.backblazeb2.com/file/cache-chir-rs/" >> /etc/nix/nix.conf echo "trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg= hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=" >> /etc/nix/nix.conf echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf