36 lines
1.1 KiB
Nix
36 lines
1.1 KiB
Nix
{
|
|
description = "nix builder for ci";
|
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
|
|
|
|
outputs = { self, nixpkgs }: let
|
|
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
|
in {
|
|
packages.x86_64-linux.default = pkgs.dockerTools.streamLayeredImage {
|
|
name = "git.celery.eu.org/tezlm/nix-builder";
|
|
tag = "latest";
|
|
contents = with pkgs; [coreutils cacert nix git git-lfs bash attic-client podman];
|
|
|
|
enableFakechroot = true;
|
|
fakeRootCommands = ''
|
|
#!${pkgs.runtimeShell}
|
|
mkdir -p /etc/nix
|
|
echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
|
|
echo "sandbox = false" >> /etc/nix/nix.conf
|
|
echo "build-users-group =" >> /etc/nix/nix.conf
|
|
ln -s $NIX_SSL_CERT_FILE /etc/ssl/certs
|
|
mkdir /tmp
|
|
mkdir -p /var/tmp
|
|
mkdir /etc/containers
|
|
echo '{ "default": [ { "type": "insecureAcceptAnything" } ] }' > /etc/containers/policy.json
|
|
'';
|
|
|
|
config = {
|
|
Cmd = ["${pkgs.bash}/bin/bash"];
|
|
Env = with pkgs; [
|
|
"NIX_SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|