nix-cache-login/flake.nix

58 lines
1.6 KiB
Nix
Raw Normal View History

2026-02-26 09:25:58 +01:00
{
2026-02-26 11:07:32 +01:00
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
2026-02-26 09:25:58 +01:00
outputs =
2026-02-26 11:07:32 +01:00
{ self, nixpkgs }:
let
2026-02-26 09:25:58 +01:00
systems = [
"x86_64-linux"
"aarch64-darwin"
];
2026-02-26 11:07:32 +01:00
forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn nixpkgs.legacyPackages.${system});
in
{
packages = forAllSystems (pkgs: {
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";
2026-02-26 11:05:16 +01:00
};
2026-02-26 11:07:32 +01:00
};
});
2026-02-26 11:05:16 +01:00
2026-02-26 11:07:32 +01:00
apps = forAllSystems (pkgs: {
default = {
type = "app";
program = "${self.packages.${pkgs.stdenv.hostPlatform.system}.default}/bin/nix-cache-login";
meta.description = "CLI tool for authenticating with a Nix binary cache via OIDC";
};
});
2026-02-26 11:05:16 +01:00
2026-02-26 11:07:32 +01:00
checks = forAllSystems (pkgs: {
tests = self.packages.${pkgs.stdenv.hostPlatform.system}.default.overrideAttrs (_: {
pname = "nix-cache-login-tests";
checkPhase = ''
runHook preCheck
go test ./...
runHook postCheck
'';
doCheck = true;
});
devShell = self.devShells.${pkgs.stdenv.hostPlatform.system}.default;
});
2026-02-26 11:05:16 +01:00
2026-02-26 11:07:32 +01:00
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
go
cobra-cli
];
2026-02-26 09:25:58 +01:00
};
2026-02-26 11:07:32 +01:00
});
2026-02-26 09:25:58 +01:00
};
}