nix-builder/flake.nix

31 lines
893 B
Nix
Raw Normal View History

2024-01-19 03:04:14 +00:00
{
description = "nix builder for ci";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
2024-01-19 03:05:33 +00:00
inputs.attic.url = "github:zhaofengli/attic";
2024-01-19 03:04:14 +00:00
2024-01-19 03:05:33 +00:00
outputs = { self, nixpkgs, attic }: let
2024-01-19 03:04:14 +00:00
pkgs = import nixpkgs { system = "x86_64-linux"; };
in {
packages.x86_64-linux.default = pkgs.dockerTools.buildImage {
name = "nix-builder";
tag = "latest";
2024-01-19 03:05:33 +00:00
copyToRoot = with pkgs; [coreutils cacert nix git git-lfs bash] ++ [attic.packages."x86_64-linux".default];
2024-01-19 03:04:14 +00:00
runAsRoot = ''
#!${pkgs.runtimeShell}
mkdir -p /etc/nix
echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
ln -s $NIX_SSL_CERT_FILE /etc/ssl/certs
'';
config = {
Cmd = ["${pkgs.bash}/bin/bash"];
Env = with pkgs; [
"NIX_SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
];
};
};
};
}