2026-02-26 09:25:58 +01:00
|
|
|
{
|
|
|
|
|
inputs = {
|
|
|
|
|
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; # tracks nixpkgs unstable branch
|
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
outputs =
|
2026-02-26 10:02:57 +01:00
|
|
|
inputs@{ flake-parts, ... }:
|
|
|
|
|
# https://flake.parts/module-arguments.html
|
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
2026-02-26 09:25:58 +01:00
|
|
|
flake = {
|
|
|
|
|
# Put your original flake attributes here.
|
|
|
|
|
};
|
|
|
|
|
systems = [
|
|
|
|
|
# systems for which you want to build the `perSystem` attributes
|
|
|
|
|
"x86_64-linux"
|
|
|
|
|
"aarch64-darwin"
|
|
|
|
|
];
|
|
|
|
|
perSystem =
|
|
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
self',
|
|
|
|
|
inputs',
|
|
|
|
|
pkgs,
|
2026-02-26 11:05:16 +01:00
|
|
|
lib,
|
2026-02-26 09:25:58 +01:00
|
|
|
system,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
{
|
2026-02-26 11:05:16 +01:00
|
|
|
packages.default = pkgs.buildGoModule {
|
|
|
|
|
pname = "nix-cache-login";
|
|
|
|
|
version = "0.1.0";
|
|
|
|
|
src = ./.;
|
|
|
|
|
vendorHash = "sha256-1s77IEGP7/6sgXSNdByRQqisLHSeJuRSsrnxUGfkxos=";
|
|
|
|
|
meta = {
|
|
|
|
|
description = "CLI tool for authenticating with a Nix binary cache via OIDC";
|
|
|
|
|
mainProgram = "nix-cache-login";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
apps.default = {
|
|
|
|
|
type = "app";
|
|
|
|
|
program = "${self'.packages.default}/bin/nix-cache-login";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
checks.tests = self'.packages.default.overrideAttrs (old: {
|
|
|
|
|
pname = "nix-cache-login-tests";
|
|
|
|
|
checkPhase = ''
|
|
|
|
|
runHook preCheck
|
|
|
|
|
go test ./...
|
|
|
|
|
runHook postCheck
|
|
|
|
|
'';
|
|
|
|
|
doCheck = true;
|
|
|
|
|
});
|
|
|
|
|
|
2026-02-26 09:25:58 +01:00
|
|
|
devShells = {
|
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
|
packages = with pkgs; [
|
|
|
|
|
go
|
2026-02-26 11:05:16 +01:00
|
|
|
cobra-cli
|
2026-02-26 09:25:58 +01:00
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|