Files
ci-images/flake.nix
T

58 lines
1.4 KiB
Nix
Raw Normal View History

2024-04-16 11:56:30 -05:00
{
description = "Standard images that Greg wants to build";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
greg.url = "github:greg-hellings/nixos-config";
};
outputs = inputs@{ self, nixpkgs, flake-utils, greg, flake-parts }:
flake-parts.lib.mkFlake { inherit inputs; } {
flake = {
};
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem = sys@{ config, pkgs, system, ... }: {
_module.args.pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
packages = {
2024-04-16 13:01:12 -05:00
vm-test = let
2024-04-16 14:13:24 -05:00
basicPython = (pkgs.python3.withPackages (p: with p; [ pyyaml ]));
2024-04-16 13:01:12 -05:00
in pkgs.dockerTools.buildLayeredImage {
2024-04-16 11:56:30 -05:00
name = "vm-test";
2024-04-16 12:20:55 -05:00
tag = "latest";
2024-04-16 11:56:30 -05:00
contents = with pkgs; [
bash
2024-04-16 15:40:27 -05:00
pkgs.dockerTools.binSh
pkgs.dockerTools.caCertificates
2024-04-16 12:55:52 -05:00
coreutils
2024-04-16 15:27:33 -05:00
curlWithGnuTls
2024-04-16 15:40:27 -05:00
pkgs.dockerTools.fakeNss
2024-04-16 15:50:17 -05:00
gawk
2024-04-16 12:56:43 -05:00
gnugrep
2024-04-16 11:56:30 -05:00
findutils
jq
packer
shellcheck
2024-04-16 15:40:27 -05:00
pkgs.dockerTools.usrBinEnv
2024-04-16 14:13:24 -05:00
(xonsh.overridePythonAttrs (old: rec { python3 = basicPython; propagatedBuildInputs = old.propagatedBuildInputs ++ [ basicPython.pkgs.pyyaml ];}))
2024-04-16 11:56:30 -05:00
];
2024-04-16 15:24:49 -05:00
extraCommands = builtins.concatStringsSep "\n" [
"mkdir -p tmp"
"chmod 1777 tmp"
2024-04-16 14:53:04 -05:00
];
2024-04-16 15:48:46 -05:00
config.Env = [
"CURL_CA_BUNDLE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
];
2024-04-16 11:56:30 -05:00
};
};
};
};
}